SOCKET_INFO
The SOCKET_INFO instruction returns information for a socket instance, such as error codes and execution status. Outputs update synchronously from the program scan.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the L20E, L50E, and L70E controllers.
SOCKET_INFO

Parameter | Parameter Type | Data Type | |
---|---|---|---|
Execute | Input | BOOL | Instruction block enable.
|
Instance | Input | UDINT | Copy the returned Socket Handler from a SOCKET_CREATE or SOCKET_ACCEPT instruction to delete the respective socket.
When Instance is 0, returns a summary of all Socket Instances. |
ClrDiagCnt | Input | BOOL |
Such as TCP and UDP, OtherInfo Array Index 1 to 6. When Instance is 0, clear OtherInfo Array Index 7 to 14. |
Done | Output | BOOL | Indicates when operation is complete.
Output is updated synchronously from the program scan. |
Busy | Output | BOOL |
Output is updated synchronously from the program scan. |
Error | Output | BOOL | Indicates an error occurred. TRUE: An error is detected. FALSE: No error. Output is updated synchronously from the program scan. |
Status | Output | SOCK_STATUS | Status is defined using the SOCK_STATUS data type which contains ErrorID, SubErrorID, and StatusBits information. Output is updated synchronously from the program scan. |
SocketType | Output | USINT | Socket Instance type:
When Socket_Info Instance is 0, SocketType displays as 0. |
StreamType | Output | USINT | Socket Stream type:
When Socket_Info Instance is 0, StreamType displays as 0. |
TxQueCnt | Output | USINT | Number of Tx messages currently in the queue. When Socket_Info Instance is 0, TxQueCnt displays as 0. |
RxQueCnt | Output | USINT | Number of Rx messages currently in the queue. When Socket_Info Instance is 0, RxQueCnt displays as 0. |
SocketState | Output | USINT | Socket Instruction State information. For more information refer to Socket State Machine. When Socket_Info Instance is 0, SocketState displays as 0. |
LocalAddr | Output | SOCKETADDR_CFG | Local address for the socket. For more information refer to SOCKADDR_CFG data type. When Socket_Info Instance is 0, LocalAddr displays as 0. |
RemoteAddr | Output | SOCKETADDR_CFG | Remote address for the socket. For more information refer to SOCKADDR_CFG data type. RemoteAddr displays as 0, in the following cases:
|
OtherInfo | UDINT[1..15] | Socket Instance configured as TCP, Array Index Description is:
Socket Instance configured as UDP, Array Index Description is:
Socket Instance configured as 0, Array Index Description is:
|
SOCKET_INFO examples
SOCKET_INFO function block diagram example

SOCKET_INFO ladder diagram example

SOCKET_INFO structured text example

Results

Provide Feedback