LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

waveform chart value property - changing # of plots?

Hi,

I am trying to use a waveform chart to display either one or two curves, switchable at runtime.  In the attached VI, if I wire an array of two waveforms to the waveform chart value property it works fine.  But if instead I wire a single waveform it doesn't work.  How it doesn't work depends on how I wire it.  If I wire to a 'strict' waveform property then the wire is broken.  If I generalize the reference before writing to the value property then the it 'compiles' but when I run it nothing gets graphed.

In short, the chart seems to be fixed to a given number of plots at the first time data is sent into it, and from that time on there seems to be no way to reinitialize it to a different number of plots.  I've tried clearing the history, but that didn't do anything.

Is there something I'm missing?  Any reason you shouldn't be able to switch from one plot on a chart to two and back again as you wish?

Thanks,
Eric
Download All
0 Kudos
Message 1 of 4
(3,145 Views)
Is there any reason you are witing to a value property instead of the waveform graph terminal directly??
 
(Anyway, it seems that the value property does not autoadapt while wiring. Simply wire to the terminal and to the value property, then delete the wire to the terminal. The wire will remain unbroken. Still, it seems silly to wire to a value property. Why???)
 
In any case, You cannot switch between waveform and 1D array of waveforms at runtime anyway, but you have several options:
  1. Always graph both waveforms, but set one to transparent to hide it if desired.
  2. Insert a "built array" also in the single waveform. Now you can switch between two 1D arrays of waveforms, with either one or two elements. 😉
  3. etc...
Message 2 of 4
(3,142 Views)

Adding to Christian's comments...

The data type of the property node follows the terminal type, not the other way around.

Writting to the terminal is the prefered method because writting of the terminal can take advantage of optimization, while the "Value" property requires a thread swap to the UI thread.

On the other hand...

If you can spare the CPU to use the "Value" property and can tolerate the thread swapping, then the Value property can be used to update an indicator from a sub-VI.

You can see both methods being used in the attached VI.

Ben

Message Edited by Ben on 01-06-2007 12:32 PM

Message Edited by SarahM on 01-08-2007 12:22 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
0 Kudos
Message 3 of 4
(3,129 Views)
Thanks to both of you.  It didn't occur to me that the problem was simplythat I wasn't putting a build array in when I wanted a single waveform.  A simple solution!

To answer the question of why I'm doing it this way (in case another way would be better) I'm actually plotting to 8 different graphs, some of which will have one trace, others which will have 2, occasionally changing.  I wanted to push the handling of plotting into a subvi so figured if I build an array of references that I could just pass that into the subvi and then figure out what to plot and do the plotting inthere.  Everything is in an array so looping through the elements is straight forward.  Is there a lot of overhead associated with doing it this way?  I suppose that I could bring the data back into the main program and wire directly to 8 different charts (although not every chart receives new data every time, so I'd have to have some decisions made in the main program if I chose to go this way).  I'm only updating at 1 Hz.

Thanks again,
Eric

0 Kudos
Message 4 of 4
(3,118 Views)