LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Large Arrays by Reference


@crossrulz wrote:

Do not make a DVR of the control reference.  That is making a reference to a reference.  Instead, make the DVR of the data itself.


There's no advantage to using a DVR here; wire the array directly. I don't have a recent-enough version of LabVIEW right now to open the VIs that were posted, but passing an array to a subVI through a standard terminal does not necessarily create a copy of that array. To avoid making a copy, the subVI's front panel should be closed (otherwise you will get a copy, for display) and the terminal should be marked as required (otherwise LabVIEW will hold onto a copy, in case you call that subVI again elsewhere without anything connected to that terminal). On the block diagram, the terminal should be on the top-level of the VI, not buried in a loop or case structure. If you follow these guidelines, LabVIEW will work directly on the array passed into the subVI, and will not make a copy.

Message 11 of 13
(680 Views)

@id wrote:

Here u go Ben.


Who is Ben?

 

In any case, look at Tim's anwer to see what I meant.

0 Kudos
Message 12 of 13
(670 Views)

@nathand wrote:
If you follow these guidelines, LabVIEW will work directly on the array passed into the subVI, and will not make a copy.

There are complicated gudelines and might not always be suitable.

 

I guess one possible reason for the use of a subVI here is to present a small part of the data to the user. In this case, the front panel might need to be open. I might also be open during debugging.

0 Kudos
Message 13 of 13
(667 Views)