UDP Receive
Libraries:
NVIDIA Jetson and NVIDIA DRIVE /
Network
Description
The UDP Receive block receives UDP packets from a UDP host. Use the block for stateless and connectionless data exchange.
With each sample, the block outputs the contents of a UDP packet as a data vector of the size specified in the Data size (N) parameter.
The data type of the block output, Data
, depends on the
Data type parameter. The data type of the block output,
Size
, is uint16
.
Note
Your antivirus software or firewall might block UDP traffic. Configure the software to allow traffic from a specific IP port number.
Examples
Ports
Output
Data — UDP packets received from sending UDP host
vector
(default)
At each sample time, the port outputs the contents of a packet received as a data vector of the size that you specify in the Data size (N) parameter.
Data Types: single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
| Boolean
Size — Determine if requested data is received at given time step
scalar
(default)
The port outputs 0 if the data is received at a given time step. Otherwise, it outputs a nonzero value indicating that no new data is available.
Data Types: uint8
Parameters
Local IP port — IP port on NVIDIA® Jetson™ board to receive data
25000
| positive integer in the range [1,65535]
Specify the port number of the application from which you want to receive the packets. Match the local port number with the remote port number of the sending host.
Programmatic Use
Block Parameter:
localPort
|
Type: character vector |
Values:
'25000' |scalar |
Default:
'25000' |
Data type — Data type of elements in UDP packets
uint8
(default) | boolean
| uint16
| uint32
| int8
| int16
| int32
| single
| double
Select the data type of the elements in the UDP packets received by the block. The size of each element depends on its data type.
Programmatic Use
Block Parameter:
signalDatatype
|
Type: character vector |
Values:
'uint8' |'uint16' 'uint32' 'double' 'single' 'int8' 'int16' 'int32' 'boolean' |
Default:
'uint8' |
Data size — Number of data elements in each UDP packet
255
(default)
Specify the number of elements that you want to receive in each packet.
Programmatic Use
Block Parameter:
dims
|
Type: character vector |
Values:
'255' |scalar |
Default:
'255' |
Sample time (seconds) — Time frequency at which block receives data
0.1
(default) | scalar
| vector
Specify how often the block should read the port buffer. Enter a value
greater than 0
or -1
(for inherited
sample time).
When you specify this parameter as-1, Simulink® determines the best sample time for the block based on the block context within the model.
This value defaults to a sample time of 0.1
seconds.
Smaller values require the processor to complete the same number of
instructions in less time and this can cause task overruns.
Programmatic Use
Block Parameter:
sampletime
|
Type: character vector |
Values: scalar | vector |
Default:
'0.1'
|
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced in R2020b
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)