udpCreate

PLCopen motion icon

 FunctionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. - Creates a UDPClosed User Datagram Protocol socket.

Inputs

Input

Data Type

Range

Unit

Default

Description

En

BOOL

0, 1

N/A

No default

Execute the function.

port

DINT

0, 65535

N/A

No default

UDP port number attached to the server socket or 0 for a client socket.

Outputs

Output

Data Type

Range

Unit

Description

OK

BOOL

 

N/A

Returns TRUE when the function successfully executes.

See Pipe Network - General Rules.

sock

DINT

 

N/A

IP of the socket.

Remarks

None

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

Socket_Number := udpCreate(Client_Port); //create a socket