LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically profile memory usage on multiple VIs

I need to programmatically profile the memory usage (daily) on a set of designated VIs and record the results for future comparison.  How can I configure the profiler to start, then run a sub VI, and then stop the profiler?  Also, how can I save the results into a spreadsheet?
0 Kudos
Message 1 of 8
(3,588 Views)

Hi there,

Check out this KnowledgeBase entry. You can write the result to an array or some other type of storage and then write that to a file using the Write to Spreadsheet File.vi amongst others (see the File I/O Palette under Functions on the Block Diagram). Let me know if you have any questions!

Stephanie

Message 2 of 8
(3,556 Views)
Thanks for the reply Stephanie.  What I need to do, however, is programmatically set up the Memory Profiler (Tools>>Profile>>Performance and Memory and then select the "Profile memory usage" checkbox and then select the "Memory usage" checkbox), start it, programmatically run my selection of sub VIs, and then stop the profiler, and then save the data to a specific location.  All of this has to happen without input from a user.  It will run automatically at pre-determined intervals.

Understanding how to programmatically set up and run the profiler is where I need help.  I couldn't find any functions that dealt with the memory profiler.
0 Kudos
Message 3 of 8
(3,542 Views)
Hi,

As far as I know of, there is no way to programmatically set up your memory profiler in LabVIEW.  You can however, mimic key stokes with some sort of script that can then click the appropriate buttons/checkbuttons for your profiler, but as far as I can tell, there isnt a direct way to progammatically set it up in LabVIEW.

I hope this helps,

Regards,

Nadim
Applications Engineering
National Instruments
Message 4 of 8
(3,521 Views)

I'm looking for this exact features of profiling set of VIs programmatically while the application runs.  I got some hindsight that VI Analyzer toolkit and Log VI Data can help with this.  Anyone successful in this?

--
Ajay MV


0 Kudos
Message 5 of 8
(2,351 Views)

I'd start searching in C:\Program Files\National Instruments\LabVIEW 20xx\project\_ProfileBufferAllocations.llb

 

Now a lot of this is PW protected (EDIT: actually, a lot isn't but the interesting parts are), the main VI is completely obfuscated (no diagram, not a normal VI).

 

Turn On LV Profiling.vi and Turn Off LV Profiling.vi are pretty autonomic though.

 

What I get from other VIs (Read PBA Bin File API.vi, etc.) it seems that enabling profiling creates a file somewhere that can be read... EDIT: Turn On LV Profiling.v takes a path to a BAP file. That could be the PBA file?

0 Kudos
Message 6 of 8
(2,342 Views)

Profile.png

 

This gives me results.

 

But it's tricky! It only gives results for (sub) VIs that executed. Also execution of those VIs is somehow blocked by the profiler. My test.vi (that should be a path of course) didn't execute until I continued from that 1st brakepoint. It's probably designed to run in another context...

 

The results are somewhat cryptic as well. But that's what you get once you go low level...

Message 7 of 8
(2,331 Views)

Profile 2.png

 

I think this works mostly as expected, and does everything asked for? 

 

Except "Also, how can I save the results into a spreadsheet?". I hope that's clear now we can get data? It's really a completely different topic.

Message 8 of 8
(2,328 Views)