Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


New_in
Version8.1.8



Scripting_function



Panel
titleDescription

Adds a new OPC UA connection. 


Panel
titleSyntax

system.opcua. addConnection(name, description, discoveryUrl, endpointUrl, securityPolicy, securityMode, settings )

  • Parameters

String  name  name - Name to assign to the new connection. 

String  description description - Description assigned to the new OPC UA connection. 

String  discoveryUrl discoveryUrl - Endpoint URL to use for discovery services.

List  endpointUrl  String endpointUrl  - Endpoint URL to use for session services. 

String securityPolicy - The name of the SecurityPolicy to use. See the Security Policy table below for possible values. 

String securityMode - The name of the MessageSecurityMode to use. See the Message Security Mode table below for possible values.

Dictionary[String, Any] settings - A dictionary of additional settings to apply to the connection. See the Settings table for a table of possible keys.  

  • Returns

Nothing

  • Scope

Gateway, Perspective Session


Panel

Security Policy

Below is a listing of supported values for the securityPolicy argument:

None
Basic128Rsa15
Basic256
Basic256Sha256
Aes128_Sha256_RsaOaep
Aes256_Sha256_RsaPss

Message Security Mode

Below is a listing of supported values for the messageSecurityMode argument:

None
Sign
SignAndEncrypt

Settings 

Below is a listing of supported values for the settings argument: 

Expand


KeyData Type
ENABLEDBoolean
DISCOVERYURLString
ENDPOINTURLString
SECURITYPOLICYString
SECURITYMODEString
USERNAMEString
PASSWORDString
HOSTOVERRIDEString
CONNECTTIMEOUTInteger
ACKNOWLEDGETIMEOUTInteger
REQUESTTIMEOUTInteger
SESSIONTIMEOUTInteger
MAXPEROPERATIONInteger
MAXREFERENCESPERNODEInteger
MAXPENDINGPUBLISHREQUESTSInteger
MAXPENDINGPUBLISHREQUESTSInteger
MAXNOTIFICATIONSPERPUBLISHInteger
MAXMESSAGESIZEInteger
MAXARRAYLENGTHInteger
MAXSTRINGLENGTHInteger
TYPEDICTIONARYFRAGMENTSIZEInteger
KEEPALIVEFAILURESALLOWEDInteger
KEEPALIVEINTERVALInteger
KEEPALIVETIMEOUTInteger
BROWSEORIGINString
CERTIFICATEVALIDATIONENABLEDBoolean
KEYSTOREALIASString
KEYSTOREALIASPASSWORDString
FAILOVERENABLEDBoolean
FAILOVERTHRESHOLDInteger
FAILOVERDISCOVERYURLString
FAILOVERENDPOINTURLString
FAILOVERHOSTOVERRIDEString





Panel
titleCode Examples


Code Block
languagepy
titleCode Snippet
# The following could be used to connect to Ignition's OPC UA server. 
system.opcua.addConnection(
	"test",
	"test desc",
	"opc.tcp://localhost:62541/discovery",
	"opc.tcp://localhost:62541",
	"Basic256Sha256",
	"SignAndEncrypt",
	{
	"username":"opcuauser",
	"password":"password"
	}
)



Panel
titleKeywords

system opcua addConnection, opcua.addConnection