Technical information
Programming - Client Messaging
109
RMS Enterprise - NetLinx Programmer’s Guide
Programming - Client Messaging
Listening for Client Display Messages
If you have implemented the RMS Application GUI modules and integrated the RMS touch panel pages, then client display
messages from RMS are automatically handled and displayed to the touch panels.
However, if you need to display the message content to some other device, or if you are implementing the logic on your own, then
obtaining a notification when the RMS system has delivered a message intended for display is quite simple.
The following example will use the RmsEventListener.axi Include File, and subscribe to an event callback to get the display
message notification. Refer to the documentation for RmsEventListener.axi and see the Listening for RMS Notification
Events section on page 111 for more details on the inner workings of the notification callback in RMS.
First, you must subscribe to the event notification. This is done using the following compiler directive. Make sure this is defined in
your user NetLinx program.
// SUBSCRIBE TO DISPLAY MESSAGE CALLBACK NOTIFICATIONS
#DEFINE INCLUDE_RMS_EVENT_DISPLAY_MESSAGE_CALLBACK
Next, you must define the following callback method in your user NetLinx program. The method will automatically be invoked by
the RMS SDK anytime a display message is received. You should implement your custom display logic inside this callback
method.
// CALLBACK METHOD FOR DISPLAY MESSAGE EVENT NOTIFICATIONS
DEFINE_FUNCTION RmsEventDisplayMessage(CHAR type[],
CHAR title[],
CHAR body[],
INTEGER timeoutSeconds,
CHAR modal),
CHAR responseMessage,)
LONG locationId,
CHAR isDefaultLocation)
{
// IMPLEMENT MESSAGE DISPLAY HERE
}
responseMessage
This parameter indicates whether the received message is a response message to a service provider request. For example, if a Help
Request is sent from the Touch Panel to the RMS Web Application and is displayed in the RMS Hotlist, an RMS Administrator can
respond to the request by sending a reply message.
If this administrator takes this action on the service provider request item, then the message received on the NetLinx
system will include the “responseMessage” parameter set to TRUE.
If the RMS Administrator sends an unsolicited or generic message to the location, then this “responseMessage”
parameter will be set to FALSE.
locationId
This parameter indicates the targeted location destination for the display message. There are cases where the system may receive
more than one display message assigned to different locations. One such case is when the system contains a Touch Panel asset that
has been reassigned in the RMS web user interface to another location.
If a message is destined for this relocated Touch Panel asset, then a display message will be delivered with the alternate
location ID. The “isDefaultLocation” parameter indicates if the location is the default location for this client gateway of
if the message is destined for an alternate location.
The client gateway will only receive display messages for alternate locations if a touch panel that is physically
connected to this client gateway asset has been reassigned to an alternate location in the RMS web interface.