02-20-2014 10:18 AM
@tonyyyyy wrote:
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.
The Data Value Reference (DVR) is as close to a pointer as you will ever see in LabVIEW. As I said before, the DVR is a reference to your data. You have to use the In Place Element Structure to access the data. This is done to protect critical paths.
02-20-2014 10:58 AM
In order to use the DVR "wirelessly", one suggestion is to make a Functional Global Variable (FGV). This is a non-re-entrant VI containing a shift register on a single-iteration loop. Write your DVR to it once (to load the shift register), then use that FGV anywhere in your code and read your DVR from it. Another option is to use a Single-Element Queue (SEQ).
02-20-2014 12:18 PM
Quick questions:
1. In case of this problem as attached, how to pass it using DVR?
2. how does it (performance) compared to global variables?
02-20-2014 12:48 PM
@tonyyyyy wrote:
Quick questions:
1. In case of this problem as attached, how to pass it using DVR?
2. how does it (performance) compared to global variables?
For that example, I would just use a queue.
02-20-2014 12:54 PM
hi Cross,
Definitely, you can.
But, what about if I want to use DVR?
How to wire accross 2 loops?
Any way? or , DVR simply doesnt work in this scenario.
02-20-2014 01:24 PM
Like a Queue, you would have to create the reference before the two loops and pass the reference into the loops.
02-21-2014 01:03 PM
Here is a very simple code outline of how to pass a queue reference between two loops.
02-21-2014 01:18 PM
Hey Chris,
Is there a way not to use wire? (wireless ) 😄
02-21-2014 01:41 PM
Queues and DVRs really are wireless. Both references are pointing to the same data.
02-21-2014 01:48 PM
Thanks Chris & James,
But, any loops that uses that queue has to wire to the queue creator shown in the blue line.