Technical information

Programming - Asset Management
63
RMS Enterprise - NetLinx Programmer’s Guide
Asset Parameters Registration and Update Functions (Cont.)
RmsAssetOnlineParameter
Enqueue
Description: This function is used to queue an asset online parameter for a specified asset key.
Arguments:
CHAR assetClientKey[]
INTEGER nOnline
Returns: n/a
Syntax:
DEFINE_FUNCTION RmsAssetOnlineParameterEnqueue(CHAR assetClientKey[], INTEGER nOnline)
{
STACK_VAR RmsAssetParameter parameter;
STACK_VAR RmsAssetParameterThreshold threshold;
// device device online parameter
parameter.key = RMS_KEY_ASSET_ONLINE;
parameter.name = 'Online Status';
parameter.description = 'Current asset online or offline state';
parameter.dataType = RMS_ASSET_PARAM_DATA_TYPE_ENUMERATION;
parameter.enumeration = 'Offline|Online';
parameter.allowReset = RMS_ALLOW_RESET_NO;
parameter.stockParam = TRUE;
parameter.reportingType = RMS_ASSET_PARAM_TYPE_ASSET_ONLINE;
parameter.trackChanges = RMS_TRACK_CHANGES_YES;
parameter.resetValue = 'Offline';
IF(nOnline)
{
parameter.initialValue = 'Online';
}
ELSE
{
parameter.initialValue = 'Offline';
}
// enqueue parameter
RmsAssetParameterEnqueue
(assetClientKey, parameter);
// populate default threshold settings
threshold.name = 'Offline';
threshold.comparisonOperator = RMS_ASSET_PARAM_THRESHOLD_COMPARISON_EQUAL;
threshold.value = 'Offline';
threshold.statusType = RMS_STATUS_TYPE_MAINTENANCE;
threshold.enabled = TRUE;
threshold.notifyOnRestore = TRUE;
threshold.notifyOnTrip = TRUE;
// add a default threshold for the device online/offline parameter
RmsAssetParameterThresholdEnqueueEx(assetClientKey,
parameter.key,
threshold)
}
RmsAssetOnlineParameter
Update
Description: This function is used to update an asset online parameter for a specified asset key.
Arguments:
CHAR assetClientKey[]
INTEGER nOnline
Returns: n/a
Syntax:
DEFINE_FUNCTION RmsAssetOnlineParameterUpdate(CHAR assetClientKey[], INTEGER nOnline)
{
// update RMS parameter value for the device online parameter
IF(nOnline)
{
RmsAssetParameterSetValue(assetClientKey,RMS_KEY_ASSET_ONLINE,'Online');
}
ELSE
{
RmsAssetParameterSetValue(assetClientKey,RMS_KEY_ASSET_ONLINE,'Offline');
}
}