I'm not receiving data through UDP communication using the instrument control toolbox

7 views (last 30 days)
I have had some success creating udp objects to communicate with a piece of s/w residing on another computer. However, I can't see all of the udp packets that I know to be coming across, and I'm wondering why.
For example, in Wireshark (v 1.10.6) I can see udp packets coming from this other computer with the following information -->sourceIP is the other computer -->detinationIP is the computer on which I'm running both wireshark and matlab) -->the protocol is UDP -->the packet length is 60 -->the source port is 1550 -->the destination port is 36000 -->the data within the packet is 4 characters, and is as I expect it to be
When I set up a udp object with the following features: -->RemoteHost: sourceIP -->localPort: 36000 -->remotePort: (I feel this shouldn't matter - but setting this to 1550 doesn't help) and then open the udp object, the BytesAvailable is always zero despite the fact that I see the udp packets I expect arriving in wireshark about once per second (on the computer running matlab).
Suggestions would be wonderful!
I am running matlab v. 8.1.0.604 (R2013a) and v3.3 of the instrument control toolbox.

Answers (1)

Walter Roberson
Walter Roberson on 11 Mar 2014
  3 Comments
Walter Roberson
Walter Roberson on 11 Mar 2014
Nothing to do with bytes available to read. It has to do with when fread() is defined to end its reading. Which is end of file (not end of packet), or end of datagram (if terminate mode is datagram), or explicit element count satisfied, or terminator encountered (if terminate mode is not datagram), or buffer full.
cr
cr on 29 Sep 2018
I have the same issue. Not sure why DatagramTerminationMode would help here, but tried toggling it and it made no difference. Like Tom, I too can see flurry of packets broadcast and can be received on other tools like Hercules. But Matlab cannot grab any data.

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!