udpSendToVar

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. - Sends the contents of a local variable to 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

 

 

N/A

No default

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

Remarks

  • Sends the contents of a local variable to another controller.
  • This allows for the exchange of data across controllers.

Figure 1: udpSendToVar

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

            udpSendToVar( Socket_Number, Add, MyUDPVar )