Technical information
Programming - Asset Management
73
RMS Enterprise - NetLinx Programmer’s Guide
Asset Parameter Set Value Functions via Update Queue (Cont.)
RmsAssetParameter
EnqueueUpdateValue
Description: This function is used to update an asset parameter value on the RMS server. The update is not sent
immediately, but rather placed in an update queue waiting for a submission call.
Arguments:
• CHAR assetClientKey[] - asset client key
• CHAR parameterKey[] - monitored parameter key
• CHAR parameterOperation[] - update operation
• CHAR parameterValue[] - update parameter value
Returns: 1 if call was successful; 0 if call was unsuccessful
Syntax:
DEFINE_FUNCTION CHAR RmsAssetParameterEnqueueUpdateValue(CHAR assetClientKey[],
CHAR parameterKey[],
CHAR parameterOperation[],
CHAR parameterValue[])
{
STACK_VAR CHAR rmsCommand[RMS_MAX_CMD_LEN];
// ensure RMS is ONLINE, REGISTERED, and ready for ASSET registration
IF(![vdvRMS,RMS_CHANNEL_ASSETS_REGISTER])
{
RETURN FALSE;
}
// ensure an asset client key has been provided
IF(assetClientKey == '')
{
SEND_STRING 0, '>>>> RMS API ERROR <RmsAssetParameterEnqueueUpdateValue> :: missing asset client
key';
RETURN FALSE;
}
// ensure a parameter key has been provided
IF(parameterKey == '')
{
SEND_STRING 0, '>>>> RMS API ERROR <RmsAssetParameterEnqueueUpdateValue> :: missing parameter
key';
RETURN FALSE;
}
// if an operation was not provided, then apply the SET operation
IF(parameterOperation == '')
{
parameterOperation = RMS_ASSET_PARAM_UPDATE_OPERATION_SET;
}
// enqueue the asset parameter update
rmsCommand
= RmsPackCmdHeader('ASSET.PARAM.UPDATE');
rmsCommand = RmsPackCmdParam(rmsCommand,assetClientKey);
rmsCommand = RmsPackCmdParam(rmsCommand,parameterKey);
rmsCommand = RmsPackCmdParam(rmsCommand,parameterOperation);
rmsCommand = RmsPackCmdParam(rmsCommand,parameterValue);
rmsCommand = RmsPackCmdParam(rmsCommand,'false'); // SUBMIT-NOW = FALSE
SEND_COMMAND vdvRMS, rmsCommand;
RETURN TRUE;
}