LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RT Call by Reference

I am trying to improve the performance of some RT software running on a PXI target (RTOS). The software is used to run various test sequences on the target. The sequences have been placed as subVIs in a larger "Test Player Engine" VI, which itself is just a state machine with an event structure. When a "Start Test X" event is triggered, the test player engine transitions to the state containing the test sequence subVI, the subVI is executed, then the test player engine returns to the event structure to wait for the next test event.

 

What I am wondering is: can I remove the test sequence subVIs and replace them with Call by Reference nodes, so that I can dynamically load and unload the VIs from memory? Will that free up some system resources on the target? It is my understanding that the RTOS automatically deallocates the memory used by a subvi when it is finished executing, but I'm not sure if that is the case if the calling VI is still executing.

 

I would appreciate any info or suggestions anyone could offer.

0 Kudos
Message 1 of 2
(2,530 Views)

Hi TurboPhil,

 

Using a Call by Reference node will allocate the memory more efficiently than calling sub-VIs.  The memory for a sub-VI is allocated when the calling VI starts running, and it stays in memory until the calling VI completes execution and deallocates the memory.    A Call by Reference node will only allocate memory when the sub-VI is called.  It will also release the memory when the sub-VI completes execution.

 

Best Regards,
Bryan H.
0 Kudos
Message 2 of 2
(2,499 Views)