6 alarm functions – Sensoray 2518 User Manual
Page 22
Sensoray Model 2518/2519 Ethernet Smart A/D™
19
Programming
6.5.2 GetSensorData()
Returns the most recently acquired sensor data from one
sensor channel. The returned value, SensorData, is
expressed in engineering units that are appropriate for the
channel’s sensor type.
For example, channels configured for any type of
temperature sensor typically return values in Degrees
Centigrade, while channels configured for DC Voltage
measurement return values in Volts.
Channels that have been programmed as sensor type
“Disabled” return indeterminate values.
Refer to “Sensor Specifications” on page 27 for
information regarding the resolution, accuracy and
engineering units that apply to specific sensor types.
6.5.3 GetAllSensors()
Fills an array with sensor data from all channels on a
Smart A/D™. The SensorData argument is a pointer
to an application array which is to receive the sensor
data.
Data values are returned from all sensor channels, even
those that have been declared as type “Disabled.”
Disabled channels return indeterminate values.
As in the GetSensorData function, sensor data are scaled
to engineering units suited to the sensor type. Refer to
“Sensor Specifications” on page 27 for information
regarding the resolution, accuracy and engineering units
that apply to specific sensor types.
6.6 Alarm Functions
Each sensor channel has the ability to detect limit
violations. A limit violation occurs when a channel’s
sensor data value exceeds a programmed threshold.
When such violations are detected, a channel is said to be
“sounding” an alarm.
Alarm limit thresholds are independently programmed
for each channel by means of the SetAlarmLimits
function. After setting these thresholds, alarm sounding
may be enabled under software control.
Although each channel has two alarm limit values, each
channel technically has only one alarm. When either
limit is violated (exceeded), the channel alarm is
asserted.
6.6.1 Alarm States
The following state diagram illustrates the operation of
alarms for an individual sensor channel:
Initially, all channel alarms are disabled and each channel
is in the Disabled state. The SetAlarmEnable function is
used to switch between the Disabled and Armed states.
If a limit violation is detected while the alarm is Armed,
the channel switches to the Sounding state. This causes
the Smart A/D™ Alarm status flag to be asserted. The
Alarm status flag may be accessed indirectly through the
GetAlarms function.
A channel remains in the Sounding state until a
GetAlarms function is executed. When the GetAlarms
function executes, the channel switches to the disabled
state, where it remains until the client again arms the
channel alarm.
6.6.2 SetAlarmLimits()
Declares the upper (HighLimit) and lower
(LowLimit) alarm threshold values for a channel. An
alarm will sound if the target channel’s sensor data value
becomes positive with respect to HighLimit, or
Arguments:
ChannelNumber
Returns:
SensorData
Arguments:
*SensorData
Returns:
void
Arguments:
ChannelNumber
HighLimit
LowLimit
Returns:
void
Disabled
Sounding
Armed
Reset
GetAlarms
Violation
D
is
ar
m
G
etA
larm
s
A
rm
Vi
ol
at
io
n