Technical information
Programming - Advanced Topics
114
RMS Enterprise - NetLinx Programmer’s Guide
If you need to implement some logic based on System Power state 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: SystemPowerChanged *)
(* Args: powerOn - boolean value representing ON/OFF *)
(* *)
(* Desc: This is a callback method that is invoked by *)
(* RMS to notify this module that the SYSTEM POWER *)
(* state has changed states. *)
(* *)
(* This method should not be invoked/called *)
(* by any user implementation code. *)
(***********************************************************)
DEFINE_FUNCTION SystemPowerChanged (CHAR powerOn)
{
// optionally implement logic based on
// system power state.
}
Implementing System Modes
RMS SDK 4.0 introduces a new feature concept of System Modes. System Modes can be used if your location supports the concept
of configuring the control system and user experience by choosing a named startup mode of behavior. Modes such as Presentation,
Video Conference, Audio Conference, etc are common system modes of behavior.
The RMS SDK does not provide any concrete implementation of System Mode, but does provide the communications
infrastructure for System Mode changes and event notifications. NetLinx programmers must provide any concrete implementation
of System Modes in the user program.
First, if you wish to provide System Modes on the target NetLinx controller, you must first enable the compiler directive in the
RmsControlSystemMonitor module and define a pipe-delimited series of available named modes.
// comment out the HAS_SYSTEM_MODES compiler directive
// if you do not wish to register a 'System Mode' control
// method for this control system. Some implementations
// may not warrant/desire the concept of system mode convention.
#WARN 'Define if you want a SYSTEM MODES such as Presentation, Video Conf, etc ...'
// to include the system mode parameter and system mode control method
// this module definition is required
DEFINE_MODULE 'RmsSystemModeMonitor' mdlRmsSystemModeMonitorMod(vdvRMS,dvMaster,SYSTEM_MODES);
Enabling this compiler directive will cause the System asset to register System Modes asset control methods.
Next, you must implement the logic for what actions to take when the System Mode changes. You can use the event subscription
model to get notified when the system mode changes via callback methods invoked by the RmsEventListener.axi Include File.
#DEFINE INCLUDE_RMS_EVENT_SYSTEM_MODE_REQUEST_CALLBACK
// THIS CALLBACK METHOD IS INVOKED AUTOMATICALLY WHEN
// RMS HAS REQUESTED THAT THE SYSTEM MODE BE CHANGED
DEFINE_FUNCTION RmsEventSystemModeChangeRequest (CHAR newMode[])
{
// IMPLEMENT LOGIC FOR SYSTEM MODE CHANGE
}
This event subscriber and listener callback method are automatically provided if you
include the RmsSystemEventHandler.axi Include File.