From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Allocation for Cluster?

A cluster is essentially a C-style struct, so its "type" will depend upon what is in it.  However, a wire branch does not automatically signal a data copy.  The LabVIEW compiler tries its best to determine what data can and can not be used while maintaining data flow and only copies when it thinks it needs to.  This is the in-placeness Ben mentioned earlier.  You can get a good idea of where copies are being made by clicking on Tools»Profile»Show Buffer Allocations...  Your code needs to be compiled for this to work (hold down the CTRL key and click the run button to compile without saving).  The dots shown are conservative and do not always mean a copy will be made at each run.  For example, LabVIEW reuses memory in loops.  The unwired default input values of subVIs in a loop are only allocated once.

 

The end result of all this is that you can write deterministic code, you just need to be sure that LabVIEW's automatic memory handling, which was designed for general use, does not get in the way.  The thread Ben mentioned above will get you moving in the right direction.

0 Kudos
Message 11 of 13
(737 Views)

sparkymark567 wrote:

Hi Ben, I forgot to mention the links do not work.

Otherwise I would read all of them.


 

Then it is my bad for posting links that only work for me.

 

This tag cloud should be close to mine.

 

You will probably want to look into trying out the Real Time Execution trace toolkit which will graphically illustrate which thread execute when and when they invoke the memory manager as well as a lot of other stuff.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 12 of 13
(733 Views)

Thanks DFGray, there is some good explanation.

Ben, your Link to tag cloud is now working....I shall read some more.

 

0 Kudos
Message 13 of 13
(715 Views)