udpSendToVar
Function - Sends the contents of a local variable to another controller through UDP.
Inputs
Input |
Data Type |
Range |
Unit |
Default |
Description |
---|---|---|---|---|---|
En |
BOOL |
0 to 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 to 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 Function - 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
-
-
Limitations
- Function block instance variable types are not supported.
- These types of variables cannot be sent or received:
- Variables defined with a UDFB.
- The Input and Output variables defined for a sub-program.
- udpSendToVar and udpRcvFromVar do not automatically swap bytes for big vs. little endian systems.
- Send / receive functionality is:
PCMM / AKD PDMM
PCMM2G
Simulator
PCMM / AKD PDMM
PCMM2G
Simulator
Compatibility is based on the endianness of the controller's information.
PCMM and AKD PDMM are big-endian.
PCMM2G and Simulator are little-endian. - 3rd party stand-alone programs on x86 platforms are responsible for endian conversions for UDP telegrams from a AKD PDMM / PCMM.
FBD Language Example
FFLD Language Example
IL Language Example
Not available.
ST Language Example
udpSendToVar( Socket_Number, Add, MyUDPVar )