12-18-2008 10:04 AM
Solved! Go to Solution.
12-18-2008 10:23 AM
When you push the second button you call the same vi, which has not finished execution. So the program must wait to complete the first call to re-call it.
Solution : Make your sub-vi reentrant.
vi properties >> execution >> reentrant execution
12-18-2008 10:23 AM - edited 12-18-2008 10:25 AM
12-18-2008 10:24 AM - edited 12-18-2008 10:26 AM
Hi McMurray,
Thanks for the post and I hope your well.
This is because your calling the VI Statically. Thus when the subVI is called - the code within is being excuted, and the calling VI waits until excution is complete within the subVI. What you need to do is to call the subVI dynamically which will then allow the main VI to continue it's execution while the subVI continues to run.
This is done using VI Server.Please see image of code to use.
I hope this helps to get you started,
Note, This is more useful if you have different subVIs to call. OR if your calling VIs across a network.
12-18-2008 10:24 AM
If this is your main vi, the "neslab chiller" sub vi has to complete execution before it will return to the main vi. I'm assuming you have a while loop wrapped around the code you show in the .jpg as well?
So, this depends on the code inside the "neslab chiller" sub vi, but it will need to complete before the main vi will see another button press.
Another issue - you will want to set the boolean back to false within each respective case structure, or else the code within the case structure will keep being exectuted and not see another button press.
12-18-2008 10:27 AM
12-18-2008 12:28 PM
As far as the VI Server goes, where should it be located within my program? For example, should I include this inside of the main, overarching while loop that my program is running in, or should it be included inside of the smaller sub-loops? In other words, will creating one VI Server suffice for the entire vi, or will I need to have multiple servers running, one for each while loop calling the sub-vi?
Thanks for all the great thoughts!
12-18-2008 12:35 PM
12-18-2008 01:00 PM
Hi,
I Suggest you to use events structure, instead of case structure.
and the way u r calling the VI is statis and it does not allow any other part of the program to run until it finishes the execution.
You use dynamic VI for calling your Sub VI. and If the property of the Window appearance for ur sub VI is, MODAL, then change to to float.
This would allow you to launch all sub VIs in parallel.
and make your VI Re-entrant as mentioned in this thread earlier.
Anil
12-19-2008 04:27 AM
Hi McMurry,
Thanks for the update.
You only have one VI Server - this is one of many things LabVIEW 'sits' upon.
However, in terms of the API you can use it as much as you like. Obviously, you should only exucute the code when required - otherwise you'll call subVIs on every iteration, which if required the you may as well leave the subVI running in parallel with your main VI. Also, you would have to be careful you don't call the same VI twice (while one is open).
For more info on VI Server please see the following links:
Capabilities of the VI Server
http://zone.ni.com/reference/en-XX/help/371361E-01/lvconcepts/capabilities_of_the_vi_server/
Including, Call a VI remotely & Dynamically load VIs into memory
Building VI Server Applications
http://zone.ni.com/reference/en-XX/help/371361E-01/lvconcepts/building_vi_server_applications/
For help file info. Explain the API.
Example Finder
Search VI Server
VI Server.lvproj - shows the host calling aspect.
My example of dynamically calling:
LabVIEW 8.6.
Hope this helps,