LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can someone help me with waveform chart? How do I reset a signal on a waveform chart? Read description below.

I am displaying 4 signals on a waveform chart (see attached VI). My main goal is to reset "Data I" signal when I press “RESET DATA I” button on the front panel. I couldn’t find the right property node that would help me reset a signal. I know how to reset all signals at the same time, but I am struggling with resetting individual ones. Everything I have tried does not seem to work. Can someone please help me?

So when I press Reset DATA I button, I would like to see "Data I" signal restart as shown below. Can someone please help me? I have attached my block diagram.

 

GRCK5000_1-1654514037272.png

Eventually I will do the same for all the other signals later on.

 

 

0 Kudos
Message 1 of 8
(1,474 Views)

Hi GRCK. 



It's not an elegant solution, but it's the best I could come up with while pretending to do my own work.  Using the same property as you did to initialize the chart, you can change all historical values to 0. However it won't remove the plot. 
By using a for loop you can iterate through the historic values of the chart, and replace the ones you need to replace. 

AndreasPalms_0-1654523015133.png
Hope it helps you progress. 

Kind regards 
Andreas

 

Kind regards
LabVIEW Fairy

cRIO Enthusiast
Please mark solutions when appropriate.
Unofficial Forum Rules and Guidelines
0 Kudos
Message 2 of 8
(1,449 Views)

Yes, I see what you are doing. I know this is hard. What you did, even though it's not the solution, kind of gave me an idea. I'm also working on it myself. 

Thanks Andreas!

0 Kudos
Message 3 of 8
(1,442 Views)

You again have a bewildering amount of local variables for no reason at all. none are needed!

You also have glaring race conditions, because A and B happen in parallel (picture). but the outcome critically depends on what happens first. Not predictable!

 

 

altenbach_0-1654532999702.png

 

 

Whatever you are doing has nothing to do with "reset" If you just want to set one if the signals to zero (zero is still data!), you can just do that. If you want to hide a section of the trace, write NaN instead. If you don't want to show one of the plots, you can use the plot visibility checkbox.

 

Explain exactly what you want to see if you press the reset button!

0 Kudos
Message 4 of 8
(1,424 Views)

Hi Mr. Altenbach,

I would like to see signal for Data I go start from x-axis = 0. This picture below sums up what I want to achieve when the button is pressed. So in brief I would like to restart the cycle for Data I

GRCK5000_0-1654551870635.png

 

 

0 Kudos
Message 5 of 8
(1,401 Views)

@GRCK5000 wrote:

I would like to see signal for Data I go start from x-axis = 0. This picture below sums up what I want to achieve when the button is pressed. So in brief I would like to restart the cycle for Data I

 


First you need to understand how charts work.

 

What you want does not work with charts because all plots share the same x-axis. For example, once you have acquired more data than the chart history, the very first x value can no longer be zero. and you cannot start one trace at zero and keep the others still going.

 

(You could jump through flaming hoops using waveform datatypes and multiple axes, but I strongly recommend to not do that. Just don't!)

 

How many points do you typically acquire before "resetting" (your definition of the term)? More than the chart history, less? Forever?

 

Why not just use a waveform graph (not chart!) and keep a 2D array in memory where you do whatever you want with the data!

 

0 Kudos
Message 6 of 8
(1,391 Views)

I have the feeling this has to be the hardest thing to accomplish using labview. Usually, I would get lots of people answer questions, but for this one, it's only two people. 😥

0 Kudos
Message 7 of 8
(1,361 Views)

Why would anyone else contribute if an obvious answer is already there?

Message 8 of 8
(1,343 Views)