Sensoray 518 User Manual
Page 21

20
Read Channel Data
This command returns the most recently acquired sensor data from a channel. The returned
integer value is scaled as a function of the channel sensor type. Regardless of sensor type, the
returned value is always represented in 16-bit two’s complement form. Refer to the Sensor
Tables section for a listing of sensor scaling factors.
COMMAND: (CHAN)
RESPONSE: (HIGH DATA), (LOW DATA)
EXAMPLE
‘ Channel 6 is configured for +/- 5 volt input signal measurement.
‘ Read and display the voltage measured at channel 6.
Channel% = 6
Scalar! = 0.0005 ‘from Sensor Tables, scalar = 500uV
CALL Send518byte (BasePort%, Channel%) ‘send command to 518
ChanData% = Read518word (BasePort%) ‘read scaled data from 518
V! = ChanData% * Scalar! ‘convert scaled data to volts
PRINT “Channel 6 data: “; V!; “Volts” ‘display voltage
EXAMPLE:
‘ Channel 4 is configured for a type K thermocouple.
‘ Read and display the temperature measured at channel 4.
Scalar! = 0.17
CALL Send518byte (BasePort%, 4)
Chan4temp! = Scalar! * Read518word (BasePort%)
PRINT “Channel 4 data: “; Chan4temp!; “degrees Centigrade”