udpRcvFrom
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. - Receives a UDP User Datagram Protocol telegram.
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 |
IP of the socket. |
nb |
DINT |
0, 65535 |
N/A |
No default |
Maximum number of characters received. |
add[ ] |
USINT |
0, 32 |
N/A |
No default |
Buffer containing the UDP address (filled on output). |
data |
STRING |
0, 255 |
N/A |
No default |
Buffer to store received characters. |
Outputs
Output |
Data Type |
Range |
Unit |
Description |
---|---|---|---|---|
OK |
BOOL |
|
N/A |
Returns TRUE when the function successfully executes. |
Q |
DINT |
|
N/A |
Actual number of received characters. |
Remarks
- If the characters are received, the function fills the ADD argument with the internal UDP of the sender.
- This buffer can be passed to udpSendTo to send the answer.
FBD Language Example
FFLD Language Example
IL Language Example
Not available.
ST Language Example
ReceivedBytes := udpRcvFrom(Socket_Number,5,add,data); //Read the position Position means a point in space which is described by different coordinates. Depending on the used system and transformation it can consist of a maximum of six dimensions (coordinates).This means three Cartesian coordinates in space and coordinates for the orientation. In ACS there can be even more than six coordinates. If the same position is described in different coordinate systems the values of the coordinates are different.