04-11-2013 11:28 PM
I want to pass some Boolean/String from a subvi to the main vi while the subvi is still running.
I understand that it could be done using queue/ notifier. I do not want to use global variables. I looked at different examples but failed to figure out how to do it.
I was trying to make an example by looking at an example from Labview about notifier.
Can anyone please help me with this code and guide me to the correct way.
Thanks.
04-11-2013 11:52 PM
HI
The example you have build is using queues to transfer data from subVI to main VI.
I have modified example a bit.
Check the attached. You have to run both the VIs in order to see the data in the main VI.
Same functionality you can acheive by using notifiers also.
Hope this helps.
04-12-2013 12:00 AM
Sorry, but can you please post in labview 2010 or earlier..
thanks.
04-12-2013 12:04 AM
Hi
Here is the VI in LV 2010.
04-12-2013 12:18 AM
You mentioned sub vi but you are not calling that sub vi in your main vi, then its just simply another vi running parallel. In real if you are planning to call the sub vi in your main vi you may need to call the vi in a parallel loop or you may have to dynamically call the sub vi. In your original code you are calling your main vi from the sub vi, just try to call the sub vi from the main vi.
04-12-2013 08:25 AM
Hi LV_user1,
Thanks for your time. I looked into your vi-s. They work fine. But, one thing is still not clear to me. I still need to call the sub-vi from the main VI. When I try to do that, by placing the subvi inside the while loop of the main vi, that does not work any more. I have to physically stop the Subvi to get the data out. So how to deal with that?
04-12-2013 11:10 AM
Keep the sub vi outside the main vi and run it will work. Thats what I mentioned before
04-12-2013 01:31 PM
Hi P@Anand,
Sorry I could not understand what you are suggesting.
May be my question was not clear.
I want to use my subvi in the main vi. That is the main problem. So the main vi is waiting for the subvi to finish and then get any output from that. But instead what I want is to get the data out before the subvi finishes.
I am stuck here and cannot overcome this problem. Can you please write a small example(LV-2010 please) for me! I understand my trial (Vi-s in the main post) was not correct to describe my problem. There I did not put any subvi in the main vi.
04-15-2013 09:43 AM
Hi babu726,
I have included a revised MainVi.vi and SubVi.vi for you. I had to modify the SubVi to get it to be called by the MainVi. I also included a disabled diagram structure with the code just copied and pasted in, since your code does not seem modular. Hopefully this helps!
Regards,
04-15-2013 09:54 AM
Can you please post a LV-2010 version of the vi-s please.