07-21-2009 05:14 PM
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
08-06-2009
01:42 PM
- last edited on
07-08-2024
02:09 PM
by
Content Cleaner
Hola.
Sigue un link para la consulta.
Saludos.
Diogo.
08-07-2009 04:47 AM
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.