Chapter 6
NI-FBUS Function Reference
©
National Instruments Corporation
6-59
NI-FBUS Hardware and Software User Manual
nifWaitAlert
Purpose
Waits for an alert (an event or an alarm) from a specific device or from
any
device.
Format
nifError_t
nifWaitAlert(
nifDesc_t ud,
nifAlertData_t *aldata,
uint8 alertPriority)
Input
ud
The descriptor of the session, link, physical device, VFD, block,
or link the alert comes from.
alertPriority
Lowest priority of the alert coming in that you want to wait on.
Output
aldata
The information about the specific alert.
Context
Block, VFD, physical device, link, session.
Description
nifWaitAlert
only supports normal alert types and does not support Standard Diagnostics
Alert. It is recommended to use
nifWaitAlert2
instead.
ud
represents a descriptor of a session, link, a physical device, a VFD, or a block. If
ud
is a VFD descriptor, then the NI-FBUS Communications Manager waits for an alert from
any block in the Virtual Field Device. If
ud
is a block, the NI-FBUS Communications
Manager waits for an alarm or event from the block
ud
refers to. If
ud
represents a link,
nifWaitAlert
completes when an event is received from any device connected to that link.
If the descriptor is a session descriptor, the function waits on any event from any attached link.
nifWaitAlert
waits indefinitely until the NI-FBUS Communications Manager receives an
alert with a priority greater than or equal to the input alert priority. Your application can have
a dedicated thread which does
nifWaitAlert
only.
When the NI-FBUS Communications Manager interface receives an alert, the
aldata
parameter is filled in with the information about the
aldata
. The form of
aldata->alertData
depends on the value of
aldata->alertType
.
aldata->alarmOrEventName
is the name of the alarm parameter or event parameter that
caused the alert.
aldata->deviceTag
and
aldata->blockTag
are the tags of the device
and the block of the alarm, respectively.