beautypg.com

Sensoray 518 User Manual

Page 25

background image

24

Read Alarm Flags

This command returns the status of all channel alarms in two response bytes. The first response
byte contains the status of all high alarms while the second byte contains the status of all low
alarms. Bit 7 (most significant) through bit 0 (least significant) of each alarm status byte
corresponds to channel 7 through 0, respectively. A status bit containing logic one indicates a
violated alarm limit while a logic zero indicates no limit violation.

In addition to returning alarm flag data, this command also resets all channel alarm flags as well
as the coprocessor status register ALARM bit.

COMMAND: (48)
RESPONSE: (HIGH ALARM LIMIT FLAGS),(LOW ALARM LIMIT FLAGS)

EXAMPLE:

‘ Read alarm flags from 518 and print messages for any alarming channels. |

CALL Send518byte (48) ‘send command to 518

HiFlags% = Read518byte (BasePort%) ‘read high alarm flags from 518
LoFlags% = Read518byte (BasePort%) ‘read low alarm flags from 518

FOR Channel% = 0 TO 7 ‘print alarm messages
Mask% = 2 ^ Channel%
IF HiFlags% AND Mask% THEN PRINT “Channel “; Channel%; “high alarm”
IF LoFlags% AND Mask% THEN PRINT “Channel “; Channel%; “low alarm”
NEXT Channel%