From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-01-2018 08:46 PM
Hello again,
I use multiple UDP receivers on the PC host to receive from multiple ports. Then I have multiple vis on a cRIO, each one has one UDP senders. I am planning to sometimes use one or two UDP senders. But if one UDP sender is not sending, all UDP receivers stop working, not just the one without sender. What can I do? Everything works fine, when all UDP senders are working.
Thanks!
Solved! Go to Solution.
07-02-2018 01:26 AM
07-02-2018 02:24 AM
Hi Gerd,
I guess I found it. If I set the timeout of the UDP read vi to something more than the UDP sender loop time, its working. Timeout was set to infinite(-1).
Lets say, the sender vi on the cRIO sends every 500ms, then I set the UDP read to 550 ms and its all good. If its less than 500ms, the read value appears and goes back to 0.
Reading temperatures from a NI 9217 for instance.
Cheers,
Steffen
07-02-2018 02:39 AM
07-02-2018 06:55 PM
07-03-2018 12:42 AM
Hi Steffen,
your "udp receiver" is missing a subVI. (Did you rename that subVI before uploading? In case you did: WHY did you do that?)
I used that 2nd "subVI" as a replacement for the missing subVI (even though it seems to call itself right now):
- Why don't you use autocleanup?
- Why do you use a single loop to handle 3 different devices in parallel? Use 3 loops in parallel!
- Why is this subVI NOT set to invariant? Right now the 3 instances of this subVI will NEVER run in parallel!
- Why is there a wait function in your loop? You already use the timeout input of the UDPRead function to let the loop wait for UDP messages!
07-03-2018 02:54 AM - edited 07-03-2018 03:22 AM
Hi Gerd,
this would be the missing vi
Have to think about that timeout. If its too short, it may miss the next value. Wouldn't the loop continue, if the timeout is longer than the loop time?
Reg. Cleanup, this is just a test vi
Cheers,
Steffen
07-03-2018 03:10 AM
Hi Steffen,
If its too short, it may miss the next value.
Yes. But you get an error to recognize/handle this issue…
Wouldn't the loop continue, if the timeout is longer than the loop time?
Yes, the loop would continue - once UDPRead received a message OR the timeout occurs…
The point is: you don't need an additional wait in the loop with a reasonable timeout! The loop will iterate when a new message is received OR after the timeout occured…
07-03-2018 03:30 AM - edited 07-03-2018 03:33 AM
ok, wait until next ms set to 1000 in sender and receiver, timeout to 150ms, works. If I set timeout to say 3000 the loop indeed is waiting 7-8 s, because 3 out of 5 receivers don't get data
07-03-2018 03:33 AM - edited 07-03-2018 03:34 AM
Hi Steffen,
the receiver should have NO additional wait in the loop!
Here I would just set a timeout of 1100ms as your sender will send a message each 1000ms…
If I set timeout to say 3000 the loop indeed is waiting 7-8 s, because 3 out of 5 receivers don't get data
AND BECAUSE your subVIs aren't set to invariant!
(If that would be the case your loop would wait just 3s instead of 7-8s…