A Client calling the EstablishConnections Method may provide multiple commands and the required Arguments for each command. If multiple commands are provided in a single call, the individual commands shall be processed in the order VerifyAssetCmd, VerifyFunctionalEntityCmd, ReserveCommunicationIdsCmd, CreateConnectionEndpointCmd, EstablishControlCmd, SetConfigurationDataCmd, ReassignControlCmd, SetCommunicationConfigurationCmd, EnableCommunicationCmd which is illustrated in Figure 20.
A Client may issue the same command in consecutive EstablishConnections Calls, e.g., to apply large configuration data in multiple Calls with SetConfigurationDataCmd.
If the processing of a command results in an error, the processing of the command sequence shall be stopped at the command that caused the error, and the EstablishConnections Method Call shall be aborted, as described in 6.2.4.3.11.
An AutomationComponent may support individual commands in EstablishConnections Method Calls or may require that certain commands be bundled in a single EstablishConnections Method Call. If an AutomationComponent requires bundled commands, the CommandBundleRequired capability shall be provided and set to TRUE(see 6.2.6). The set of bundled commands is defined as follows: CreateConnectionEndpointCmd, EstablishControlCmd, SetConfigurationDataCmd, ReassignControlCmd, and SetCommunicationConfigurationCmd. The commands CreateConnectionEndpointCmd and SetCommunicationConfigurationCmd are mandatory in the bundle; the remaining commands are optional. An AutomationComponent requiring bundled commands shall return a Bad_InvalidArgument for any command in the set of bundled commands that is issued individually, i.e., not issued in a bundle.
NOTE AutomationComponents that have CommandBundleRequired set to TRUE could be restricted regarding the size of the Arguments issued in a single call, for example, ConfigurationData.
How the commands are processed is described in Clauses 6.2.4.3.2 to 6.2.4.3.10.
Figure 20 – Command processing sequence illustration
If CommandMask VerifyAssetCmd is set, the EstablishConnections implementation shall execute the IAssetRevisionType VerifyAsset Method for each element in the AssetVerifications array. The VerifyAsset Method shall be called on each AssetToVerify, supplying the VerificationMode, ExpectedVerificationVariables and ExpectedAdditionalVerificationVariables as Method Arguments.
The StatusCode returned by the VerifyAsset Method and the values of its output Arguments VerificationResult, VerificationVariablesErrors, and VerificationAdditionalVariablesErrors shall be stored in the appropriate elements in AssetVerificationResults (see 10.6).
Once all array processing is complete, if at least one of the following conditions is true:
- AssetToVerify was unknown or invalid,
- at least one of the returned AssetVerificationResults VerificationResult equals NotSet, Mismatch, or Compatible when ExpectedVerificationResult requires Match,
- at least one VerifyAsset Method execution returned an error,
then the EstablishConnections implementation shall abort processing of additional commands as described in 6.2.4.3.11.
The possible StatusCodes related to the command VerifyAssetCmd are formally defined in Table 10. The StatusCodes related to individual verification Variables are formally defined in Table 32 and Table 33.
If CommandMask VerifyFunctionalEntityCmd is set, the EstablishConnections implementation shall execute the FunctionalEntityType Verify Method for each element in ConnectionEndpointConfigurations with a non-empty ExpectedVerificationVariables array. For elements with a null or empty ExpectedVerificationVariables array, the VerificationStatus shall be set to Good_NoData, VerificationResult to NotSet, and VerificationVariablesErrors to null or empty. The Method shall be called on the FunctionalEntity identified by FunctionalEntityNode, supplying the ExpectedVerificationVariables as Method Argument.
The StatusCode returned by the Verify Method shall be stored in VerificationStatus, and the values of its output Arguments VerificationResult and VerificationVariablesErrors in VerificationResult and VerificationVariablesErrors (see 10.15).
If the FunctionalEntityNode was not found, the VerificationVariablesErrors shall be set to null or empty, and the VerificationResult shall be set to Mismatch.
Once all array processing is complete, if any one of the following conditions applies:
- at least one FunctionalEntityNode was not found;
- at least one VerificationResult equals Mismatch;
- at least one VerificationResult equals NotSet, and VerificationVariablesErrors is populated;
- at least one Verify Method execution returned an error;
the EstablishConnections implementation shall abort the processing of subsequent commands as described in 6.2.4.3.11.
The possible StatusCodes for the FunctionalEntityNodeResult are formally defined in Table 11. The possible StatusCodes for VerificationStatus are formally defined in Table 42. The possible StatusCodes for VerificationVariablesErrors are formally defined in Table 43.
If CommandMask ReserveCommunicationIdsCmd is set, the EstablishConnections implementation shall reserve communication model identifiers for each element in ReserveCommunicationIds.
For a PubSub communication model, a structure of type PubSubReserveCommunicationIdsDataType (see 10.39.3) shall be used.
The EstablishConnections implementation shall reserve for each requested TransportProfileUri the requested number of IDs for both WriterGroups and DataSetWriters. For additional details, see OPC 10000-14 ReserveIds Method, including error definitions.
If any error occurs, the EstablishConnections implementation shall abort processing as described in 6.2.4.3.11.
The EstablishConnections implementation shall return for each requested TransportProfileUri the default value for the PublisherId, the reserved WriterGroupIds, and DataSetWriterIds in the output Argument ReserveCommunicationIdsResults.
The possible StatusCodes for the ReserveCommunicationIdsResults Result are formally defined in Table 18.
This clause may be defined in a future version of this document.
If CommandMask CreateConnectionEndpointCmd is set, the EstablishConnections Method shall create a ConnectionEndpoint or shall verify and update a preconfigured ConnectionEndpoint for each element in ConnectionEndpointConfigurations (see 10.14) with Parameter defined in ConnectionEndpoint (see 10.16).
The EstablishConnections implementation shall set ConnectionEndpointResult on errors as specified in Table 12.
The EstablishConnections implementation shall set ConnectionEndpointResult to Bad_NotSupported if FeedbackSignalRequired is set to TRUE (see 6.4.7) and Mode is set to Publisher.
If IsPreconfigured is set to FALSE, the EstablishConnections implementation shall create a ConnectionEndpoint in the ConnectionEndpoints Folder of the FunctionalEntity identified by FunctionalEntityNode. The created ConnectionEndpoint shall be of the subtype specified in ConnectionEndpoint TypeId. The BrowseName shall be set to Name, and all Variables shall be set according to Parameter. The appropriate entries in InputVariables and OutputVariables shall be populated.
If IsPreconfigured is set to TRUE, a preconfigured ConnectionEndpoint (see 5.5.5) shall exist with a BrowseName that matches Name in the ConnectionEndpoints Folder of the FunctionalEntity identified by FunctionalEntityNode. Its ConnectionEndpointTypeId, InputVariables and OutputVariables shall match what is specified in Parameter. IsPersistent, CleanupTimeout, and RelatedEndpoint of the preconfigured ConnectionEndpoint shall be set according to Parameter.
The implementation shall return the NodeId of the ConnectionEndpoint in the corresponding element in ConnectionEndpointConfigurationResults. If additional commands in the EstablishConnections Method sequence are present, this NodeId shall be used.
The EstablishConnections implementation shall stop processing this command on the first error and abort processing as described in 6.2.4.3.11.
The possible StatusCodes for the FunctionalEntityNodeResult are formally defined in Table 11. The possible StatusCodes for the ConnectionEndpointResult are formally defined in Table 12.
If CommandMask EstablishControlCmd is set, the EstablishConnections implementation shall call the EstablishControl Method on each element in ControlGroups for each element in ConnectionEndpointConfigurations. If ControlGroups is null or empty, EstablishControlResult shall be set to null or empty (see 10.15).
This command shall pass the ApplicationUri of the Session associated with the EstablishConnections Method Call as LockContext Argument to EstablishControl (see 6.5.3).
The EstablishConnections implementation shall stop processing this command on the first error and shall abort processing as described in 6.2.4.3.11.
The possible StatusCodes for the EstablishControlResult are formally defined in Table 13. The possible StatusCodes for the FunctionalEntityNodeResult are formally defined in Table 11. The possible StatusCodes for the ConnectionEndpointResult are formally defined in Table 12.
If CommandMask SetConfigurationDataCmd is set, the EstablishConnections implementation shall apply the Value to the Key for each element in ConnectionEndpointConfigurations and each element in ConfigurationData. If the ConnectionEndpoint related to ConfigurationData has IsPersistent set, SetStoredVariables (see 6.4.6.3) shall be called for all Variables indicated by Key having the NonVolatile bit in the AccessLevelEx Attribute not set. If ConfigurationData is empty, ConfigurationDataResult shall be set to null or empty (see 10.15).
The EstablishConnections implementation shall stop processing this command on the first error and abort processing as described in 6.2.4.3.11.
The possible StatusCodes for the ConfigurationDataResult are formally defined in Table 14. The possible StatusCodes for the FunctionalEntityNodeResult are formally defined in Table 11. The possible StatusCodes for the ConnectionEndpointResult are formally defined in Table 12.
If CommandMask ReassignControlCmd is set, the EstablishConnections implementation shall call the ReassignControl Method on each element in ControlGroups for each element in ConnectionEndpointConfigurations. If ControlGroups is null or empty, ReassignControlResult shall be set to null or empty (see 10.15).
This command shall pass the string representation of the NodeId of the ConnectionEndpoint as LockContext Argument to ReassignControl.
The EstablishConnections implementation shall stop processing this command on the first error and shall abort processing as described in 6.2.4.3.11.
The possible StatusCodes for the ReassignControlResult are formally defined in Table 15. The possible StatusCodes for the FunctionalEntityNodeResult are formally defined in Table 11. The possible StatusCodes for the ConnectionEndpointResult are formally defined in Table 12.
If CommandMask SetCommunicationConfigurationCmd is set, the EstablishConnections implementation shall apply the communication model configuration supplied in CommunicationConfigurations in an atomic operation.
The communication configuration applied in the case of a PubSub communication model is a structure of the type PubSubCommunicationConfigurationDataType (see 10.10.3).
The EstablishConnections implementation shall process the supplied PubSubConfiguration with RequireCompleteUpdate and ConfigurationReferences in an atomic operation according to the behaviour of the CloseAndUpdate Method specified by OPC 10000-14. It shall set the overall processing result in PubSubCommunicationConfigurationResults Result and the returned ChangesApplied, ReferenceResults, ConfigurationValues, and ConfigurationObjects in PubSubCommunicationConfigurationResults.
If an error is returned, the EstablishConnections implementation shall abort processing as described in 6.2.4.3.11.
The SetCommunicationConfigurationCmd will apply the PubSubConfiguration, including the values of all Enabled flags for the configuration elements. Depending on the values of the Enabled flags, this may result in overall enabled PubSub communication without passing the EnableCommunicationCmd or parts of the PubSub communication being enabled while others are disabled.
The EstablishConnections implementation shall create the ToDataSetReader and ToDataSetWriter References according to the link information supplied in ConnectionEndpointConfigurations CommunicationLinks (see 10.13). If the PubSub configuration model is not exposed by this Server, this Reference may point to a Node that is not accessible. If the Reference cannot be created, an appropriate StatusCode shall be set in the appropriate element in ConnectionEndpointConfigurationResults CommunicationLinksResult, and the EstablishConnections implementation shall abort processing as described in 6.2.4.3.11.
The EstablishConnections implementation shall verify the SubscribedDataSet associated with the referenced DataSetReader for each element in ConnectionEndpointConfigurations having a ToDataSetReader Reference.
If ExpectedSubscribedDataSetVersion MajorVersion is 0 (for the definition of MajorVersion, see OPC 10000-14), no verification shall be performed. If ExpectedSubscribedDataSetVersion MinorVersion is 0 (for the definition of MinorVersion, see OPC 10000-14), the verification for MinorVersion shall be skipped. If the ExpectedSubscribedDataSetVersion does not match the version of the associated SubscribedDataSet, the appropriate element in ConnectionEndpointConfigurationResults CommunicationLinksResult shall be set to Bad_ConfigurationError, and the EstablishConnections implementation shall abort processing as described in 6.2.4.3.11
If InputVariableIds is used, and at least one Variable is not contained in the associated SubscribedDataSet, the appropriate element in ConnectionEndpointConfigurationResults CommunicationLinksResult shall be set to Bad_NoMatch, and the EstablishConnections implementation shall abort processing as described in 6.2.4.3.11.
The EstablishConnections implementation shall verify the PublishedDataSet associated with the referenced DataSetWriter for each element in ConnectionEndpointConfigurations having a ToDataSetWriter Reference.
If ExpectedPublishedDataSetVersion MajorVersion is 0, no verification shall be performed. If ExpectedPublishedDataSetVersion MinorVersion is 0, the verification for MinorVersion shall be skipped. If the ExpectedPublishedDataSetVersion does not match the version of the associated PublishedDataSet, the appropriate element in ConnectionEndpointConfigurationResults CommunicationLinksResult shall be set to Bad_ConfigurationError, and the EstablishConnections implementation shall abort processing as described in 6.2.4.3.11
If OutputVariableIds is used, and at least one Variable is not contained in the associated PublishedDataSet, the appropriate element in ConnectionEndpointConfigurationResults CommunicationLinksResult shall be set to Bad_NoMatch, and the EstablishConnections implementation shall abort processing as described in 6.2.4.3.11.
The EstablishConnections implementation shall verify that ConnectionEndpoints with their IsPersistent Property set to TRUE reference a DataSetReader and/or DataSetWriter which are persisted, including all parent Objects, i.e., WriterGroup, ReaderGroup, PubSubConnection and PublishSubscribe (see NotPersisted in OPC 10000-14). If the IsPersistent Property is set to FALSE, the EstablishConnections implementation shall verify that the DataSetReader and/or DataSetWriter are not persisted (see NotPersisted in OPC 10000-14). Otherwise, Bad_InvalidState shall be set in the appropriate element in ConnectionEndpointConfigurationResults CommunicationLinksResult, and the EstablishConnections implementation shall abort processing as described in 6.2.4.3.11.
If communication configuration exceeds capabilities (PublisherCapabilities, SubscriberCapabilities or ComponentCapabilities) of the AutomationComponent, FunctionalEntities, Input- or OutputData, or if communication configuration cannot be applied, Bad_ConfigurationError shall be set in PubSubCommunicationConfigurationResults Result, and the EstablishConnections implementation shall abort processing as described in 6.2.4.3.11.
NOTE Hint – in the EstablishConnections command, Bad_ConfigurationError is returned if a communication configuration is supplied that requests functionality that is not currently supported and not specified by a capability (e.g., usage of multicast address).
In the ConnectionEndpointConfigurationResults, the possible StatusCodes for the FunctionalEntityNodeResult are formally defined in Table 11. The possible StatusCodes for the ConnectionEndpointResult are formally defined in Table 12. The possible StatusCodes for the CommunicationLinksResult are formally defined in Table 16.
The possible StatusCodes for the CommunicationConfigurationResults Result are formally defined in Table 19.
Standard OPC UA Diagnostics can be used to obtain additional information related to any PubSub configuration errors.
This clause may be defined in a future version of this document.
If CommandMask EnableCommunicationCmd is set, the EstablishConnections implementation shall enable all communication model-specific Objects related to the ConnectionEndpoints in an atomic operation.
The EstablishConnections implementation shall enable the DataSetReader and DataSetWriter referenced by ToDataSetReader and/or ToDataSetWriter References for each element in ConnectionEndpointConfigurations. It shall also ensure that the parent Objects (WriterGroup, ReaderGroup, PubSubConnection, and PublishSubscribe) are enabled.
If enabling any communication model-specific Objects fails, the EstablishConnections implementation shall abort processing as described in 6.2.4.3.11.
If enabling a ConnectionEndpoint would lead to multiple DataSetReaders being enabled that reference the same TargetVariable(s), the EstablishConnections implementation shall abort processing as described in 6.2.4.3.11.
The possible StatusCodes for the FunctionalEntityNodeResult are formally defined in Table 11. The possible StatusCodes for the ConnectionEndpointResult are formally defined in Table 12. The possible StatusCodes for the EnableCommunicationResult are formally defined in Table 17.
This clause may be defined in a future version of this document.
The EstablishConnections implementation shall abort processing if one of the issued commands fails; see the individual command behaviour descriptions in Clauses 6.2.4.3.2 to 6.2.4.3.10. No further commands requested for this Method Call shall be executed. The result of the commands executed with this Method Call shall be rolled back according to Table 21.
Command |
Rollback action |
VerifyAssetCmd |
None |
VerifyFunctionalEntityCmd |
None |
ReserveCommunicationIdsCmd |
None |
CreateConnectionEndpointCmd |
All ConnectionEndpoints in the context of this Method Call shall be deleted. |
EstablishControlCmd |
All requested ControlGroups requested in the context of this Method Call shall be released by calling ReleaseControl. All Control References created shall be deleted. |
SetConfigurationDataCmd |
None Note: Any settings that have been applied will remain. |
ReassignControlCmd |
None |
SetCommunicationConfigurationCmd |
All communication configuration and References created in the context of this Method Call shall be deleted. |
EnableCommunicationCmd |
All communication configuration Objects that were enabled in the context of this Method Call shall be disabled. |
The Method shall set the appropriate StatusCodes for not executed commands to Bad_NothingToDo and return with an Uncertain result.
There is no rollback provided by the Method over multiple Method calls; such a rollback is the responsibility of the caller of the Method (e.g., the ConnectionManager). The caller of the Method may use the CloseConnections Method for issuing a complete rollback.