beautypg.com

Sensoray 518 User Manual

Page 23

background image

22

Set Channel Alarm Limits

This command declares upper and lower alarm limits for a channel. An alarm will ‘sound’ if
channel sensor data strays outside of the specified limits. The alarm sounds by setting the
ALARM bit in the status register and optionally interrupting the host.

Alarm limits assume default values when the coprocessor is reset. All low limits default to -
32768, and all high limits default to 32767. These values effectively disable the alarm function.

To disable the lower limit, specify a lower limit of -32768. Similarly, declare an upper limit of
32767 to disable the upper limit.

When an alarm “sounds”, the violated limit is reset to the default value. This prevents the alarm
from sounding again after the host has acknowledged the alarm. The host must reprogram the
violated limit to re-arm it for monitoring by the coprocessor.


COMMAND: (32 + CHAN),(HIGH LIMIT MSB), (HIGH LIMIT LSB),
(LOW LIMIT MSB), (LOW LIMIT LSB)

RESPONSE: NONE

EXAMPLE:

‘ Channel 7 is monitoring a K thermocouple connected to a plastic |
‘ extruder. The extruder temperature must fall between 400 and 450 |
‘ degrees C for proper operation. This code segment programs the |
‘ channel 7 alarm limits so that the 518 alarm flag will be raised |
‘ if the temperature strays outside operating limits. |

Chan% = 7
Opcode% = 32 ‘command opcode
Scalar! = 0.17 ‘K thermocouple data scalar (from table)
HiLim% = 450.0 / Scalar! ‘compute high alarm limit value
LoLim% = 400.0 / Scalar! ‘compute low alarm limit value

CALL Send518byte (BasePort%, Chan% + Opcode%) ‘send channel & opcode to 518
CALL Send518word (BasePort%, HiLim%) ‘send high limit to 518CALL
Send518word (BasePort%, LoLim%) ‘send low limit to 518