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
xEnableBOOLTRUE: Activates the defined operationFALSE: Aborts/resets the defined operationLCon
Output
xDoneBOOLReady condition reached
LCon
xBusyBOOLTRUE: Operation is runningLCon
xErrorBOOLTRUE: Error condition reachedLCon
eErrorIDLCon
Input Const
itfAsyncPropertyitfTLSContextitfTSNContextInput
udiTimeOutUDINT0
Defines the time (µs) after which the connection setup aborts with active
xError.itfIPAddressThe related server address(With ResolveHostname, the conversion from a hostname to an ip address is possible)uiPortUINTThe related server port
Output
xActiveBOOLTRUE if a Connection is established
itfConnectionThe established connection to the related serverValid, as longxActive=TRUE
Methods:
SetInitialValue
Read
SetAdapter
SetOptionProvider
Upgrade
Write
Structure: