02-19-2014 09:40 AM
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?
Solved! Go to Solution.
02-19-2014 09:46 AM
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.
02-19-2014 09:53 AM
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?
02-19-2014 10:00 AM
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
02-19-2014 10:03 AM
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?
02-19-2014 10:05 AM
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.
02-19-2014 10:20 AM
Thank youy Cross, if there is any website reference / examples it would be great.... 🙂
02-19-2014 10:35 AM - edited 02-19-2014 10:36 AM
Here's a very quick example of using a DVR.
02-20-2014 09:41 AM
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
02-20-2014 10:00 AM
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.