Send data over UDP network to a remote device
Simulink Real-Time / Real-Time UDP
The UDP Send block sends data over a UDP network to a remote device. The block can send data by using the connection between the development and target computers or by using a dedicated Ethernet card. If you use a dedicated Ethernet card, add a UDP Configure block to your model.
The parameter Local IP address applies only when the block executes on a target computer. If your model is running in Simulink® on the development computer, you can use this block to transmit data to a remote device. In this case, the Windows® operating system determines the network connection.
To broadcast to all devices, set
To IP address to
set To IP address to a valid IP address.
Data— Data to transmit
uint8 containing data to transmit over
the UDP network. To determine how many bytes of data to transmit, use
the Length input port.
Length— Number of bytes of data to transmit
Determines the number of bytes of data to transmit. Specify the width
Data vector as the maximum number of bytes
that you expect to transmit.
Local IP address— Source IP address for sending data
Use host-target connection(default)
When Local IP address is set to
host-target connection, the block uses the connection
between the development and
Otherwise, the block uses the value that you set in the Local IP
address parameter of the UDP Configure
If the UDP Configure block settings enable multicast operation, the Send block sends to the IP address that is set to the group IP address. For real time multicast send capability, the model requires a UDP Configure block. If the model does not include this block, a warning about route unavailability is issued on the target.
Local port— Source UDP port through which to transmit data
Specifies local UDP port through which to transmit data.
−1 means that the block transmits using
any available port.
To IP address— IP address of target device
Specifies IP address of target
device. To broadcast,
To port— UDP port of target device
Specify the UDP port of target device. With To IP address, this parameter defines the destination of the data transmission.