udpRcvFromVar

PLCopen motion icon

 Function - Receives the contents of a variable from another controller through UDP.

  • 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.

Inputs

Input

Data Type

See Data Types.

Range

Unit

Default

Description

En

BOOL

0 to 1

N/A

No default

Execute the function.

sock

DINT

0 to 65535

N/A

No default

Socket number, return value from udpCreate.

add[ ]

USINT

0 to 32

N/A

No default

Array which contains information about the server.

This includes the sender's IP address.

varName

STRING

N/A

N/A

No default

  • The name of a PLC 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.

Outputs

Output

Data Type

See Data Types.

Range

Unit

Description

OK

BOOL

FALSE, TRUE

N/A

Returns TRUE when the function successfully executes.

See Pipe Network - General Rules.

Q

DINT

0 to 65535

N/A

Number of bytes received.

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

            udpRcvFromVar( Socket_Number, Add, MyUDPVar )