Skip to Main Content Skip to Search
Product Documentation

UDP Send - UDP Send block

Library

xPC Target Library for UDP

Description

The Send block has one input port, which receives the uint8 vector that is sent as a UDP packet.

Regardless of the data type of the data being sent, you must supply a byte stream (represented as a uint8 vector) to the Send block. Use the UDP Pack block to convert from the signal data type to a single vector of uint8 values. See the UDP Data Streaming Demo for a demonstration of how to use the UDP Pack block to convert your data to a uint8 vector.

Block Parameters

IP address to send to

Specify the IP address to send the packet. Enter a valid IP address as a dotted decimal string. For example, 10.10.10.3. You can also use a MATLAB expression that returns a valid IP address as a string.

Remote IP port to send to

Specify the port to which to send the packet. This value must match the IP port to receive from parameter of the UDP Receive block

Use the following local IP port

Set this parameter to -1 (default) to allow the networking stack to automatically determine the local IP port that is used for sending. Otherwise, specify a particular port to send a packet from that port.

Allow variable length packets

Select this check box to enable the sending of variable length messages. Selecting this check box enables a second input port.

The width of the first signal entering the first input port specifies the maximum length of the input message. If this check box is selected, the first input port receives the actual data, and the second input port receives the actual length of the message.

If this check box is cleared, the block sends all the data each time.

Sample time

You can set this parameter to -1 for an inheritable sample time, but you should set this parameter to some specific (large) value to eliminate chances of dropped packets. This is especially true when you are using a small base sample time.

See Also

UDP Pack

UDP Receive

UDP Data Streaming Demo

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS