Technical information

Programming - Asset Management
102
RMS Enterprise - NetLinx Programmer’s Guide
Asset Control Methods Registration Functions (Cont.)
RmsAssetControlMethod
ArgumentEnqueue
Description: This function is used to add an asset control method argument to an asset control method registration that is
currently in queue and has not yet been submitted to the RMS server. This method accepts a
RmsAssetControlMethodArgument data type argument.
Arguments:
CHAR assetClientKey[] - asset client key
CHAR methodKey[] - control method key
RmsAssetControlMethodArgument argument
Returns: 1 if call was successful; 0 if call was unsuccessful
Syntax:
DEFINE_FUNCTION CHAR RmsAssetControlMethodArgumentEnqueue(CHAR assetClientKey[],
CHAR methodKey[],
RmsAssetControlMethodArgument argument)
{
STACK_VAR CHAR rmsCommand[RMS_MAX_CMD_LEN];
INTEGER index;
// ensure an asset client key has been provided
IF(assetClientKey == '')
{
SEND_STRING 0, '>>>> RMS API ERROR <RmsAssetControlMethodArgumentEnqueue> :: missing asset client
key';
RETURN FALSE;
}
// ensure a control method key has been provided
IF(methodKey == '')
{
SEND_STRING 0, '>>>> RMS API ERROR <RmsAssetControlMethodArgumentEnqueue> :: missing control
method key';
RETURN FALSE;
}
// ensure a control method argument has been provided
IF(argument.name == '')
{
SEND_STRING 0, '>>>> RMS API ERROR <RmsAssetControlMethodArgumentEnqueue> :: missing control
method argument name';
RETURN FALSE;
}
// ensure a control method argument data type is assigned
IF(argument.dataType == '')
argument.dataType
= RMS_METHOD_ARGUMENT_TYPE_STRING;
// submit the asset registration now
rmsCommand = RmsPackCmdHeader('ASSET.METHOD.ARGUMENT');
rmsCommand = RmsPackCmdParam(rmsCommand,assetClientKey);
rmsCommand = RmsPackCmdParam(rmsCommand,methodKey);
rmsCommand = RmsPackCmdParam(rmsCommand,ITOA(argument.ordinal));
rmsCommand = RmsPackCmdParam(rmsCommand,argument.name);
rmsCommand = RmsPackCmdParam(rmsCommand,argument.description);
rmsCommand = RmsPackCmdParam(rmsCommand,ITOA(argument.dataType));
rmsCommand = RmsPackCmdParam(rmsCommand,argument.defaultValue);
rmsCommand = RmsPackCmdParam(rmsCommand,ITOA(argument.minimumValue));
rmsCommand = RmsPackCmdParam(rmsCommand,ITOA(argument.maximumValue));
rmsCommand = RmsPackCmdParam(rmsCommand,ITOA(argument.stepValue));
FOR(index = 1; index <= LENGTH_ARRAY(argument.enumerationValues); index++)
{
rmsCommand = RmsPackCmdParam(rmsCommand,argument.enumerationValues[index]);
}
SEND_COMMAND vdvRMS, rmsCommand;
RETURN TRUE;
}