TCP_Client (FB)¶
FUNCTION_BLOCK PUBLIC FINAL TCP_Client EXTENDS LCon IMPLEMENTS IClient, IOptionConsumer
itfIPAddress
and uiPort
the input xEnable
should set to TRUE
.
While setup the connection xBusy
is TRUE
but xActive
is FALSE
.
After the connection is established xActive
and xBusy
is TRUE
and the itfConnection
output is valid.
After closing the connection from the server side
xActive
becomes FALSE
itfConnection
become invalid and
xDone
becomes TRUE
.itfConnection
can be used as input itfConnection
for function blocks TCP_Write,
TCP_Writer, TCP_Read and TCP_Reader.
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
xEnable
BOOL
TRUE
: Activates the defined operationFALSE
: Aborts/resets the defined operationLCon
Output
xDone
BOOL
Ready condition reached
LCon
xBusy
BOOL
TRUE
: Operation is runningLCon
xError
BOOL
TRUE
: Error condition reachedLCon
eErrorID
LCon
Input
itfAsyncProperty
itfTLSContext
itfTSNContext
udiTimeOut
UDINT
0
Defines the time (µs) after which the connection setup aborts with active
xError
.itfIPAddress
The related server address(With ResolveHostname, the conversion from a hostname to an ip address is possible)uiPort
UINT
The related server port
Output
xActive
BOOL
TRUE if a Connection is established
itfConnection
The established connection to the related serverValid, as longxActive
=TRUE
Methods:
Structure: