game4automation.OPCUA_Interface Class Reference
Inheritance diagram for game4automation.OPCUA_Interface:

Public Member Functions

void Connect ()
 Connects to the OPCUA Server.
OPCUA_Node GetOPCUANode (string nodeid)
 Gets an OPCUA_Node with the NodeID in all the Childrens of the Interface.
void ImportNodes ()
 Imports all OPCUANodes under TopNodeId and creates GameObjects. More...
void EditorImportNodes ()
void ImportNodes (string nodeid)
 Imports all nodes under one TopNodeID. More...
OPCUANodeSubscription Subscribe (string nodeid, NodeUpdateDelegate del)
 Subscribes to an OPCUA node, delegate function gets called when node value is updated on OPCUA server.
object ReadNodeValue (OPCUA_Node node)
 Reads a Node value and returns it as object.
object ReadNodeValue (string nodeid)
 Reads a Node value based on its id and returns it as object.
object ReadNodeValue (string nodeid, ref string status)
 Reads a Node value based on its id and returns it as object, a status reference is passed.
bool WriteNodeValue (string nodeid, object value)
 Writes a value to an OPCUA node with its nodeid.
bool WriteNodeValue (OPCUA_Node node, object value)
 Writes a value to an OPCUA node with its node object.
bool WriteNodeValue (string nodeid, object value, ref string status)
 Writes a value to an OPCUA node with its node id and a status variable reference.
void Disconnect ()
 Disconnects from the OPCUA server.

Public Attributes

string ServerIP = ""
 The address of the OPC Server (default is localhost
int ServerPort = 4840
int SessionTimeoutMs = 60000
string TopNodeId = "Demo.Static.Scalar"
bool DebugMode
bool IsConnected
bool IsReconnecting
string ApplicationName = "game4automation"
 The application name of the OPC Client.
string ApplicationURN = "urn:game4automation"
 The appliction URN of the OPC Client.
string ProductURI = "uri:game4automation"
 The appliction URI of the OPC Client.
string ClientPrivateCertificate
 The SubPath of the Certificates inside StreamingAssets. If empty no certificates are used.
string ClientPublicCertificate
 The SubPath of the client certificate inside StreamingAssets. If emtpy no certificates are used.
string UserName = ""
 The username - if blank anonymous user will be used.
string Password = ""
 The password for the User.
int ReconnectTime = 2000
int MaxNumberOfNodesPerSubscription
 The time in ms in which reconnection attemts shoud be made - if 0 no automatic reconnections are made.
List< string > RegexWriteNodes
 0 if number of nodes is not limited
bool AutomaticallyInputOnWriteSignals
 Regex to defines Signals which needs to be automatically defined as Wrtie to OPCUA server.
bool AutomaticallySubscribeOnImport = true
 Automatically subscribes when importing new nodes.
int NumberSubsriptions
int NumberSubscribingNodes
int CurrentNodeInSubscription
uint CurrentSubscriptionID
uint CurrentClientHandle = 1
UnityEvent EventOnConnected
UnityEvent EventOnDisconnected

Member Function Documentation

◆ ImportNodes() [1/2]

void game4automation.OPCUA_Interface.ImportNodes ( )

If GameObject with NodeID is already existing the GameObject will be updated. Does not deletes any Nodes. If Game4Automation Framework is existent (Compiler Switch GAME4AUTOMATION) also Game4Automation PLCInputs and PLCOutputs are created or updated or all nodes with suitable data types.

◆ ImportNodes() [2/2]

void game4automation.OPCUA_Interface.ImportNodes ( string  nodeid)