Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 66749

Inline subvi's and memory usage

$
0
0

Hello all,

 

I have an application that acquires large sets of data (Arrays of 1000x 600000 singles or I32s) from a camera via IMAQ, processes it using LabVIEW GPU, and then saves that data for post-acquisition analysis. According to Memory Management for Large Data Sets:

 

Create large block diagrams. LabVIEW creates copies of data when calling subVIs.

 

However, this is currently causing large issues with code readability, modularity and scalability. Currently the size of the main .vi requires so much scrolling it requires a significant amount of work to find portions of the code and tracing the execution, debugging and merging is a nightmare. This is also causing big issues as I bring other developers onto the project.

 

I have mitigated this somewhat using the techniques in Managing Large Data Sets in LabVIEW, where most of the large arrays are stored in pre-allocated queues and these queues are frequently used in our post analysis steps inside of subvi's. I would like to encapsulate a number of the most frequently used sections in our acquisition and processing steps in subvi's and inline them to hopefully retain the same speed (this application would ideally be a real-time application using DSPs or FPGAs if not for other constraints) as before as described in VI Execution Speed under the "Subvi Overhead" section:

 

"A third way to minimize subVI overhead is to inline subVIs into their calling VIs. When you inline a subVI, LabVIEW inserts the compiled code of the subVI into the compiled code of the calling VI. If you then make changes to the subVI, LabVIEW recompiles all calling VIs of that subVI to include those changes. Essentially, inlining a subVI removes the need to call the subVI at run time. Instead, LabVIEW executes the subVI code inside the compiled code of the calling VI.

 

Inlining subVIs is most useful for small subVIs, subVIs within a loop, subVIs with unwired outputs, or subVIs you call only once. To inline a subVI, place a checkmark in the Inline subVI into calling VIs checkbox on the Execution page of the VI Properties dialog box. You must also select Preallocated clone reentrant execution on the same page of the dialog box. LabVIEW automatically preallocates clones for each instance when it inlines the subVI."

 

My question is, if I don't use queues or functional globals within my inlined subvi, will the subvi generate copies of my data? Are there any other bottlenecks I could be introducing by doing this (such as having debugging enabled on the subvi but disabled on the calling vi)?


Viewing all articles
Browse latest Browse all 66749

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>