Technical information
Programming - Asset Management
64
RMS Enterprise - NetLinx Programmer’s Guide
Asset Parameters Registration and Update Functions (Cont.)
RmsAssetParameterSubmit Description: This function is used to submit any pending asset monitored parameter that are currently in queue
waiting to be registered with RMS.
Arguments:
• CHAR assetClientKey[] - asset client key
Returns: 1 if call was successful; 0 if call was unsuccessful
Syntax:
DEFINE_FUNCTION CHAR RmsAssetParameterSubmit(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 <RmsAssetParameterSubmit> :: 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 <RmsAssetParameterSubmit> :: missing asset client key';
RETURN FALSE;
}
// submit the asset parameter registration now
rmsCommand = RmsPackCmdHeader('ASSET.PARAM.SUBMIT');
rmsCommand = RmsPackCmdParam(rmsCommand,assetClientKey);
SEND_COMMAND vdvRMS, rmsCommand;
RETURN TRUE;
}
RmsAssetParameterDelete Description: This function is used to delete an existing asset monitored parameter from the RMS server.
Arguments:
• CHAR assetClientKey[] - asset client key
• CHAR parameterKey[] - monitored parameter key
Returns: 1 if call was successful; 0 if call was unsuccessful
Syntax:
DEFINE_FUNCTION CHAR RmsAssetParameterDelete(CHAR assetClientKey[],
CHAR parameterKey[])
{
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 <RmsAssetParameterDelete> :: 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 <RmsAssetParameterDelete> :: missing asset client key';
RETURN FALSE;
}
// ensure a parameter key has been provided
IF(parameterKey == '')
{
SEND_STRING 0, '>>>> RMS API ERROR <RmsAssetParameterDelete> :: missing parameter key';
RETURN FALSE;
}
// submit the asset parameter delete command
rmsCommand = RmsPackCmdHeader('ASSET.PARAM.DELETE');
rmsCommand = RmsPackCmdParam(rmsCommand,assetClientKey);
rmsCommand =
RmsPackCmdParam(rmsCommand,parameterKey);
SEND_COMMAND vdvRMS, rmsCommand;
RETURN TRUE;
}