07-07-2005 07:58 PM
07-08-2005 02:21 AM - edited 07-08-2005 02:21 AM
Message Edited by Philip C. on 07-08-2005 02:22 AM
07-08-2005 04:48 AM
07-08-2005 06:32 AM
I don't understand what you mean by it doesn't detach from the caller. The code that I have described to you is exactly like the picture the other fellow posted (except that I typically run the VI before opening its front panel). Given this code, either a new instance of your program will open, or you will get an error. If it's not opening there must be an error. What is it?
I know this technique works, it's a technique that I use a lot.
Mike...
07-08-2005 11:34 AM
07-08-2005 12:26 PM
07-08-2005 04:15 PM
Set Auto Dispose ref property of the Run VI method to True. Also to avoid saving dialogue for the VI cloned from a VIT, make sure you close the front panel of your child VI when it's done. Just use Close FP method of the invoke node for the VI class in the child's (vit's) clean-up code. You don't need to wire the VI reference in - LabVIEW will assume it's a ref to the VI from which the call is made.
Stanislav Rumega, CLA
LabHSM Toolkit - advanced event-driven programming in LabVIEW with hierarchical state machines and active objects
07-11-2005 06:01 AM
@shoneill wrote:
Hi Philip,
The information that an executable can't compile a VI is new to me. How does this then work with dynamic loading of VIs? I thought that the VI is not compiled when it is saved, and that an executable can load and compile the VI before running it when the VI is called via VI server from an executable.
Shane.
07-11-2005 07:22 AM
07-11-2005 08:17 AM
I don't think LabVIEW really can compile code in the runtime system at all. What has changed in comparison to earlier versions is that certain aspects of interaction between front panel and compiled code have been better isolated in newer versions, to allow remote control of VIs through front panels running in the host system, while the actual code runs and executes on the (embedded) target system. You could say that the LabVIEW runtime system contains actually the linker necessary to glue together the different parts of of a VI hierarchy to a runnable code base, but can't compile the diagram into the actual binary machine code. As far as I know the runtime system doesn't care about the diagram at all, not having any support to deal with it in any way. As such the runtime system is more than just a library of UI widgets and OS communication libraries, as it also contains the linker to create an executable image in memory from the different VIs on disk, but there is no compiler support at all as far as I know.
@shoneill wrote:
Thanks for the clarification of re. compiling of VIs at runtime in an executable.
I get the fact that a VI can be compiled, but that the resulting VI (with compiled code) cannot be written to disk.
Is this a fundamental technological limitation, or simply the way things were done? It would be really nice to be able to use VITs whis way with an executable. I have a few programs which have, until now, only been run within the development environment. I was not aware that these will be broken as EXEs.
I was under the impression that NO compiled code was saved in a VI, but now I know better. It kind of makes sense too now that I think of it.
I'm still a little unsure about a slight discrepancy between what Philip and Rolf have said here regarding the ability to compile any VI at runtime within an EXE. Phil's answer comes closer to that I had originally thought, but according to Rolf, the compiling of a VI at runtime isn't possible.
Which is true? At the moment, I assume that a "normal" VI CAN be compiled (but not saved in the new compiled form) whereas a VIT just doesn't work properly because the saving part, which is otherwise critical, is not available.
Can someone help me grasp the final piece of the puzzle?
Thanks
Shane.