Read reference – Sensoray 417 User Manual
Page 17

Instruction Manual
16
Read Reference
This command returns the reference temperature from optional Sensoray termination boards
(TBs), such as Models 7409TB, 7409TC and 7409TDIN. This function is useful for monitoring
thermocouple reference junctions and can also serve as a debugging aid during 417 installation and
application development.
Since two TBs can be connected to the 417, you must specify which TB you are addressing; the
command byte includes a TB address code for this purpose. Set the TB address code to 0 to access
the TB connected to channels 0-15, or to 1 to access the TB connected to channels 16-31.
The returned, signed 16-bit integer, temperature value is scaled to 0.10ºC per bit. If the addressed
TB is not connected to the 417 board, this command will return a meaningless value.
COMMAND: (96 + TBcode)
RESPONSE:
(BoardTemp MSB), (BoardTemp LSB)
VB Code Example:
‘****************************************************************
‘ Generic procedure to read temperature (in degrees C) from a TB.
‘****************************************************************
Function GetTbTemperature!(BasePort%, TbCode%)
Const READ_TB = 96
‘ READ BOARD TEMPERATURE command opcode
‘ Send command opcode to 417 board
Call SendByte(BasePort, READ_TB + TbCode)
‘ Read TB temperature data and convert to degrees C
GetTbTemperature = ReadWord(BasePort%) * 0.1
End Function
‘****************************************************************
‘ Read temperatures from both TBs and convert to degrees F
‘****************************************************************
Dim TbCode
As Integer
‘ TB address code
Dim DegreesF(0 to 1)
As Single
‘ Array to hold temperature data
For TbCode = 0 To 1
DegreesF(TbCode) = 1.8 * GetTbTemperature(BaseAdrs, TbCode) + 32.0
Next TbCode