Client (FB)¶
FUNCTION_BLOCK PUBLIC FINAL Client EXTENDS CBML.LConC IMPLEMENTS IClient
Function block for establishing a connection to an OPC UA server.
Usage (Declaration):
sPolicySHA256 : STRING := 'http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256';
sURL : STRING := 'opc.tcp://xxx:4840';
sSession : STRING := 'urn:xxx:CODESYS:UA.Client';
UAPolicy : UA.SecurityPolicy := (
sPolicy:=sPolicySHA256,
eSecurity:=UA.SECURITY_MODE.SIGN_AND_ENCRYPT
);
UAAuth : UA.UserNameAuth := (sUserName:=sUser, sPassword:=sPass);
UAClient : UA.Client := (
sURL := sURL,
sSession := sSession,
itfPolicy := UAPolicy,
itfAuth := UAAuth,
udiTimeout := 100000
);
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
xEnableBOOLLConC
Output
xBusyBOOLLConC
xErrorBOOLLConC
Input Const
itfAsyncProperty0
sClientNameSTRING‘CODESYS OPC UA Client’
sURLsSessionitfPolicy0
itfAuth0
udiTimeoutUDINT0
itfNamespaceArray0
Output
eErrorIDxActiveBOOLTRUE if a Connection is established
itfConnectionThe established connection to the related serverValid, as longxActive=TRUEeStateCONNECTION_STATE.UNKNOWN
Methods:
Structure: