udpSendToVar

PLCopen motion icon

 Function - Sends the contents of a local variable to another controller through UDP.

  • Sends the contents of a local variable to another controller.
  • 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 data of the PLC variable (or array or structure) to send to the receiver.
  • The variable should be the same type as what is expected by the receiver.
  • See udpRcvFromVar.

Outputs

Output

Data Type

See Data Types.

Range

Unit

Description

OK

BOOL

FALSE, TRUE

N/A

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

            udpSendToVar( Socket_Number, Add, MyUDPVar )