LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

YScale of Waveform Chart Max and Min values keeps changing

Solved!
Go to solution

Hi,

 

I have attached a simple array of values which is plotted over time. In the original project the values change but here it is constant. So here it is an array of 84 values all values are 3.615 and I want to plot how each value changes over time, so created a 2d array out of it and gave it to the waveform chart. And it is correctly plotting all values. But the problem is the range. So before plotting each loop, I set the YScale. Maximum to 4.16 and YScale.Minimum to 3. And when I ran the program, YScale kept changing between 4.16 and 4 for maximum and similarily for minimum. So i ran the program in highlight execution mode and I saw what happens, so intially when I set the max and min YScale values, you can see those values are also set in the chart, but then the actual array values come in to the waveform chart automatically the max and min changes. Why is this happening and how do I correct it, thank you. I have also attached the screenshot below.  

govindsankar_0-1712734651807.png

 

0 Kudos
Message 1 of 5
(192 Views)

Hi govindsankar,

 


@govindsankar wrote:

I have attached a simple array of values which is plotted over time. In the original project the values change but here it is constant. So here it is an array of 84 values all values are 3.615 and I want to plot how each value changes over time, so created a 2d array out of it and gave it to the waveform chart. And it is correctly plotting all values. But the problem is the range.


Unfortunately the "subarray" control is empty as you forgot to set some default values. (You should have learned this in all the time you ask questions in the forum!)

What's the point of the FOR loop in your VI? (You don't need it…)

And please don't maximize all windows to fullscreen! (You also should have learned this, too.)

 


@govindsankar wrote:

So i ran the program in highlight execution mode and I saw what happens, so intially when I set the max and min YScale values, you can see those values are also set in the chart, but then the actual array values come in to the waveform chart automatically the max and min changes.

Why is this happening and how do I correct it, thank you.


The chart does what you configured to do: the Y scale is set to "autoscale" with "loose fit" enabled…

Best regards,
GerdW


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

I forgot to set the default values. Its not something I need to learn. I have attached again and changed it from control to constant, so now you have the values available. The for loop is not important. I just copy and pasted it from the original program where the array is a set of readings coming in which is in mV and I need to change it to V. So ignore that. 

And what do you mean by autoscale. Is this a new feature. I use labview 2016 and there I dont see an option to turn on and off autoscale, only set the autoscale delay. 

govindsankar_0-1712735985005.png

 

0 Kudos
Message 3 of 5
(171 Views)
Solution
Accepted by topic author govindsankar

Wire 0 to the the ScaleFit property to turn off autoscale.

 

See here: https://forums.ni.com/t5/LabVIEW/auto-scale-property-node/td-p/748805

 

Scale Fit Property
Short Name: ScaleFit

Requires: Base Development System

Class: GraphScale Properties

To Use: Create a property.

Fits the scale to data.

This property applies only to the active X-scale or active Y-scale.

This property is similar to the AutoScale items on the shortcut menu of an x- or y-scale and to the Autoscale checkbox on the Scales page of the Properties dialog box.

Values
0 Do not autoscale
1 Autoscale once now
2 Autoscale

Message 4 of 5
(161 Views)

Hi govindsankar,

 


@govindsankar wrote:

And what do you mean by autoscale. Is this a new feature. I use labview 2016 and there I dont see an option to turn on and off autoscale, only set the autoscale delay. 


Right-click the waveform chart on the frontpanel -> Y scale -> AutoScale/LooseFit menu items.

(Has been there as long as I use LabVIEW…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(143 Views)