I want to resolve UDP Configure block configuration problems.
The Real-Time UDP Configure block configures a dedicated Ethernet network for real-time UDP operation. If the block configuration does not distinguish cards by specifying a different subnet for each, errors occur.
To identify UDP Configure block configuration problems, check for these issues.
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.130 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.130 Subnet mask: 255.255.255.128 ------------- Calculated Subnet: 192.168.0.128
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.
When you use the same IP address as the communication channel between the
development and target computers, you cannot use ports
Real-Time™ reserves these ports for its own use.
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.