Technical information
Programming - Asset Management
105
RMS Enterprise - NetLinx Programmer’s Guide
Executing Asset Control Functions
The following callback method will be invoked in each asset monitoring module when it is time to execute an asset control
method. The NetLinx programmer can then take specific action based on the provided method key and parse any method
arguments from the provided arguments character array. Arguments will remain packed (encoded) in the character array, and use
the "RmsParseCmdParam" function to extract each method argument. The method arguments will be ordered in the packed array
by their ordinal index with which they were registered.
(***********************************************************)
(* Name: ExecuteAssetControlMethod *)
(* Args: methodKey - unique method key that was executed *)
(* arguments - array of argument values invoked *)
(* with the execution of this method. *)
(* *)
(* Desc: This is a callback method that is invoked by *)
(* RMS to notify this module that it should *)
(* fulfill the execution of one of this asset's *)
(* control methods. *)
(* *)
(* This method should not be invoked/called *)
(* by any user implementation code. *)
(***********************************************************)
DEFINE_FUNCTION ExecuteAssetControlMethod (CHAR methodKey[], CHAR arguments[])
{
SELECT
{
// SLEEP
ACTIVE(methodKey == 'touch.panel.sleep'):
{
SEND_COMMAND dvMonitoredDevice,'SLEEP'
}
// SETUP
ACTIVE(methodKey == 'touch.panel.setup'):
{
SEND_COMMAND dvMonitoredDevice,'SETUP'
}
// BRIGHTNESS LEVEL 1-100
ACTIVE(methodKey == 'touch.panel.brightness'):
{
STACK_VAR CHAR brightnessArgument[5];
brightnessArgument = RmsParseCmdParam(arguments);
SEND_COMMAND dvMonitoredDevice,"'BRIT-',brightnessArgument"
}
// MUTE ON/OFF
ACTIVE(methodKey == 'touch.panel.volume.mute'):
{
STACK_VAR CHAR muteArgument[5];
muteArgument = RmsParseCmdParam(arguments);
SEND_COMMAND dvMonitoredDevice,"'^MUT-',ITOA(RmsBooleanValue(muteArgument))"
}
}
}
Please review the NetLinx code samples and RmsApi.axi code comments for more details on executing asset control methods.