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

The Client shall be authorized to modify the configuration for the PubSub functionality when invoking this Method on the Server.


AddVariables (

[in]ConfigurationVersionDataType ConfigurationVersion

[in]String[] FieldNameAliases

[in]Boolean[] PromotedFields

[in]PublishedVariableDataType[] VariablesToAdd

[out]ConfigurationVersionDataType NewConfigurationVersion

[out] StatusCode[] AddResults





Configuration version of the DataSet. The configuration version must 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


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.


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.


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

The parameters builtInType, dataType, valueRank and arrayDimensions of the FieldMetaData are filled from corresponding Variable Attributes.


Returns the new configuration version of the PublishedDataSet.


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




An empty list of variables was passed in.


The configuration version did not match the current state of the object.


The DataSet is based on a DataSetClass and the size of the PublishedData array cannot be changed.


The Session user is not allowed to configure the object.

Operation Result Codes




See OPC 10000-4 for the description of this result code.


See OPC 10000-4 for the description of this result code.


See OPC 10000-4 for the description of this result code.


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.


The Publisher has reached its maximum number of items for the PublishedDataItemsType object.