Main Content

UDP Receive

Receive UDP packets from UDP host

  • Library:
  • NVIDIA Jetson and NVIDIA DRIVE / Network

  • NVIDIA UDP Receive block

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.

Ports

Output

expand all

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

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

expand all

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'

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'

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'

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