udpCreatePLCopen motion icon

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