07-15-2009 03:27 AM
Hello everyone,
I have a LV module that calls test modules dynamically through Call by Reference Node. I do the following:
1. Start to run a script that contains these test modules in a specific order.
2. In the order, I open the VI reference to a specific test module, run it through 'Call by Reference Node' and store this VI reference in a shift register. (The reason for storing the VI references is that the test modules might need to share data between themselves and hence they gotta be in memory)
3. I close all the references at the end - when the script has been completely executed.
With this module still in the running state (module is idle and it is not running any scripts), I try to open a test module in LV and I find that it is actually showing the "SubVI waiting to run" glyph.
I would like to know whether this is the behaviour expected and what should I do if I have to make the test module editable while my module calling the tests is still running?
I am using LV8.6
Thanks in advance,
Saranya
07-15-2009 07:33 AM
Once you open a reference to a subVI, the subVI will be in the "waiting to run" state. You need to close the reference to get the subVI back to an editable state.
If you need to pass information between subVIs, I would recommend you use one of the standard singleton data objects (single-element queues or action engines) to do this. This will allow you to open and close the VIs as needed while keeping the data persistent. Those links contain example code and full explanations.
07-15-2009 07:42 AM
Hi DFGray,
I am closing the VI reference when the entire script has been completed. I am trying to open the test module only after closing the VI reference. Even then, I see that test module having "SubVI waiting to run".
Thanks,
Saranya
07-15-2009 07:45 AM
Saranya,
you have to store/close the reference to each VI loaded that way. I fear that you only store the reference to the last VI in the shift register and close only that... is that possible?
Posting the calling code could shed some light on this...
Norbert
07-15-2009 07:52 AM
Norbert,
I am storing all the VI references in an array in the shift register and I close all the references at the end of the test at one stretch. I am able to see that the VI references are being closed and no longer exists in the shift register.
Thanks,
Saranya
07-16-2009 07:34 AM
I think we have reached a limit of what we can debug using descriptions. Can you post your code so we can look at it? If not, can you post a screenshot (PNG or GIF format is best, please do not use BMP or a Word document, JPG is marginal)? Something is keeping your subVI open, but without the code, it is hard to tell. Some options:
07-16-2009 07:48 AM
This is just a shot in the dark...
LV keeps track of which resource where opened by each VI as part of its house-keeping routines. When a VI goes idle all of the resources allocated by that VI are closed etc. So opening and running VI's by a VI that completes and goes idle will terminate those VI's that were created. Two techniques to avoid this situation are;
1) Make sure the VI that opens the VI's stays running until everything is done.
2) Have the dynamic VI open a ref to themselves so that they keep themselves open.
sS I said, just shooting in the dark,
Ben
07-16-2009 08:39 AM
Sorry Guys. I know that posting a code would ease the process. I am just held up with few other things in the project. I will post a sample code as soon as possible.
Thanks,
Saranya