Technical information

Programming - Asset Management
60
RMS Enterprise - NetLinx Programmer’s Guide
Asset Parameters Registration and Update Functions (Cont.)
RmsAssetParameter
EnqueueNumber
WithBargraph
Description: This function is used to place an asset parameter registration in queue for a specified asset client key. The
asset parameter being registered is of asset parameter data type: NUMBER
Arguments: see method signature below
Returns: 1 if call was successful; 0 if call was unsuccessful
Syntax:
DEFINE_FUNCTION CHAR RmsAssetParameterEnqueueNumberWithBargraph(CHAR assetClientKey[],
CHAR parameterKey[],
CHAR parameterName[],
CHAR parameterDescription[],
CHAR reportingType[],
SLONG initialValue,
SLONG minimumValue,
SLONG maximumValue,
CHAR units[],
CHAR allowReset,
SLONG resetValue,
CHAR trackChanges,
CHAR bargraphKey[])
{
STACK_VAR RmsAssetParameter parameter
// set all parameter properties for number param
parameter.dataType = RMS_ASSET_PARAM_DATA_TYPE_NUMBER;
parameter.key = parameterKey;
parameter.name = parameterName;
parameter
.description = parameterDescription;
parameter.reportingType = reportingType;
parameter.initialValue = ITOA(initialValue);
parameter.units = units;
parameter.allowReset = allowReset;
parameter.resetValue = ITOA(resetValue);
parameter.trackChanges = trackChanges;
parameter.minimumValue = minimumValue;
parameter.maximumValue = maximumValue;
parameter.bargraphKey = bargraphKey;
RETURN RmsAssetParameterEnqueue(assetClientKey, parameter);
}
// ensure a threshold value has been provided
IF(threshold.value == '')
{
SEND_STRING 0, '>>>> RMS API ERROR <RmsAssetParameterThresholdEnqueueEx> :: missing threshold
value';
RETURN
FALSE;
}
// if a status type was not provided, then apply the NOT_ASSIGNED status type
IF(threshold.statusType == '')
{
threshold.statusType = RMS_STATUS_TYPE_NOT_ASSIGNED;
}
// submit the asset parameter update now
rmsCommand = RmsPackCmdHeader('ASSET.PARAM.THRESHOLD');
rmsCommand = RmsPackCmdParam(rmsCommand,assetClientKey);
rmsCommand = RmsPackCmdParam(rmsCommand,parameterKey);
rmsCommand = RmsPackCmdParam(rmsCommand,threshold.name);
rmsCommand = RmsPackCmdParam(rmsCommand,RmsBooleanString(threshold.enabled));
rmsCommand = RmsPackCmdParam(rmsCommand,threshold.statusType);
rmsCommand = RmsPackCmdParam(rmsCommand,threshold.comparisonOperator);
rmsCommand = RmsPackCmdParam(rmsCommand
,threshold.value);
rmsCommand = RmsPackCmdParam(rmsCommand,RmsBooleanString(threshold.notifyOnTrip));
rmsCommand = RmsPackCmdParam(rmsCommand,RmsBooleanString(threshold.notifyOnRestore));
IF(threshold.delayInterval > 0)
{
rmsCommand = RmsPackCmdParam(rmsCommand,'true'); // delayed = TRUE
}
ELSE
{
rmsCommand = RmsPackCmdParam(rmsCommand,'false'); // delayed = FALSE
}
rmsCommand = RmsPackCmdParam(rmsCommand,ITOA(threshold.delayInterval));
SEND_COMMAND vdvRMS, rmsCommand;
}