EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers.

FB_UDPPeer - Method ReceiveFrom

Overview

Type:

Method

Available as of:

V1.0.4.0

G-SE-0045964.2.gif-high.gif

 

 

Task

Read data stored in the receive buffer.

Functional Description

Reads data stored in the receive buffer and removes it from the buffer if it has been read without detecting an error. At most one message is read no matter how much data is available to be read and how large is the application-provided buffer.

The UDINT return value indicates the number of bytes written to the application-provided buffer.

Interface

Input

Data type

Valid range

Description

i_pbyReceiveBuffer

POINTER TO BYTE

-

Start address of the buffer to write the received data to.

i_udiReceiveBufferSize

UDINT

1 ... 2147483647

Number of bytes to be read.

NOTE: The value must not be greater than the size of the buffer.

Output

Data type

Valid range

Description

q_xDataReceived

BOOL

-

Indicates whether a message was received.

q_sPeerIP

STRING(15)

-

Source IP of the peer from whom the message was received in STRING representation.

q_dwPeerIP

DWORD

-

IP address of the peer (sender) as DWORD; each byte represents one digit of the IPv4 address.

q_uiPeerPort

UINT

-

Source port the message was received from.