udpRcvFromVar
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.
-
-
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:
PCMM2G
Simulator
PCMM2G


Simulator


- Compatibility is based on the endianness of the controller's information.
- PCMM2G and Simulator are little-endian.
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 |
|
Outputs
|
Output |
Data Type See Data Types. |
Range |
Unit |
Description |
|---|---|---|---|---|
|
OK |
BOOL |
FALSE, TRUE |
N/A |
Returns TRUE when the function successfully executes. |
|
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 )







