Technical information
Programming - Asset Management
74
RMS Enterprise - NetLinx Programmer’s Guide
Synchronizing Asset Parameter Values
The following callback method will be invoked in each asset monitoring module when it is time to perform the Asset parameter
value synchronization with RMS.
(***********************************************************)
(* Name: SynchronizeAssetParameters *)
(* Args: -none- *)
(* *)
(* Desc: This is a callback method that is invoked by *)
(* RMS to notify this module that it is time to *)
(* update/synchronize this asset parameter values *)
(* with RMS. *)
(* *)
(* This method should not be invoked/called *)
(* by any user implementation code. *)
(***********************************************************)
DEFINE_FUNCTION SynchronizeAssetParameters(RmsAsset asset)
{
}
The RmsApi.axi Include File (which is already included by each asset monitoring module) provides the following wrapper function
for updating asset parameter values with RMS. These functions queue parameter value changes and only forward them to the RMS
server when the Submit method is called. This queuing technique should be used when there are more than 2 parameter updates
that occur back-to-back.
RmsAssetParameterEnqueueSetValueBoolean (see page 71)
RmsAssetParameterEnqueueSetValueNumber (see page 71)
RmsAssetParameterEnqueueSetValueDecimal (see page 71)
RmsAssetParameterEnqueueSetValueLevel (see page 72)
RmsAssetParameterEnqueueSetValue (see page 72)
RmsAssetParameterEnqueueUpdateValue (see page 73)
RmsAssetParameterUpdatesSubmit (see page 74)
Asset Parameter Set Value Functions via Update Queue (Cont.)
RmsAssetParameter
UpdatesSubmit
Description: This function is used to submit all pending asset parameter value updated to the RMS server.
Arguments:
• CHAR assetClientKey[] - asset client key
Returns: 1 if call was successful; 0 if call was unsuccessful
Syntax:
DEFINE_FUNCTION CHAR RmsAssetParameterUpdatesSubmit(CHAR assetClientKey[])
{
STACK_VAR CHAR rmsCommand[RMS_MAX_CMD_LEN];
// ensure RMS is ONLINE, REGISTERED, and ready for ASSET registration
IF(![vdvRMS,RMS_CHANNEL_ASSETS_REGISTER])
{
SEND_STRING 0, '>>>> RMS API ERROR <RmsAssetParameterUpdatesSubmit> :: RMS is not ready to accept
asset parameters changes.';
RETURN FALSE;
}
// ensure an asset client key has been provided
IF(assetClientKey == '')
{
SEND_STRING 0, '>>>> RMS API ERROR <RmsAssetParameterUpdatesSubmit> :: missing asset client key';
RETURN FALSE;
}
// submit the pending asset parameter updates now
rmsCommand = RmsPackCmdHeader('ASSET.PARAM.UPDATE.SUBMIT');
rmsCommand = RmsPackCmdParam(rmsCommand,assetClientKey);
SEND_COMMAND vdvRMS, rmsCommand;
RETURN TRUE;
}