02-18-2009 12:35 PM
I am trying to cut down on memory usage in my RT application, and one of the methods I am exploring is replacing some of the larger subVIs with VI Server Call by Reference nodes. My problem is, I want to be able to debug the VIs in question when running in development mode, and it is my understanding that I can't debug a VI called dynamically. If so, I'd like to be able to switch between calling by reference (when compiled as an executable) and including as a subVI (when running in development mode).
I realize I could just throw an App.Kind property node on the block diagram with a case structure containing the subvi for "development mode" and the Call by Reference node for "Run-Time Engine", but my understanding is that the subvi will still be loaded into memory when the calling VI is called (by virtue of placing it in the block diagram), even if that case is never executed. Please feel free to enlighten me if I am incorrect about this!
If I am wrong about debugging dynamic VI calls--if it is possible to probe/highlight execution on a VI running by reference with the VI Server on an RT target--then I can skip the above issues and just call the VI dynamically all the time. However, I am then faced with the additional problem: how to I call a VI by reference on a remote target if the VI in question is not stored on the target's hard drive? When I compile the startup.rtexe, I can set the VI in question to "Always Include" and set the destination to within startup.rtexe, so I know the path to specify for the Call by Reference node. However, when running in development mode, where do I point the reference? The VI is saved on my Host PC. I assume when I deploy the main RT app in development mode, that the VI is then stored in memory on the RT target. So, in the latter case, what path can I use?
[I apologize for including so many questions in this post--hopefully you can sort it out and help me find a solution! Thanks]
02-18-2009 09:51 PM
First of all, you can debug a VI called using a Call by Reference node. One trick is to programatically open the front panel before you do the call by reference. In addition, you can place a breakpoint in the diagram to force the block diagram open.
Second, dynamic calls can cut down on the amount of memory used at one time, but it doesn't come for free. Because the VI isn't loaded into memory until a reference to it is opened a large Vi can impose potentially significant delays while loading into memory.
Mike...
02-18-2009 10:17 PM
05-29-2014 07:58 AM
I have similar need and I posted my question at Dynamic VI calls in Real-Time targets using only "Paths". Please repond if you anyone of you had come to solution for above need.
Thanks,
Ajay.