This Method is used to add Variables to the PublishedData Property. The PublishedData contains a list of published Variables of a PublishedDataItemsType Object. The information provided in the input Arguments and information available for the added Variables is also used to create the content of the DataSetMetaData Property. The mapping to the DataSetMetaData is described for the input Arguments.
Variables shall be added at the end of the list in PublishedData. This ensures that Subscribers are only affected by the change if they are interested in the added Variables.
If at least one Variable was added to the PublishedData, the MinorVersion of the ConfigurationVersion shall be updated. The ConfigurationVersionDataType and the rules for setting the version are defined in 6.2.3.2.6.
The Client shall be authorized to modify the configuration for the PubSub functionality when invoking this Method on the Server.
Signature
AddVariables (
[in]ConfigurationVersionDataType ConfigurationVersion,
[in]String[] FieldNameAliases,
[in]Boolean[] PromotedFields,
[in]PublishedVariableDataType[] VariablesToAdd,
[out]ConfigurationVersionDataType NewConfigurationVersion,
[out] StatusCode[] AddResults
);
Argument |
Description |
ConfigurationVersion |
Configuration version of the DataSet. The configuration version shall match the entire current configuration version of the Object when the Method call is processed. If it does not match, the result Bad_InvalidState shall be returned. The ConfigurationVersionDataType is defined in 6.2.3.2.6. |
FieldNameAliases |
The names assigned to the selected Variables for the fields in the DataSetMetaData and in the DataSetMessages for tagged message encoding. The size and the order of the array shall match the VariablesToAdd. The string shall be used to set the name field in the FieldMetaData that is part of the DataSetMetaData. |
PromotedFields |
The flags indicating if the corresponding field is promoted to the DataSetMessage header. The size and the order of the array shall match the VariablesToAdd. The flag is used to set the PromotedField flag in the fieldFlags parameter in the FieldMetaData. |
VariablesToAdd |
Array of Variables to add to PublishedData and the related configuration settings. Successfully added variables are appended to the end of the list of published variables configured in the PublishedData Property. Failed variables are not added to the list. The PublishedVariableDataType is defined in 6.2.3.7.1. The parameters builtInType, dataType, valueRank and arrayDimensions of the FieldMetaData are filled from corresponding Variable Attributes. |
NewConfigurationVersion |
Returns the new configuration version of the PublishedDataSet. |
AddResults |
The result codes for the variables to add. Variables exceeding the maximum number of items in the Object are rejected with Bad_TooManyVariables. |
Method Result Codes
ResultCode |
Description |
Bad_NothingToDo |
An empty list of variables was provided. |
Bad_InvalidState |
The configuration version did not match the current state of the object. |
Bad_NotWritable |
The DataSet is based on a DataSetClass and the size of the PublishedData array cannot be changed. |
Bad_UserAccessDenied |
The Session user is not allowed to configure the object. |
Operation Result Codes
ResultCode |
Description |
Bad_NodeIdInvalid |
See OPC 10000-4 for the description of this result code. |
Bad_NodeIdUnknown |
See OPC 10000-4 for the description of this result code. |
Bad_IndexRangeInvalid |
See OPC 10000-4 for the description of this result code. |
Bad_IndexRangeNoData |
See OPC 10000-4 for the description of this result code. If the ArrayDimensions have a fixed length that cannot change and no data exists within the range of indexes specified, Bad_IndexRangeNoData is returned in AddVariables. Otherwise, if the length of the array is dynamic, the Publisher shall insert this status in a DataSet if no data exists within the range. |
Bad_TooManyVariables |
The Publisher has reached its maximum number of items for the PublishedDataItemsType object. |
Table 254 specifies the AddressSpace representation for the AddVariables Method.
Table 254 – AddVariables Method AddressSpace definition
Attribute |
Value |
||||
BrowseName |
AddVariables |
||||
References |
NodeClass |
BrowseName |
DataType |
TypeDefinition |
ModellingRule |
HasProperty |
Variable |
InputArguments |
Argument[] |
PropertyType |
Mandatory |
HasProperty |
Variable |
OutputArguments |
Argument[] |
PropertyType |
Mandatory |
ConformanceUnits |
|||||
PubSub Model PublishedDataSet |