LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Please explain the In Place Element Structure to me.

Solved!
Go to solution

Please explain to me like you would explain a little child the In Place Element Structure.

 

 

In Place.png

 

 

I have some difficulty understanding this structure. 

Optimizing speed and memory usage? Why does Labview not do this automatically in the background?

Is there a situation you do not want to optimize memory usage?

 

Please make me help understand and kudos will be given Smiley Happy

 

 

--------------------------------
The Enrichment Center is required to remind you that you will be baked, and then there will be cake.

0 Kudos
Message 1 of 7
(15,418 Views)

Hi

 

In LabVIEW 8.5 and later, you can use the In Place Element Structure to avoid making copies of data when using an array, cluster, or waveform.

Many common LabVIEW operations, such as operating on an element of an array and placing the resulting value back into the same array index, require LabVIEW to copy data values and maintain those values in memory. This increases memory usage.

 

Manage Memory in LabVIEW Using a New Block Diagram Structure

Message 2 of 7
(15,398 Views)

Hello hsm78, thank you for your reply.

 

I understand what you are saying, what I don't understand is why does LabVIEW not automatically do this?

I see no benefit in not using the In Place Element Structure. Is the compiler not able to detect when to

use the In Place Structure?

 

I'm sure I need more understanding, the smart people at NI know what they are doing. It just doesn't makes sense to me yet.

--------------------------------
The Enrichment Center is required to remind you that you will be baked, and then there will be cake.

0 Kudos
Message 3 of 7
(15,391 Views)

Why does Labview not do this automatically in the background?

Usually it does. The compiler is pretty darned good about detecting when it can operate in place and will usually do so on it's own if you use the traditional cluster bundling primitives.

 

The in place element structure is used for more than bundling though, it must be used to operate on data value references, can help with variants, can make some array operations more efficient, and there are some fringe use cases involving object oriented programming where the structure has an explicit use that can't be produced by other means. For other situations it's just a form of explicit syntax requesting that LabVIEW do its best to operate in place if possible.

Message 4 of 7
(15,373 Views)

Hello Heinen,

 

I don't have an answear to your specific questions, but I have an example:

 

 

Use the In Place Element structure when you operate on a data element within an array, cluster, variant, or waveform without requiring the LabVIEW compiler to copy data values and maintain those values in memory

 

http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/in_place_element/

 

 

 

 

Alex

 

Message 5 of 7
(15,370 Views)

Hi,

 

the following shows a situation in which you can use the In Place Element structure to improve the execution and memory efficiency of a VI.

In Place Element Structures: Increasing Memory Efficiency

Message 6 of 7
(15,364 Views)
Solution
Accepted by SectorEffector

Alex et al,

 

the Inplace Element Structure was introduced in back in LV 8 (don't recall exact version). Starting with LV 8.6, following 2009 and 2010, NI made significant changes to the way how the block diagram is compiled into executable code (requiring the LV RTE).

Experience shows, that using current versions of LV (2010 and later), the Inplace Element Structure has not much benefical effect as the (pre)compiler already optimizes most of the situations where performance could be increased; honestly, in some situations the usage of this structure does DEcrease performance as the compiler must NOT optimize on his own within this structure.

 

There are, still, some cases where this structure can improve performance keys (like memory usage) when used prudently. And there are some cases where you have to use this structure, namely when using Data Value References.

 

hope this helps,

Norbert

 

EDIT: You can start here for further information about compiler optimization done by the LV compiler. Please note that those can depend on the "Allow Debugging" setting of the VI.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 7 of 7
(15,345 Views)