11-25-2014 11:41 AM
Hello,
I am trying to use notifier for synchronization within my code. My project requires sender program to send a command to multiple receiver programs. The sender program has to wait for response from all the receiver programs to proceed. I am using user event to send the command from sender program to the receiver programs. And receiver program has to set the notifier after it receives the command. Sender program will wait on notifier.
If I don't have any delay between subseqent notifier create vis, my wait on notifier always results in timeout for some of the receiver programs. But when I include a small delay between subsequent create notifier vis, then wait on notifier receives all the notification without timeout.
For me it looks like a LabVIEW issue, but I wanted to hear from others, that is there anything wrong in the implementation?.
I have attached a small sample program for reference. Open up the sender program, configure no of receivers and run the program. Click the send and receive button to send user events and wait on notifiers.
Thanks in advance,
Nanda
Solved! Go to Solution.
11-25-2014 12:13 PM
It seems to work just fine for me in LV 2014.
11-25-2014 12:16 PM - edited 11-25-2014 12:26 PM
I can repeat this issue in LV 2013 SP1 32 bit and 64 bit versions in multiple computers. We may not see this issue when the no of receivers is 2. But when we give no of receivers 5 or 10 and delay to false, we can see the issue.
11-25-2014 12:25 PM - edited 11-25-2014 12:27 PM
Lets look at that highlighted wire. What is it a reference to? The Clone you just launched or the reenterant original
The FP Open method is a bit archaic for launching clones look at using a Asynchronous Call By Ref and use the old "Fire 'n' Forget
And, Name your events so they are different!
11-25-2014 12:35 PM
Jeff,
Thanks for your post. I am not sure if using start aynchronuos call vi may solve the issue. I can clearly see the user events captured in the receiver vis and notifier reference is valid. So the problem may not be in the way that we call the reenterrant vi.
11-25-2014 01:04 PM
I think I figured it out over there. You are waiting on each notifier one at a time in the for loop, so you wait 1 second before waiting on the second notifier, and it might be set before you are looking at it...but now that I think about it it should still be set shouldn't it? Because of the Ignore Previous is false.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-25-2014 01:14 PM
Yup, ignore previous is set to false. It is supposed to work I guess. Now if we enable a delay using boolean in the front panel, it starts working.
11-25-2014 01:15 PM
@Nanda1985 wrote:
Yup, ignore previous is set to false. It is supposed to work I guess. Now if we enable a delay using boolean in the front panel, it starts working.
It also starts working if you turn on for loop parallelism, at least it did in my quick testing.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-25-2014 01:28 PM
No for loop parallelism didn't worked for me either. I am using number of receivers as 10.
11-25-2014 01:38 PM
Something like this would be more riggorous:
As you have your code their is a 10 second delay if you abort the first spawned vi. Add a little Info in the notifier to determine Which reciever died