UDP Send

Send data over UDP network to a remote device

  • Library:
  • Simulink Real-Time / Real-Time UDP

Description

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 255.255.255.255, otherwise set To IP address to a valid IP address.

Ports

Input

expand all

Vector of uint8 containing data to transmit over the UDP network. To determine how many bytes of data to transmit, use the Length input port.

Data Types: uint8

Determines the number of bytes of data to transmit. Specify the width of the Data vector as the maximum number of bytes that you expect to transmit.

Parameters

expand all

When Local IP address is set to Use host-target connection, the block uses the connection between the development and target computers. Otherwise, the block uses the value that you set in the Local IP address parameter of the UDP Configure block.

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.

Programmatic Use

Block Parameter: ipAddress

Specifies local UDP port through which to transmit data.

The value −1 means that the block transmits using any available port.

Programmatic Use

Block Parameter: localPort

Specifies IP address of target device. To broadcast, send to 255.255.255.255.

Programmatic Use

Block Parameter: toAddress

Specify the UDP port of target device. With To IP address, this parameter defines the destination of the data transmission.

Programmatic Use

Block Parameter: toPort

Enter the base sample time or a multiple of the base sample time.

Programmatic Use

Block Parameter: sampleTime

Introduced in R2016b