UDP Receive
R2026bLibraries:
STM32 Microcontroller Blockset /
STM32F2xx Based Boards
STM32 Microcontroller Blockset /
STM32F4xx Based Boards
STM32 Microcontroller Blockset /
STM32F7xx Based Boards
STM32 Microcontroller Blockset /
STM32H7xx Based Boards
Description
The UDP Receive block receives UDP packets from a UDP host. Use the block for stateless and connectionless data transmission.
With each sample, the block outputs the contents of a UDP packet as a (Nx1) array.
The block receives the packets on the port number specified in the
Local IP Port parameter from the IP address
specified in the Remote IP address (0.0.0.0 for accepting
all) parameter. To receive packets from all the sending
hosts, specify the remote IP address as 0.0.0.0. Match
the port number specified in the Local IP Port
parameter with the remote port number of the sending host.
You can choose to receive the UDP packets in blocking or non-blocking mode.
Note
Ensure to configure the Ethernet options in STM32CubeMX project. For more, see Ethernet Configuration in STM32CubeMX for STM32 Processor-Based Boards.
If you are having trouble using UDP to communicate with a computer, investigate if antivirus or firewall software is blocking UDP traffic. If so, try to configure the software to allow the traffic for a specific IP port number.
Examples
Ports
Output
Parameters
Programmatic Use: Add Block
To add the block programmatically, use the add_block function with one of these library block paths as the source.
"stm32f2xxblockslib/Udp Receive"
"stm32f4xxblockslib/Udp Receive"
"stm32f7xxblockslib/Udp Receive"
"stm32h7xxblockslib/Udp Receive"
Example: add_block("stm32f2xxblockslib/Udp Receive","myModel/myBlock",MakeNameUnique="on")
More About
Extended Capabilities
Version History
Introduced in R2022b




