Sensoray 518 User Manual
Page 24

23
Set Open Sensor Data Values
This command establishes open sensor data values for all channels. The second command byte
contains eight flags, one for each channel. Flags are mapped to channels as follows: bit 7 (most
significant) to channel 7, bit 6 to channel 6, etc.
If a flag is set (logic 1) and the corresponding sensor is open, the value 32767 will replace the
sensor data. On the other hand, if a flag is reset and the sensor is open, the value -32768 will
replace the sensor data.
This function is useful for triggering alarms when open sensors are detected, and for forcing the
desired system response to fault conditions in closed-loop process control applications.
COMMAND: (80), (OPEN SENSOR DATA FLAGS)
RESPONSE: NONE
EXAMPLE:
‘ A proportional controller uses a J thermocouple on channel 1 to monitor |
‘ furnace temperature. If the thermocouple fails, the 518 should indicate |
‘ a high temperature on channel 1 to ensure that the controller turns off |
‘ the furnace heating element. This code segment sets up channel 1 to |
‘ fail high (all other channels are set up to fail low). |
CALL Send518byte (80) ‘send command to 518
CALL Send518byte (&H02) ‘send flags to 518: (x,x,x,x,x,x,1,x)
EXAMPLE:
‘ Prompt the operator for the desired open-sensor conditions for all |
‘ eight sensor channels, then send the required command to the 518. |
Flags% = 0
‘initialize open-sensor flags
FOR Channel% = 0 TO 7
INPUT “Enter channel”; Channel%; “flag (0 or 1):”, F% ‘get flag from operator
Flags% = Flags% + F% * 2 ^ Channel% ‘set flag if 1 was entered
NEXT Channel%
CALL Send518byte (80) ‘send opcode to 518
CALL Send518byte (Flags%) ‘send flags to 518