LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

charting data in another VI

Dear Labview forum,

I have two VIs running simultaneously, each acquiring or producing data at their own rate and charting that data.
I would like a 3rd VI to run simultaneously with the other two and display a selection of charts from each of the other two VIs in real time.

Any suggestions how this might be achieved?  I have looked at queuing and notifier examples, which both seem to be able to be used?  Though I'm not sure which would be better.  Also, I've seen another example where a reference to a chart of the 3rd display VI is stored as a global variable, and the other VIs use that chart reference to change the chart history.  Are there any drawbacks with this approach?

What if I would like a fourth VI to chart the same data too?

Regards,
Jamie



Using Labview version 8.0
0 Kudos
Message 1 of 5
(3,127 Views)

Hey,

Just use queues! The other mentioned methods are not realy appropriate to transfer measurement data between VIs.

 

Christian

0 Kudos
Message 2 of 5
(3,117 Views)

Hi Jamie,

      Couple of questions, are the front-panels visible of the two VIs producing the data?  When you say  "a selection of charts from each of the other two VIs " this seems to imply that there's more than one chart on each of the two VIs producing the data(?)  I don't know if the Sub-Panel control might have an application here - it depends on the specifics of your app.

Writing the data straight to the chart, via reference sounds like a nice solution as it avoids the CPU/memory overhead of passing data around, and avoids the queue-related syntax on the diagram. (Not that queues are bad, but the question is, what's appropriate in this situation)  If you use the chart-reference technique, consider passing the references "formally" as parameters.  References are "static" values - the value of a reference doesn't change (can't change).  Using Globals to share static values is, in my opinion, poor programming style.  Some people would argue that any use of Globals is poor-style.  Anyway, Globals tend to make programs harder to debug.

It's possible that Notifiers could be applied here - for instance, if replacing an FP-indicator's contents rapidly.  GUI updates faster than about 10Hz become a blur anyway.  But if you're logging/recording the data at the destination, then sending by Notifier is a a bad choice - since Notifiers don't buffer data (but queues do!).  Too-rapid writes to a Notifier result in lost data.

Cheers!



Message Edited by tbd on 01-16-2008 03:46 AM
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 3 of 5
(3,107 Views)
Hi,

I'll give queues a go.

Regarding tdb's questions,


@tbd wrote:

      Couple of questions, are the front-panels visible of the two VIs producing the data?  When you say  "a selection of charts from each of the other two VIs " this seems to imply that there's more than one chart on each of the two VIs producing the data(?)  I don't know if the Sub-Panel control might have an application here - it depends on the specifics of your app.


The front panels of the two VIs producing data won't be visible (mostly). I still need to work out how to dynamically program whether they pop up when called as I would like the user to have that option?

One VI acquires data which it charts.
The second VI analyses the data, and charts several progress parameters, producing about 3 charts plus 1 updating picture (of which only the last copy is relevant (the picture is a phasor plot because Labview has no standard phasor plotting capabilities, like matlab's compass function)).  Perhaps I will try to combine these in an array or cluster and then queue the whole cluster instead of using 3 or 4 separate queues?
The third VI, which is a user interface, should display the data as acquired, plus the updating analysis charts (and picture).

I haven't used sub panels before, but I think they display the sub VIs whole front panel?  So I won't be able to display just a selection.  Though I guess hiding parameters and other controls and indicators could be an option?


Jamie
Using Labview version 8.0
0 Kudos
Message 4 of 5
(3,087 Views)


@Jamieg wrote:
Hi,

I'll give queues a go.

Regarding tdb's questions,


@tbd wrote:

      Couple of questions, are the front-panels visible of the two VIs producing the data?  When you say  "a selection of charts from each of the other two VIs " this seems to imply that there's more than one chart on each of the two VIs producing the data(?)  I don't know if the Sub-Panel control might have an application here - it depends on the specifics of your app.


The front panels of the two VIs producing data won't be visible (mostly). I still need to work out how to dynamically program whether they pop up when called as I would like the user to have that option?

To programmatically pop-up the FP of a VI, set its FP.Open property to True.  This can be done anywhere in the application, as long as the VI's reference is available (sounds like an application for a Global Smiley Wink ).  There's a "feature" related to FP.Open and compiled apps - do you plan to compile this?
 

One VI acquires data which it charts.
The second VI analyses the data, and charts several progress parameters, producing about 3 charts plus 1 updating picture (of which only the last copy is relevant (the picture is a phasor plot because Labview has no standard phasor plotting capabilities, like matlab's compass function)).  Perhaps I will try to combine these in an array or cluster and then queue the whole cluster instead of using 3 or 4 separate queues?

The third VI, which is a user interface, should display the data as acquired, plus the updating analysis charts (and picture).

I'm still trying to imagine the GUI layout on "The third VI", the chart "use case" - one at a time, floating chart-windows (sound intruiging? check-out the "floating" window behaviour/property), dedicated sections on the GUI - , though it sounds like you're comfortable with a queue solution so maybe the physical layout is irrelevant here/now.
 

I haven't used sub panels before, but I think they display the sub VIs whole front panel?  So I won't be able to display just a selection.  Though I guess hiding parameters and other controls and indicators could be an option?

What you see in the Sub-panel is exactly what's visible if the VI is opened (at least in LV8.2).  So just like with other top-level GUIs, if you position controls out-of-sight when the VI is open, they won't be visible in the Sub-panel either!
 

Cheers!
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 5 of 5
(3,073 Views)