Chapter 8 Logic Instructions
8-215
8.14.2.9 ETH_Socket_Open
FB
ETH_Socket_Open is used for enabling Socket TCP/UDP protocol.
ETH_Socket_Open
Execute Done
ETH_Socket_Open_instance
SocketNum Busy
Error
ErrorID
OpenMode
Input Parameters
Parameter name Function Data type
Validation timing
Execute
executed when Execute
changes from FALSE to
BOOL
TRUE or FALSE
(FALSE)
SocketNum
Set the number of the
Socket
USINT
(The variable
value must be
When Execute
changes from
FALSE to TRUE
OpenMode
Mode to use the controller
TRUE: Client mode
BOOL
TRUE or FALSE
(FALSE)
changes from
FALSE to TRUE
Note:
1. ETH_Socket_Open is used to enable Socket. After ETH_Socket_Open is executed, the controller will try
to make connection with other node or wait for other node to send out the link request.
2. When OpenMode is TRUE, the controller is in Client mode. After ETH_Socket_Open instruction is
executed, the controller sends out the link request to the target node.
When OpenMode is FALSE, the controller is in Server mode. After ETH_Socket_Open instruction is
executed, the controller waits for the link request from the target node.
3. If Socket UDP is selected as the Socket mode, selecting TRUE or FALSE for OpenMode will have no
impact on the use of the instruction.
Output Parameters
Done
TRUE when the instruction execution is
completed.
BOOL TRUE/FALSE
TRUE when the instruction is being executed.
Error
TRUE when an error occurs in execution of the
instruction.
BOOL TRUE/FALSE
ErrorID
Contains error codes when an error occurs in the
instruction execution. Please refer to section 12.2
for the corresponding error code.
WORD
Output Update Timing