udpCreate
Description
This function creates a UDP socket.
Arguments
Input
| En | Description | Execute the function |
| Data type | BOOL | |
| Range | [0,1] | |
| Unit | N/A | |
| Default | — | |
| port | Description | UDP port number to be attached to the server socket or 0 for a client socket. |
| Data type | DINT | |
| Range | [0,+65535] | |
| Unit | N/A | |
| Default | — |
Output
| OK | Description | Returns true when the function successfully executes. See Function - General rules. |
| Data type | BOOL | |
| Unit | N/A | |
| sock | Description | ID of the new socket |
| Data type | DINT | |
| Unit | N/A |
Examples
Structured Text
Socket_Number := udpCreate(Client_Port); //create a socket
Ladder Diagram
Function Block Diagram





