Setfailmode, 2 setfailmode – Sensoray 118 User Manual
Page 21

Sensoray Model 118 Smart A/D™ Instruction Manual
19
Commands: Channel Configuration
6.2.2 SetFailMode
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.
Driver
// Set Open Sensor data values for all eight channels.
VOID SetFailMode( USHORT BasePort, UCHAR OpenFlags )
{
SendByte( CMD_SET_OPENFLAGS );
SendByte( OpenFlags );
}
Example
// A controller uses a thermocouple on channel 1 to monitor furnace
// temperature. If the thermocouple fails, the Smart A/D must indicate
// a high temperature on channel 1 to ensure that the controller turns off
// the furnace heater. This code segment sets up channel 1 to fail high
// and all other channels to fail low.
SetFailMode( MyBasePort, 0x02 ); // OpenFlags = (0,0,0,0,0,0,1,0)
Command: (80),(OpenFlags)
Response:
None