LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clearing Waveform Chart History Data with Button

Solved!
Go to solution

I'm trying to create a "Clear Chart" button that will allow the user to manually clear a waveform chart's History Data, and I've found a solution here in the forums that uses an Event Structure to pass an empty array to the chart's History Data property. This has worked for me in another VI application, but now it seems to be breaking my VI when implemented.

 

I am sampling 2 external analog signals in the while loop where I'm looking at displaying their waveforms via Waveform Graphs and attempting to plot their RMS (individually and combined) with a Waveform Chart. I'd like the user to be able to clear the chart if it gets too busy. So, adding the Event Structure, I placed inside a boolean button, a property node referenced to the Waveform Chart, and an empty array (created by right-clicking the property node and selecting "Create Constant"). This was placed in the event that the "clear chart" button's value changed. However, after adding this, now no signals are displayed on any of the graphs or charts.

 

If I delete the Event Structure along with all of its contents, the signals are displayed correctly again. This is strange behavior to me, and I suspect that I am missing a glaring error in my diagram. Any suggestions would be greatly appreciated!

 

I'd also like to ask if there is a better way to combine my three RMS values to send to the Waveform Chart to display. I found the Merge Signals function in the Express VIs tab, and I know that there is always the "stop using express VIs" statements by the pros here, but I can't seem to google-fu a better method than Merge Signals. I just can't figure out another way to combine those three values for display.

 

Thanks in advance!

Download All
0 Kudos
Message 1 of 4
(1,124 Views)
Solution
Accepted by curiositas

Your event structure has no timeout wired, meaning the timeout is infinite and since the event structure cannot complete, the loop cannot go to the next iteration (dataflow principle!). Use a simple case structure instead of an event structure.

 

To combine the three scalars into three traces of the chart, use a bundle node. (after that, you need to chage the input of the history node to the new datatype.

 

I recommend going back to the tutorials!

Message 2 of 4
(1,109 Views)

@altenbach wrote:

I recommend going back to the tutorials!


A few more comments:

 

  • Please don't maximize front panel and diagram window to the screen. Very annoying. (At your point of learning, you should be able to look at both AND the help window at the same time!)
  • A sequence structure is required to define execution order, but that's pointless for analysis where execution order is completely irrelevant! 2 x10ms waits in successive frames just add up to 20ms. Delete the sequence.
  • Why do you index out the two channels twice? Once is enough!
  • To get the channels in sequence, there is no need to wire the indices of index array.
  • etc...
  • etc.

 

Here's how it could look like:

 

altenbach_0-1637948286649.png

 

Message 3 of 4
(1,101 Views)

@altenbach wrote:

@altenbach wrote:

I recommend going back to the tutorials!


A few more comments:

 

  • Please don't maximize front panel and diagram window to the screen. Very annoying. (At your point of learning, you should be able to look at both AND the help window at the same time!)
  • A sequence structure is required to define execution order, but that's irrelevant for analysis where execution order is completely irrelevant! 2 x10ms waits in successive frames just add up to 20ms. Delete the sequence.
  • Why do you index out the two channels twice? Once is enough!

Thank you for your comments, and your solution to my issue was very helpful. Thank you.

 

In case anyone else stumbles upon this thread and wonders why I was using the sequence structure, I wanted to answer your question on that one. For my purposes, I ultimately need the VI to sample data from only a single input signal at a time. This was the best way that I was able to make that happen so far. The sequence structure was set up to perform both the timing of the while loop, and the interval at which it sampled each signal.

 

Other suggestions are always appreciated! Thanks again!

0 Kudos
Message 4 of 4
(988 Views)