- Instrument Control Toolbox: https://www.mathworks.com/help/instrument/udpreceive.html
- Embedded Coder: https://www.mathworks.com/help/ecoder/ref/udpreceive.html
- DSP System Toolbox: https://www.mathworks.com/help/dsp/ref/udpreceive.html
- Make sure the network connection is set up correctly. You should be able to ping your external device's IP address using the Windows command line. You can use 'ipconfig' to see all the networks your computer is connected to and the respective IP addresses.
- If your PC has multiple network interfaces (multiple Ethernet cards, USB-Ethernet converter, WiFi connection etc.), then the Windows network driver could be routing the UDP packet to the wrong network interface. You can try disabling all other network interfaces and just keep one of them active (the Ethernet which is used for host-target communication) and see if it resolves the issue.
- You can try to configure the external device to send data to a different port (e.g., 25002 instead of 25001) and see if that resolves the issue.
- Use a third-party tool such as Wireshark to monitor the network traffic on different network cards.
- You can try the UDP Receive block from the Instrument Control Toolbox and uncheck "Enable blocking mode" to output the status. Check if the raw data are received successfully. Sometimes, data might be received successfully but interpreted incorrectly so it becomes zero.
- The UDP block might not be not reading the data in the right format. In your UDP Receive block, you also need to specify the right type and buffer size to receive data correctly.