LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What's the best way of displaying output in other VI ?

For example, in a sub-vi I continuously acquire a motor position, and I want the position value to be displayed simultaneously in a numerical indicator or waveform in the main vi.
 
I know there are lots of ways to implement this easily, but I just want to know what's the best way which use lest computer resources, say memory....
 
Can control reference be used effectively for this?
 
Thank you for your suggestion.
 
Dejun
 
 
0 Kudos
Message 1 of 10
(3,980 Views)

Looks like no one reply me.....Smiley Surprised

I add more detailed information:

I ever used global variable (GV), writing data to GV in subvi in a loop structure, and read GV in main vi in loop structure.

Even though I used time delay in these loop structure, still looks like computer became a little non-responsive, and no data were read from GV. Looks like write operation took up the whole "channel" of the GV.

I am sure no error in my using of GV, since another button variable worked great in the GV.

BTW, looks like Datasocket works best for this from my running an example. Before I dig into datasocket, I just want to know whether using datasocket will not encounter depleting computer resources, or improve on this.

 

0 Kudos
Message 2 of 10
(3,959 Views)
The easiest way to do this is to use control references.  Data sockets will also work, but will be about ten times slower.  You can also use the plethora of reference objects available in LV, but I wouldn't bother for something this simple.  If you have problems getting the control reference value from one VI to the other, try named queues.  If you give the same name to two queues when you create them in two VIs, it is the same queue and you can easily use it to pass data between the VIs.
0 Kudos
Message 3 of 10
(3,947 Views)
But looks like control reference is just used for control the appearance of a front terminal, not for passing data to it.
 
An NI technician also said this in my support call.
0 Kudos
Message 4 of 10
(3,933 Views)
Nonsense. If you pass a reference of an indicator to a subVI, in the subVI you can write to it's value property.
Message 5 of 10
(3,929 Views)

here is an example (in LV7.0) of what Dennis is refering to.

 

P.M.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 6 of 10
(3,923 Views)

Hello Putnam,

Thank you very much!

One file is missing, I have problem in openning your attachment. COuld you please upload it again? Thanks a ton!

Dejun

Message Edited by Dejun on 11-10-2005 01:10 PM

0 Kudos
Message 7 of 10
(3,893 Views)
Just replace the "Untitled 2" VI in the main with CtrlRef (SubVI).
0 Kudos
Message 8 of 10
(3,888 Views)
Thanks, it works now, sub-vi can update displays in main-vi front panel now.
 
However, another problem. I also want another subvi to control display in mainvi frontpanel, but looks like this control reference only works for one subvi, since after I ever drag the control reference from main-vi block diagram to the front panel of subvi-1, I can not do this again for another subvi2, even though I also tried to generate another conference in the main-vi. 
0 Kudos
Message 9 of 10
(3,843 Views)
Hi Dejun
 
I don't think I understand what you described in your last post.  If you can recreate the issue with the example code attached in the thread (which I did look at to try to understand your last question), I'll be happy to help!
 
Regards,
AG
0 Kudos
Message 10 of 10
(3,811 Views)