User Guide

Custom Device Monitoring Programming
45
RMS NetLinx Programmer’s Guide
Monitoring A Single NetLinx-connected Device
The RMSCommon.axi include file provides two functions that help to monitor
the Online/Offline status of a NetLinx connected device. You can use these
functions to monitor a device like a touch panel or bus box. These two functions
are:
RMSNetLinxDeviceOnline(dvDPS, cName)
RMSNetLinxDeviceOffline(dvDPS)
RMSNetLinxDeviceOnline() will register the device and the online/offline
parameter as well as set the parameter to online. This function will need to be
called in two places. Call RMSNetLinxDeviceOnline() in the
RMSDevMonRegisterCallback() function to make sure it is registered when the
RMS engine module connects to the RMS server. Also, call
RMSNetLinxDeviceOnline() when the NetLinx-connected device reports online.
RMSNetLinxDeviceOffline() updates the online/offline parameter to offline. It
only needs to be called when the NetLinx-connected device reports offline.
For example, to monitor a touch panel, add the following code:
DEFINE_DEVICE
dvTP = 10000:1:0
DEFINE_FUNCTION RMSDevMonRegisterCallback()
{
RMSNetLinxDeviceOnline(dvTP,'Touch Panel 1')
}
DEFINE_EVENT
DATA_EVENT[dvTP]
{
ONLINE:
RMSNetLinxDeviceOnline(dvTP,'Touch Panel 1')
OFFLINE:
RMSNetLinxDeviceOffline(dvTP)
}