LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ScaleFit

Hello, everyone, I have a piece of code in my while loop which handles the plot and writes to file. Can anyone tell what's the function of this code? Does it means every loop execution, it re-scale my waveform chart to have a one-hour interval for X-axis? Thank you.

Capture.JPG

0 Kudos
Message 1 of 7
(2,697 Views)

We cannot see what is in the other case, but the scale is only set if the case is TRUE. That happens if the current scalefit property is zero (i.e. do not autoscale) AND it was >0 (i.e. autoscale once or always) at the immediately previous iteration, OR if this is the first iteration (i=0). In all other cases, the FALSE case executes and all bets are off what's in it. 😄

0 Kudos
Message 2 of 7
(2,692 Views)

Thanks for the reply, it's empty in the false case. So, force the scale at 0-3600 at first iteration, does it necessary for the chart if in the chart properties I already uncheck autoscale and set the scale 0-3600? Thank you.

0 Kudos
Message 3 of 7
(2,683 Views)

You never said that this is a chart.

 

If this is a chart, it might be easier to set the history length to 1 hour worth of data and set t0 at program start. Now everything will be mostly automatic. It is difficult to give more specific advice from a truncated code picture. Is the user allowed to zoom the x-axis at run time?

0 Kudos
Message 4 of 7
(2,679 Views)

Sorry I forgot to mention that. It's a waveform chart, X-scale is absolute time, I need one-hour window but large chart history buffer in order to view historical data with x scroller bar. No zoom x-axis at runtime. Thank you.

0 Kudos
Message 5 of 7
(2,664 Views)

So what is the update rate and the size of the history buffer?

 

0 Kudos
Message 6 of 7
(2,662 Views)

The update rate is 1Hz, I set a 12-hour buffer which 43,200, can be reduced if it dramatically slows down the program. 

0 Kudos
Message 7 of 7
(2,657 Views)