Overview
As with all adapters, an existing Logic Simulator is required.
Where to find the different Gateway Adapters.
Where to find
To find the OPC UA adapter, go to the Inspector window of a https://unit040.atlassian.net/wiki/spaces/PUD/pages/280987237/Logic+Simulator#Overview component.
This https://unit040.atlassian.net/wiki/spaces/PUD/pages/280987237/Logic+Simulator#Overview can be added under Logic.
Feature overview
Only the settings between the lines refer to the OPC UA Adapter.
Please check the documentation for the rest of the https://unit040.atlassian.net/wiki/spaces/PUD/pages/280987237/Logic+Simulator#Overview
Gateway settings | |
---|---|
Adapter Target | Select a different adapter, please see respective documentation for more information. |
Adapter Setting (OPCUAServerSettings) | |
XmlFilePath | File path to the policy file. Warning : <Make sure to fill in a relative path to the Asset folder of the project and include .xml file extension> |
endPointURL | The endpoint of the server. |
configurationFilePath | Configuration path for the configuration xml (default is sample case, please use your own) |
namespaceIndex | the namespace index for opc ua |
IdentifierTypeOpc | The identifier type for this configuration For more information: http://documentation.unified-automation.com/uasdkhp/1.0.0/html/_l2_ua_node_ids.html |
UserName | Is passed to the server for authentication if the field is not empty (not used by default). |
PassWord | Is passed to the server for authentication when the UserName field is not empty (not used by default) |
Opc ua variable naming
For the naming of opc ua variables we have to create the NodeId.
https://documentation.unified-automation.com/uasdkhp/1.0.0/html/_l2_ua_node_ids.html
Example NodeId:
ns=4;i=1241
for this example, you have to configure your PreLogic Simulator as follows:
And your PrelogicComponent:
(Example Script)
public class OPCTestComponent : PreLogicComponent { public override List<SignalDefinition> SignalDefinitions => new List<SignalDefinition> { new SignalDefinition("1241", PLCSignalDirection.INPUT, SupportedSignalType.BOOL), }; }
Another example NodeId (Tia Portal):
ns=3;s="OPC_UA_DB"."TestBOOLINPUT0"
for this example, you have to configure your PreLogic Simulator as follows:
And your Prelogic component:
(Example Script)
public class OPCTestComponent : PreLogicComponent { public override List<SignalDefinition> SignalDefinitions => new List<SignalDefinition> { new SignalDefinition("TestBOOLINPUT0", PLCSignalDirection.INPUT, SupportedSignalType.BOOL), }; }