udpRcvFromVar
Description
This function 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
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. block instance variable types are not supported. - The following types of variables cannot be sent or received:
- Variables defined with a UDFB
"User Defined Function Block"
UDFB can be used as a sub-function block in another program of the application. It is described using FBD, LD, ST or IL language. Input / output parameters of a UDFB (as well as private variables) are declared in the variable editor as local variables of the UDFB. - The Input and Output variables defined for a sub-program.
- Variables defined with a UDFB
- udpSendToVar and udpRcvFromVar will not automatically swap bytes for big vs. little endian systems.
- Send / receive between a Simulator and PDMM/PCMM is not supported.
- 3rd party stand-alone programs on x86 platforms are responsible for endian conversions for UDP telegrams from a PDMM/PCMM.
- Function
Arguments
Input
| En | Description | Execute the function |
| Data type | BOOL | |
| Range | [0,1] | |
| Unit | n/a | |
| Default | — | |
| sock | Description | Socket number, return value from udpCreate |
| Data type | DINT | |
| Range | [0,+65535] | |
| Unit | n/a | |
| Default | — | |
| add[] | Description | Array which contains information about the sender (server) of information. This includes the sender's IP address. |
| Data type | USINT | |
| Range | [0,32] | |
| Unit | n/a | |
| Default | — | |
| varName | Description | The name of a PxMM variable (or array or structure) that will store data from the sender. The variable should be the same type as what is being sent. See udpSendToVar. |
| Data type | STRING | |
| Range | ||
| Unit | n/a | |
| Default | — |
Output
| OK | Description | Returns true when the function successfully executes. See Function - General rules. |
| Data type | BOOL | |
| Unit | n/a | |
| Q | Description | Number of bytes received |
| Data type | DINT | |
| Unit | n/a |
Examples
Structured Text
udpRcvFromVar( Socket_Number, Add, MyUDPVar )
Ladder Diagram
Function Block Diagram
|
Copyright © 2018 Kollmorgen |
|
[Top]






