Send UDP message
Embedded Coder/Embedded Targets/Host Communication
The UDP Send block transmits an input vector as a UDP message over an IP network port. The remote IP port number to which the block sends the UDP packets is tunable in the C/C++ generated code.
Some Simulink® blocks and
built from models that contain those blocks require shared libraries,
.dll files on Windows®. The UDP
Send block requires the
file. To meet this requirement, follow the example on the
packNGo function page to package the code
files for your model. The resulting compressed folder contains the
that the model requires, including
To run this type of
.exe file outside a MATLAB® environment,
place the required
.dll files in the same folder
.exe file, or place them in a folder on
the Windows system path. For more details, see How To Run a Generated Executable Outside MATLAB (DSP System Toolbox).
Specify the IP address or hostname to which the block sends
the message. To broadcast the UDP message, retain the default value,
Specify the port to which the block sends the message. This parameter is
tunable in the C/C++ generated code but not tunable during simulation. The
25000. The value can be in the range [1, 65535].
On Linux®, to set the IP port number below 1024, run MATLAB with root privileges. For example, at the Linux command line, enter:
To let the system automatically assign the port number, select
Automatically determine. To specify the IP port
number using the Local IP port parameter, select
Specify via dialog.
Specify the IP port number from which the block sends the message.
If the receiving address expects messages from a particular port number, enter that number here.
Size of the internal buffer that sends UDP packets, specified in bytes as a
scalar in the range
[1, 67108864]. By default, the parameter
is set to 8192 bytes.
Sample time tells the block how long to wait before polling for new messages.
This parameter only appears in a deprecated version of the UDP Send block. Replace the deprecated UDP Send block with a current UDP Send block.