Reads a datagram from a UDP socket, returning the results in data out.

The function returns data when it receives any bytes, and waits the full timeout ms only if it receives no bytes.


icon

Inputs/Outputs

  • cudpncrn.png connection ID —

    connection ID is a network connection refnum that uniquely identifies the UDP socket.

  • ci32.png max size (548) —

    max size is the maximum number of bytes to read. The default is 548.

    (Windows) If you wire a value other than 548 to this input, Windows might return an error because the function cannot read fewer bytes than are in a packet.
  • ci32.png timeout ms (25000) —

    timeout ms specifies the time, in milliseconds, that the function waits for bytes. If no bytes have been received within the specified time, the function completes and returns an error.

    The default is 25,000 ms. A value of –1 indicates to wait indefinitely.
  • cerrcodeclst.png error in (no error) —

    error in describes error conditions that occur before this node runs. This input provides standard error in functionality.

  • iudpncrn.png connection ID out —

    connection ID out returns the same value as connection ID.

  • istr.png data out —

    data out contains the data read from the UDP datagram.

  • ierrcodeclst.png error out —

    error out contains error information. This output provides standard error out functionality.

  • iu16.png port —

    port is the port of the UDP socket that sent the datagram.

  • iu32.png address —

    address is the address of the computer where a datagram originates.

  • Examples

    Refer to the following example files included with LabVIEW.

    • labview\examples\Data Communication\Protocols\UDP\UDP Multicast\UDP Multicast.lvproj
    • labview\examples\Data Communication\Protocols\UDP\Simple UDP\Simple UDP.lvproj