This Methodis used to create a PublishedDataSets Objectof type PublishedDataItemsType and to add it to the DataSetFolderType Object. The configuration parameters passed in with this Methodare further described in the PublishedDataItemsTypedefined in 9.1.4.3.1and the PublishedDataSetTypedefined in 9.1.4.2.
The settings in the VariablesToAddare used to configure the data acquisition for the DataSetand are used to initialize the PublishedData Propertyof the PublishedDataItemsType.
The DataSetMetaDataof the PublishedDataSetTypeis created from meta-data of the Variablesreferenced inVariablesToAddand the settings in FieldNameAliasesand FieldFlags.
The Clientshall be authorized to modify the configuration for the PubSubfunctionality when invoking this Methodon the Server.
Signature
AddPublishedDataItems (
[in]String Name
[in]String[] FieldNameAliases
[in]DataSetFieldFlags[] FieldFlags
[in]PublishedVariableDataType[] VariablesToAdd
[out] NodeId DataSetNodeId
[out]ConfigurationVersionDataType ConfigurationVersion
[out] StatusCode[] AddResults
);
Argument |
Description |
Name |
Name of the Objectto create. |
FieldNameAliases |
The names assigned to the selected Variablesfor the fields in the DataSetMetaDataand in the DataSetMessagesfor 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 FieldMetaDatathat is part of the DataSetMetaData. The name shall be unique in the DataSet. |
FieldFlags |
The field flags assigned to the selected Variables for the fields in the DataSetMetaData. The size and the order of the array shall match the VariablesToAdd. The flag is used to set the corresponding field in the FieldMetaDatathat is part of the DataSetMetaData. |
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 PublishedVariableDataTypeis defined in 6.2.2.6.1. |
DataSetNodeId |
NodeIdof the created PublishedDataSets Object. |
ConfigurationVersion |
Returns the initial configuration version of the DataSet. |
AddResults |
The result codes for the variables to add. Variables exceeding the maximum number of items in the Objectare rejected with Bad_TooManyMonitoredItems. |
Method Result Codes
ResultCode |
Description |
Bad_InvalidState |
The current state of the Objectdoes not allow a configuration change. |
Bad_BrowseNameDuplicated |
A data set Objectwith the name already exists. |
Bad_UserAccessDenied |
|
Bad_InvalidArgument |
The Serveris not able to apply the Name. The Namemay be too long or may contain invalid characters. |
Operation Result Codes
ResultCode |
Description |
Bad_NodeIdInvalid |
See OPC 10000-4for the description of this result code. |
Bad_NodeIdUnknown |
See OPC 10000-4for the description of this result code. |
Bad_IndexRangeInvalid |
See OPC 10000-4for the description of this result code. |
Bad_IndexRangeNoData |
See OPC 10000-4for the description of this result code. If the ArrayDimensionshave 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 Publishershall insert this status in a DataSetif no data exists within the range. |
Bad_TooManyMonitoredItems |
The Serverhas reached its maximum number of items for the PublishedDataItemsType object. |
Bad_DuplicateName |
The passed field name alias already exists. |