LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Object In place In/Out

I need some clarification about In place structure.

 

I have a big and complex object (instance of a labview class). This class contains many methods that may or may not change the content of the instance. In a specific part of the code all methods are called sequentially.

1.- Can I avoid making copies of the object when calling the method by If I enclose this part of the code in a In place structure with a in/out Element option?

2.- Will this work for any type of object?

3.- If I call another method inside a method called within the In place structure, will a copy be made? 

4.- If my wire goes through nested in place structures, should I use In place structure with a in/out Element option every time?

5.- I also want to iterate over an array of objects, operate on them and then rebuild the array. Is there any nice way to combine the indexing ability of a for loop with the in place replacement? (apart for doing a for loop and using In place array index

 

Thanks,

 

Hernan

0 Kudos
Message 1 of 3
(3,200 Views)

Hola.

 

 

     Sigue un link para la consulta.

 

     LinK:https://www.ni.com/en/support/downloads/instrument-drivers/instrument-bus-performance---making-sense...

 

 

 

 Saludos.

 

 

Diogo.

         

     

Diogo Aparecido
Applications Engineer II
National Instruments Brazil



0 Kudos
Message 2 of 3
(3,110 Views)

I can't say I fully understand your questions (a screenshot might help), but generally, when you call a subVI in the class which has the object as an input and an output, a copy of the object is NOT created. LabVIEW is usually smart enough to reuse the single allocation it made. The same applies to calling the subVIs in sequence.

 

That means you don't usually have to use the IPE structure for something like this. The IPE structure is basically designed for making some code cleaner and for being more explicit. You don't have to use it all the time. If you want to do something like replacing elements in a large array which is inside the class cluster while making sure you don't have memory issues, then use the IPE structure inside the VI that does the replacing.


___________________
Try to take over the world!
Message 3 of 3
(3,088 Views)