Documentation

Real-Time UDP Troubleshooting

Duplicate Subnet Calculated in Block

You can use a dedicated Ethernet card for TCP communication while using another card for communicating between the development and target computers. During model initialization, you get this error:

The subnet in this block is the same as or is a subset of the subnet 
calculated in ''block''. The block calculates the subnet by ANDing the 
IP address bitwise with the subnet mask.

Check the IP address and subnet that you assigned to the target computer Ethernet card in the configuration block. The UDP implementation requires that the two communication channels use separate subnets.

The block calculates the subnet by ANDing the IP address bitwise with the subnet mask for each card. For example, these specifications result in the same subnet for both cards:

E1 (development-target): IP address:        192.168.0.25
                         Subnet mask:       255.255.255.0
                                            -------------
                         Calculated Subnet: 192.168.0.0

E2 (RT-UDP):             IP address:        192.168.0.26
                         Subnet mask:       255.255.255.0
                                            -------------
                         Calculated Subnet: 192.168.0.0

Try a configuration such as the following:

E1 (development-target): IP address:        192.168.0.25
                         Subnet mask:       255.255.255.0
                                            -------------
                         Calculated Subnet: 192.168.0.0

E2 (RT-UDP):             IP address:        192.168.0.26
                         Subnet mask:       255.255.255.2
                                            -------------
                         Calculated Subnet: 192.168.0.2

In some networks, the development computer must also be in the subnet where the TCP communication occurs. You can either add a second network card to the development computer or provide a gateway device to create a dedicated network for TCP communication.

Excluded Ports When Using Development-Target Computer Connection

When you use the same IP address as the communication channel between the development and target computers, you cannot use ports 22222 and 22223. Simulink® Real-Time™ reserves these ports for its own use.

ENOPKTS Error

During real-time execution with a UDP model, you sometimes see the error ENOPKTS. This error stops model execution. When too many packets are received and queued at the UDP socket and too few packets are removed, this error occurs.

To address this issue, decrease the sample time of your UDP Receive block.

Related Topics

Was this topic helpful?