udpRcvFromVar

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. - Receives the contents of a variable from another controller through UDPClosed User Datagram Protocol.

Inputs

Input

Data Type

Range

Unit

Default

Description

En

BOOL

0, 1

N/A

No default

Execute the function.

sock

DINT

0, 65535

N/A

No default

Socket number, return value from udpCreate.

add[ ]

USINT

0, 32

N/A

No default

Array which contains information about the server.

This includes the sender's IP address.

varName

STRING

 

N/A

No default

The name of a PxMM variable (or array or structure) that stores data from the sender.

The variable should be the same type as what is being sent.

See udpSendToVar for more information.

Outputs

Output

Data Type

Range

Unit

Description

OK

BOOL

 

N/A

Returns TRUE when the function successfully executes.

See Pipe Network - General Rules.

Q

DINT

 

N/A

Number of bytes received.

Remarks

  • Receives the contents a variable sent from another controller and saves it to a local variable.
  • This allows for the exchange of data across controllers.

Figure 1: udpRcvFromVar

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

            udpRcvFromVar( Socket_Number, Add, MyUDPVar )