LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to (most efficiently) pass data around

Solved!
Go to solution

hi there,
I am wondering how to pass around large data around in the whole application.


For instance:
1. waveform data or data from my analog channels
(I have many VIs that will process this waveform data)
Is it unwise to to pass around continuous analog data?

2. what about if i want to process digital data?
(definitely I need to process those single bits in several VIs, for instance,
safety gate bit,  e-stop bit, need to be processed in higher priority VIs than
input 1, selector, etc).

Or, you have any suggestion which type of data I should use. I have an
impression that global VIs actually write those digital datas into a file, then
those files are passed around?

3. Is there any mechanism that pass around data in memory NOT in files?

0 Kudos
Message 1 of 29
(4,197 Views)
Solution
Accepted by tonyyyyy

By far, the most effiecient way to pass data around is a wire.  If you are really worried about memory, then you need to avoid branching the wire that holds the large amount of data in it.  This could mean doing your processes serially (one at a time) passing the data from one subVI to the next via controls and indicators and the connector pane.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 29
(4,188 Views)

hi Cruss,

If the entire application contains only one VI, such above would be the solution.

But, how to pass data around different VIs in the entire application?

 

 

0 Kudos
Message 3 of 29
(4,178 Views)

Different VIs in a single applicatiojn are most often built into a calling hierarchy. Passing wires as parameters is therefore very easy.

The only use-case where wires are not sufficient are concurrent running components (like in the Actor Framework). In that case, you can use Queues as high performing transfer option.

 

Still, the way you implement code defines if data is getting copied or not. I recommend you to attend the LV Performance Guide class for further information on this (and some more) topics.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 29
(4,173 Views)

hi Nobert,

I've studied self paced training up to level 2, but dont' see any discussion about wiring data (wirelessly) 🙂 my new invented term ...

Any recommendation?

Is there such thing in the LV help?

0 Kudos
Message 5 of 29
(4,170 Views)

Like I said, pass the data in and right back out of the subVIs.  Do the processing serially that way.

 

Another way I just thought of is the Data Value Reference.  You can put the data into a reference and then pass the reference to all of your VIs via whatever method you want (I still recommend wires to the connector terminals).  You then use the In Place Element Structure to access the data without making copies.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 29
(4,169 Views)

Thank youy Cross, if there is any website reference / examples it would be great.... 🙂

0 Kudos
Message 7 of 29
(4,157 Views)

Here's a very quick example of using a DVR.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 8 of 29
(4,143 Views)

Hi Cross or anybody,

In this case shown in the attached picture, how can I pass data around?

Obviously, producer consumer model & data reference dont' work as they need wires.

 

Any other wireless way?

Is global data a good way to pass data around?

 

thank you

0 Kudos
Message 9 of 29
(4,088 Views)

Does labview has a concept of pointer as in C++?

So i can just use address instead of copy of the whole variables in different VIs or different loops.

0 Kudos
Message 10 of 29
(4,082 Views)