@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.
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).
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?
@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.
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.
Like a Queue, you would have to create the reference before the two loops and pass the reference into the loops.
Here is a very simple code outline of how to pass a queue reference between two loops.
Queues and DVRs really are wireless. Both references are pointing to the same data.
Thanks Chris & James,
But, any loops that uses that queue has to wire to the queue creator shown in the blue line.