LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform Chart

Solved!
Go to solution

Hi, I am having some trouble getting my waveform chart to plot data while the programme is running, the signal only appears once the code has stopped running. Can anyone advise on this? I've attached the code.

0 Kudos
Message 1 of 15
(2,544 Views)

Hi ehalpin,

 

the chart gets new data with each iteration of the while loop.

But it doesn't make (absolutely NO) sense to clear the chart history in each iteration!

 

Did you read the caveats on the event structure? (I guess no: please do so…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 15
(2,528 Views)

Hi thanks for a quick response! 

 

If i don't include clearing the chart in each iteration, it does display the signal while the code is running but I then have no control over when it stops running.

0 Kudos
Message 3 of 15
(2,518 Views)

Hi ehalpin,

 

If i don't include clearing the chart in each iteration, it does display the signal while the code is running

So that was your problem - it is solved now.

 

but I then have no control over when it stops running.

That doesn't make any sense: moving that property node out of the loop will not change the behaviour of the event case or while loop!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(2,509 Views)

This is what's confusing me! Without the clearing inside the loop, the chart runs up to the thousands very quickly, when I only need it to run for t=100. 

 

I have made a lot of codes like this but have never had this problem before.

0 Kudos
Message 5 of 15
(2,492 Views)

Hi ehalpin,

 

Without the clearing inside the loop, the chart runs up to the thousands very quickly, when I only need it to run for t=100.

Because you programmed it this way!

You create your own buffer array in the shift - and then send the whole buffer to the chart:

In the first iteration the buffer contains 1 row of data, the chart shows one row of data.

In the 2nd iteration the buffer contains 2 rows of data, the chart shows 1+2=3 rows of data.

After 10 iterations the chart already shows 55 rows…

 

As said before: everything works exactly as you programmed it!

 

Two options:

  1. Use a graph instead of a chart.
  2. Wire the new data directly to the chart.
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 15
(2,483 Views)

I see what you mean for where I've gone wrong, I just don't know how to fix it so that it does what I need. Do you have any advice for that?

0 Kudos
Message 7 of 15
(2,476 Views)

Hi eahlpin,

 

use one of the two options suggested before…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 15
(2,468 Views)

You need to read up on the differences between a graph and a chart. GerdW already gave you the solution. 

 


 

Two options:

  1. Use a graph instead of a chart.
  2. Wire the new data directly to the chart.

 

0 Kudos
Message 9 of 15
(2,458 Views)

Sorry didn't notice that part of the message!

 

I've tried using a graph already and it doesn't work with the code. I've just wired the data straight to the chart but that also doesn't work.

 

I appreciate all the help but it won't work.

0 Kudos
Message 10 of 15
(2,452 Views)