02-03-2021 03:24 PM
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
02-04-2021 12:19 PM
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
02-04-2021 12:41 PM
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.
02-04-2021 12:47 PM
Thabks Mark, I'll look. My networking ignorance told me that If WireShark could see the packets, they must be getting thru any firewalls...
02-04-2021 02:04 PM
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
02-06-2021 11:09 PM
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.
02-07-2021 10:44 AM
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