F2838x-M4 UDP Send
Send UDP packets to UDP host
C2000™ Microcontroller Blockset F2838x / M4
The UDP Send block sends UDP packets to a UDP host. Use the block for stateless and connectionless data transmission.
The block sends packets from the port number specified in the Local IP Port (-1 for automatic port assignment) parameter. The IP address and the port number of the receiving host are specified in the Remote IP address (255.255.255.255 for broadcast) and Remote IP Port parameters.
You can choose to send UDP packets in the blocking or nonblocking mode.
Your antivirus software or firewall might block UDP traffic. Configure the software to allow traffic from a specific IP port number.
Due to RAM memory limitations on the F2838x(ARM Cortex-M4), loading application to RAM is not supported for this block.
CPU Timer 2 of F2838x Arm Cortex-M core (Connectivity Manager) provides time base to lwIP stack. It is configured to trigger an interrupt every 1 ms. This timer should not be re-configured if Ethernet blocks are being used in the model. If the corresponding interrupt is armed through Hardware Interrupt block, it will run the interrupt handler every 1 ms.
Port_1 — Input data port
The port accepts an array and sends it as UDP packets over an IP network to the receiving UDP host.
Remote IP address (255.255.255.255 for broadcast) — IP address of receiving UDP host
192.168.1.10 (default) |
Specify the IP address or the host name to which the block sends the UDP packets.
To broadcast packets to all the receiving hosts, specify
Remote IP Port — IP port on receiving UDP host
25000 (default) | positive integer in the range
Specify the port number of the application on the receiving host to which you want to send the packets. Match the remote port number with the local port number of the receiving host.
Local IP Port (-1 for automatic port assignment) — IP port on sending UDP host
-1 (default) |
Specify the port number of the application from which you want to send the packets.
When you specify the default value of
-1, the block randomly
selects a port from the available ports to send the data. If the receiving host
expects UDP packets from a particular port number, specify the number of that
Wait until previous packet transmitted — Wait to sent new packets
off (default) | on
on— When you select this parameter, the send operation runs in the blocking mode. In this mode, if the block is still transmitting the packets received in the previous time step, the block retains the data at the input port in the current time step and waits to send it.
A task overrun occurs if the target hardware is still waiting for the requested data to be sent when the next send operation is scheduled to begin. To fix overruns increase the time step by using the Sample time parameter.
off— When you clear this parameter, the send operation runs in the nonblocking mode. In this mode, if the block is still transmitting the packets received in the previous time step, the data at the input port in the current time step is dropped.
In either mode, if the block is yet to establish the connection between the sending and receiving hosts. or if the connection is lost, the data at the input port is dropped.
Introduced in R2020b