LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UDP Read not working

This is odd.  I bought a new PC, and installed LV Community 2020 on it.  Tried out some of my (working) existing code, and my UDP Read code won't read any packets, they just always time out.  I know that devices are streaming packets because WireShark tells me they are (each device sending a packet every 50ms).  I looked at the shipping examples, but of course they don't use external devices.  All my TCP stuff works just fine.

 

So I stripped things down to (I think) the most primitive, see the snippet.  I looked at 'My Computer' properties under a project, tried changing from Local Host to actual static IP, no difference.  So even though I know that there's a device banging away at port 50100 every 50ms, the packets just bounce off.

 

So unfortunately I've changed more than 1 thing - new hardware, new version of LabVIEW.  Hard to imagine NI changing UDP stuff, tho.  Maybe network settings on my new PC?  ipconfig looks OK at a glance.  What fresh, new user mistake have I created? paul

0 Kudos
Message 1 of 7
(1,524 Views)

An update: I dusted off an old LV2015 machine. The problem is there, too.  Again, I can use WireShark (plain-Jane, freeware ethernet sniffer) to verify that my devices are indeed streaming UDP data packets every 50ms each. I did try with & without wiring the "Network Address" input to the UDP Open function, no joy.

 

So it's 2 to 1 - my LV2019 machine reads the packets just fine.  And I know the packets are "good" on that setup, not only examining them with WireShark, but the data that's contained in the packets is "good" - they're the correct length, and I can successfully parse/decode them into reasonable data.

 

So I wonder about network hardware/driver issues, but WireShark tells me on all 3 machines that the UDP packets are streaming along just fine.  TCP read/write works great on all 3 machines.

 

I fiddled around with VI Server settings, to no avail, but that seems to me unrelated, I'm not requesting anything from it.

 

I can't very well build the app and give it to my customer and tell them I "HOPE" that UDP reads will work - the app totally depends on reading the UDP data from my devices.   This is a showstopper for me - HELP SOMEBODY! with more networking expertise than me! thanks, paul

 

 

0 Kudos
Message 2 of 7
(1,474 Views)

I would look at your firewall settings. Since you are seeing the packets in Wireshark, they are getting to th ecomputer. If LabVIEW is not seeing them, I would suspect that the firewall is blocking them.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 3 of 7
(1,471 Views)

Thabks Mark, I'll look. My networking ignorance told me that If WireShark could see the packets, they must be getting thru any firewalls...

0 Kudos
Message 4 of 7
(1,467 Views)

Think I got it.  I did open up all the firewall settings, but that didn't do it.  The problem is this: I (insanely) hard-coded the PC's static IP address in the code that configures the sending devices.  I moved to a different machine, which then (as opposed to my other machine) connects to a DHCP server that gives it a new (dynamic) address.  Henceforth - devices are sending packets to the wrong destination address. Now, the customer's network is totally private and won't have a DHCP server - everything's static.  So (I think) I need to get the PC's IP address using Win32 call or LabVIEW's IP-to-String, and "dynamically" (as in "more intelligently"😉) configure the sending devices.  Wish me luck.

 

I appreciate your help with this, Mark - paul

0 Kudos
Message 5 of 7
(1,447 Views)

If this is intended only to work on the customer's network, it's probably worth it to replicate the network and configure the PCs accordingly.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 7
(1,419 Views)

Not a bad idea, BillKo.  No doubt, when I install this into the actual network, I'll have some (hopefully small & tame) surprises - thanks, paul

0 Kudos
Message 7 of 7
(1,395 Views)