Technical information

Programming - Advanced Topics
115
RMS Enterprise - NetLinx Programmer’s Guide
If you need to implement some logic based on System Mode changes on a specific asset/device then there is already a callback
method stub implemented inside each device monitor module. Just add your implementation logic to the body of this existing
callback method:
(***********************************************************)
(* Name: SystemModeChanged *)
(* Args: modeName - string value representing mode change *)
(* *)
(* Desc: This is a callback method that is invoked by *)
(* RMS to notify this module that the SYSTEM MODE *)
(* state has changed states. *)
(* *)
(* This method should not be invoked/called *)
(* by any user implementation code. *)
(***********************************************************)
DEFINE_FUNCTION SystemModeChanged (CHAR newMode[])
{
// optionally implement logic based on
// newly selected system mode name.
}
Programmatically Setting the Client Configuration
The default method to enable and configure a NetLinx system for use with RMS is to use the RMS Client Web Configuration page
exposed by the NetLinx master's web-based configuration tools.
Alternatively, the RMS SDK also supports a SEND_COMMAND API for settings RMS client configuration. See the RMS Client
Settings & Configuration - Command API section on page 136 for a complete listing of the available API options and commands.
Below is an example of a RMS configuration applied via the command API.
// SET RMS CLIENT CONFIGRUATION
SEND_COMMAND vdvRMS, 'CONFIG.CLIENT.NAME-MyNetLinxMaster'
SEND_COMMAND vdvRMS, 'CONFIG.SERVER.URL-http://myserver.mycompany.com/rms'
SEND_COMMAND vdvRMS, 'CONFIG.SERVER.PASSWORD-password'
// ENABLE THE RMS CLIENT AS THE LAST STEP
SEND_COMMAND vdvRMS, 'CONFIG.CLIENT.ENABLED-true'
Listening for RMS Client Connections
If your NetLinx program needs to listen for RMS client connection status, there are a couple of options you can use. The simplest
method is to monitor channel 250 for client connectivity and channel 251 for client registered status on the RMS NetLinx virtual
device interface. Alternatively, the following event notifications are provided via the RmsEventListener.axi Include File that
provide details on RMS client connectivity.
This event subscription and event notification callback method indicates when the RMS client becomes connected to the RMS
server:
#DEFINE INCLUDE_RMS_EVENT_CLIENT_ONLINE_CALLBACK
DEFINE_FUNCTION RmsEventClientOnline()
{
}
This event subscription and event notification callback method indicates when the RMS client becomes disconnected from the
RMS server:
#DEFINE INCLUDE_RMS_EVENT_CLIENT_OFFLINE_CALLBACK
DEFINE_FUNCTION RmsEventClientOffline()
{
}
This event subscription and event notification callback method indicates the RMS client is connected and registered on the RMS
system:
#DEFINE INCLUDE_RMS_EVENT_CLIENT_REGISTERED_CALLBACK
DEFINE_FUNCTION RmsEventClientRegistered()
{
}