9.1.4.3 Published Data Items
9.1.4.3.1 PublishedDataItemsType

The PublishedDataItemsType is used to select a list of OPC UA Variables as the source for the creation of DataSets sent through one or more DataSetWriters.

The PublishedDataItemsType is formally defined Table 253.

Table 253 – PublishedDataItemsType definition
Attribute Value
BrowseNamePublishedDataItemsType
IsAbstractFalse
References NodeClass BrowseName DataType TypeDefinition ModellingRule
Subtype of PublishedDataSetType defined in 9.1.4.2.
HasPropertyVariablePublishedDataPublishedVariable‌DataType[]PropertyTypeMandatory
HasComponentMethodAddVariablesDefined in 9.1.4.3.2.Optional
HasComponentMethodRemoveVariablesDefined in 9.1.4.3.3.Optional
Conformance Units
PubSub Model PublishedDataSet

The PublishedDataItemsType ObjectType is a concrete type and can be used directly.

The PublishedData is defined in 6.2.3.7.1. Existing entries in the array can be changed by writing the new settings to the Variable Value. A new Value shall be rejected with Bad_OutOfRange if the array size would be changed. Entries in the array can be added and removed with the Methods AddVariables and RemoveVariables.

The index into the list of entries in the PublishedData has an important role for Subscribers and for configuration tools. It is used as a handle to reference the entry in configuration actions like RemoveVariables or the Value in DataSetMessages received by Subscribers. The index may change after configuration changes. Changes are indicated by the ConfigurationVersion and applications working with the index shall always check the ConfigurationVersion before using the index.

9.1.4.3.2 AddVariables Method

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.

NewConfigurationVersionReturns 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_InvalidStateThe configuration version did not match the current state of the object.
Bad_NotWritableThe DataSet is based on a DataSetClass and the size of the PublishedData array cannot be changed.
Bad_UserAccessDeniedThe 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_NodeIdUnknownSee OPC 10000-4 for the description of this result code.
Bad_IndexRangeInvalidSee 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_TooManyVariablesThe 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
BrowseNameAddVariables
References NodeClass BrowseName DataType TypeDefinition ModellingRule
HasPropertyVariableInputArgumentsArgument[] PropertyTypeMandatory
HasPropertyVariableOutputArgumentsArgument[] PropertyTypeMandatory
ConformanceUnits
PubSub Model PublishedDataSet
9.1.4.3.3 RemoveVariables Method

This Method is used to remove Variables from the PublishedData list. It contains the list of published Variables of a PublishedDataItemsType Object.

A caller shall read the current Values of PublishedData and ConfigurationVersion prior to calling this Method, to ensure the use of the correct index of the Variables that are being removed.

If at least one Variable was successfully removed from the PublishedData, the MajorVersion of the ConfigurationVersion shall be updated. The ConfigurationVersionDataType and the rules for setting the version are defined in 6.2.3.2.6.

The order of the remaining Variables in the PublishedData shall be preserved.

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

Signature

	RemoveVariables (
		[in]	ConfigurationVersionDataType		ConfigurationVersion,
		[in]	UInt32[]					VariablesToRemove,
		[out]	ConfigurationVersionDataType		NewConfigurationVersion,
		[out] StatusCode[]				RemoveResults
		);
	
Argument Description
ConfigurationVersionConfiguration version of the DataSet. The configuration version and the indices passed through VariablesToRemove 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.
VariablesToRemoveArray of indices of Variables to remove from the list of Variables configured in PublishedData of the PublishedDataItemsType. This matches the list of fields configured in the DataSetMetaData of the PublishedDataSetType.
NewConfigurationVersionReturns the new configuration version of the DataSet.
RemoveResultsThe result codes for each of the variables to remove.

Method Result Codes

ResultCode Description
Bad_NothingToDo An empty list of variables was provided.
Bad_InvalidStateThe configuration version did not match the current state of the Object.
Bad_UserAccessDeniedThe Session user is not allowed to configure the Object.

Operation Result Codes

ResultCode Description
Bad_InvalidArgument The passed index was invalid.

Table 255 specifies the AddressSpace representation for the RemoveVariables Method.

Table 255 – RemoveVariables Method AddressSpace definition
Attribute Value
BrowseNameRemoveVariables
References NodeClass BrowseName DataType TypeDefinition ModellingRule
HasPropertyVariableInputArgumentsArgument[] PropertyTypeMandatory
HasPropertyVariableOutputArgumentsArgument[] PropertyTypeMandatory
ConformanceUnits
PubSub Model PublishedDataSet