beautypg.com

Set fail mode – Sensoray 417 User Manual

Page 21

background image

Instruction Manual

20

Set Fail Mode

This command establishes open sensor data values for a group of eight channels. The first com-
mand byte contains the command opcode and a Group Code that specifies which 8-channel group
is being addressed. The second byte contains eight Mode Flag bits, one for each channel. Mode
Flags are mapped to channels as shown in the following table:

If a flag is set to logic 1 and the corresponding sensor is open, the value 32767 will replace the sen-
sor data, causing it to “fail high.” If the flag is reset, the value -32768 will replace the open-sensor
data, causing it to “fail low.” Following a hard or soft board reset, all channels automatically
default to fail high.

Example: to program channel 21 to fail low, set GroupCode to 2 and reset bit 5 of the Mode Flags
to 0. Note that channels 16 through 23 are simultaneously programmed.

This function is useful for triggering alarms when open sensors are detected and for achieving the
desired system response to fault conditions in closed-loop process control applications.

COMMAND: (128 + GroupCode), (ModeFlags)

RESPONSE:

NONE

VB Code Example:

‘***********************************************************************

‘ Generic procedure to set fail mode for 8 channels.

‘***********************************************************************

Sub SetFailMode(GroupCode%, ModeFlags%)

Call SendByte(128 + GroupCode)

‘Send Opcode & Channel Group to 417

Call SendByte(ModeFlags)

‘Send Mode Flags to 417

End Sub

‘***********************************************************************

‘ A thermocouple is monitoring a process temperature on channel 24. If

‘ the thermocouple fails, the 417 must indicate a high temperature to

‘ ensure that the control heater is turned off. Program channels 24-26

‘ to fail high, and channels 27-31 to fail low.

‘***********************************************************************

Call SetFailMode(3, 7) ‘Set fail mode for chans 24-31: (0,0,0,0,0,1,1,1)

Table 8: Channel mapping for ModeFlags byte

Group

Code

ModeFlags Byte

D7

D6

D5

D4

D3

D2

D1

D0

0

A

d

d

re

ss

e

d

C

h

a

n

n

e

l

7

6

5

4

3

2

1

0

1

15

14

13

12

11

10

9

8

2

23

22

21

20

19

18

17

16

3

31

30

29

28

27

26

25

24