NI-XNET API for LabVIEW and C

XNET UDP Socket Write (Binary).vi

  • Updated2023-11-11
  • 3 minute(s) read
 XNET UDP Socket Write (Binary).vi

XNET UDP Socket Write (Binary).vi

Purpose

Writes binary data to a UDP network connection.

Format

Inputs

remote port is the port on the server to which you want to write.
remote address is the IP address of the computer where you want to send a datagram. To send multicast datagrams, specify the multicast group address in this input.
socket in is a network connection refnum that uniquely identifies the UDP socket. Use XNET UDP Socket Open or XNET UDP Socket Multicast Open to generate a refnum to wire to this input.
data is the data to write to another UDP socket.

In an Ethernet environment, restrict the datagram to a reasonable size, such as 1,000 bytes. UDP datagrams must be sent as a single IP packet with no retransmission. If the packet is too large to fit in a single transmission unit of the underlying bus, the receiver might fragment and reassemble it, which increases overhead and the chance that the data could be lost in transit. Specific thresholds vary depending on your network.

timeout ms (25000) specifies the time, in milliseconds, that the VI waits to complete before returning a timeout error. The default value is 25,000 ms. Wire a –1 to this input to wait indefinitely.
error in is the error cluster input (refer to Error Handling).

Outputs

socket out is the same value as socket in.
error out is the error cluster output (refer to Error Handling).