From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Pass by reference

Solved!
Go to solution

HI all,

 

I am developing an application for testing the ECU used in automobiles. I just had a tot that is there any way to pass the array by reference. I know the method of pass by reference by getting the reference to the array and pass the reference to subvi. For this to happen I need to create an array indicator and reference for the same need to be passed to subvi. But this is nothing but pass the data to subvi by value. The only difference is that the array indicator will not be created in main vi instead a array control will be in subvi.

Is it possible to directly wire the data wire to subvi and in subvi, without creating array control, use it as ref to array and extract the data. Mean to say, data wire should be connect to subvi terminal, but terminal in subvi should give ref for that data.

 

Any ideas are welcome.

Thanks,

Yogesh

0 Kudos
Message 1 of 6
(5,764 Views)

Yogesh,

 

i am not sure if i understand you correctly, but i think you try to convert coding paradigms from textual programming languages like C/C++ to LabVIEW.

This is not suggested.

 

Instead, you should learn more about dataflow programming and the LabVIEW Compiler in order to have a better understanding for the LabVIEW internals.

 

hope this helps,

Norbert

 

Hint: You are looking for "Inplacer" i assume....

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 6
(5,760 Views)
Solution
Accepted by topic author YogeshShivarudrappa

Maybe you are looking for a data value reference? it can be a 2D array, for example.

Message 3 of 6
(5,753 Views)

Hi altenbach,

 

This is wat i was looking for. Also this saves application memory and improves the sys performance as well.

I am sorry, i am new to LV2011. May I should check wat is new in LabVIEW2011 before migrating fom 8.5

 

Thanks,

Yogesh

0 Kudos
Message 4 of 6
(5,747 Views)

Perhaps I have misunderstood your original question, but it is important to know that passing data between VIs through the normal method - a front panel control connected to a terminal on the connector pane - does not necessarily mean that data is passed by value.  When possible, LabVIEW will pass the data by reference, without making a copy.  The compiler determines whether a copy is necessary.  You can structure your LabVIEW code to minimize data copies; search this forum for "in-place" to find hints on doing this.  It is rarely necessary to use a data value reference to explicitly specify that a value should be passed by reference.

0 Kudos
Message 5 of 6
(5,721 Views)

Yes I agree with you. Also according to me usage of "in-place" is advisable for array manipulation. This really improves the system performance (memory managment).

 

Also I will post any other memory related issues/best practices in this thread.

Others can also do the same.

 

Thanks,

Yogesh

0 Kudos
Message 6 of 6
(5,701 Views)