05-30-2006 08:58 AM
05-31-2006 04:28 AM
05-31-2006 10:03 AM
Hi,
thanks, but this did not solve the problem, unfortunately. Please find attached a little test VI. The library contains a VI which works as a functional global variable. The second VI is just to make sure that the reference works, it is the VI to call dynamically. When you open "Analog LSGlobal.vi", set a probe to the incoming and outgoing wires for the VI reference. Then start the VI. It will write the contents of the inputs (num. value of 46 and reference of the VI) to the shift registers of the VI. Then, switch the boolean switch to FALSE and start the VI again. The outcoming numerical value is updated successfully, but the reference returns "not a reference". The same happens if I store a DAQmx Task ID in that way. Am I doing something wrong or is there something I'm missing?
Regards,
Gabs
05-31-2006 10:05 AM
05-31-2006 10:21 AM
05-31-2006 10:31 AM
05-31-2006 10:33 AM
05-31-2006 10:49 AM - edited 05-31-2006 10:49 AM
Message Edited by davidpcl on 05-31-2006 10:49 AM
06-01-2006 09:08 AM
Uh - I am almost getting crazy with that
Kevin, that solution is the right one for programming an application. In that case everything will work fine. But during testing, it is more convenient to call all VIs from their front panels one after another. That's how I'm doing it for everything that needs to be exchanged between such VIs: store them either in a global or in a functional global variable. In that way the user can "play around" with the VIs without wiring them together in a main VI. Therefore, after some thinking I liked Davids idea with that daemon VI (I solved that by adding a boolean in the initialization VI to choose if that daemon is necessary - during testing phase - or not - when using the VIs in a main application). BUT:
David: It does not work!!! I have exactly done what you proposed and this daemon VI is really running, having a True/False frame with a constant of False wired to the selector and holding both the functional global and the dynamically to call VI in the True frame. In that way, after initialization is finished, both VIs are still running but idle. Anyway, when I read back the value of the reference or the DAQmx task, it is invalid again!
That really costs just too much time. Does anybody have any idea what to do now? David, I was hoping that your suggestion would solve the problem, because it would be logical that it would - why then is LabVIEW destroying the reference and task anyway even if that daemon VI containing the functional global is still running???
Regards,
Gabs
06-01-2006 09:53 AM
After all that tests and your helpful answers it looks like that to me: When I create a reference or DAQmx Task in a main VI and this VI finishes execution, LabVIEW destroys the reference and task ID. So far, so good. But even if that main VI gives that reference or task to a sub VI which keeps on running even when the main VI has finished execution, LabVIEW seems to do the same. Isn't that a little weird? What can I do about that???
Regards,
Gabs