Download Print this page

Set Emissivity - Land Instruments International SPOT User Manual

Modbus controls

Advertisement

User Guide
Longer read intervals risk loss of data, particularly on a Windows platform
where timer scheduling is not absolute.
//Logging code called on a timer, interval of 50*output time is
recommended
Array =
ModbusRead
buffer
Pointer = Array[0]
is at this position
ReadCount = Pointer - OldPointer + 1
// ReadCount is the number of values since the last buffer read, plus
one so we check the last buffer pointer value hasn't changed
if
(ReadCount < 0) ReadCount = ReadCount + 100; HasWrapped = true
// In case writing has started again at position 0 since the last read
if
(HasWrapped) {
For
i = OldPointer+1
array position 1 to 101 not 0 to 100, so add 1 to OldPointer
For i
= 1
to
// and start at position 1
} else {
For i = OldPointer+1 to Pointer: AddToLog Array[i]
}
if
(Array[OldPointer + 1] != OldPointerValue)
error. Ouput data has been missed")
// If the value at the old pointer position has changed, the buffer is
not being read often enough.

2.3 Set Emissivity

The emissivity used within the instrument for temperature calculation is held
in register 10, or in registers 10 and 11 for a dual detector instrument.
To change the emissivity of the instrument, or of channel 1, to 0.9 use:
ModbusWrite
To change the emissivity of both channels on a dual detector instrument to
0.9 use:
Array = (900,900)
ModbusWriteMany
Continued...
(254,101)
// The last data point in the circular buffer
to
100:
ReadCount - (100-OldPointer):
(10, 900)
(10, 2, Array)
// Read the buffer pointer and the whole
AddToLog
Array[i]
AddToLog
ReportError
Spot Modbus Controls
// Data is in
Array[i]
("Buffer read
Page 9

Advertisement

loading