LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform graphs not autoscaling in X

Hello, I have an annoying problem in drawing data with waveform graphs (LV2011).

I will put it in a short statement: I need to compel graphs to properly rescale on the X scale.

Now the details:

I need to show data acquired during a given "event", updating a graph every second. I don't know how long the event will last, but I prefer not to set the X-axis as autoscaled because I don't like the axis rescaling effect. So I initally set the graph as fixed (ScaleFit=0) to a reasonable width in abscissa. When the acquisition ends, I want to show all the data maximized on the available control width, so I set the X axis scaling property to 2. Unfortunately, the graph is often not rescaled. I also tried leaving ScaleFit to 0 and setting the Range:Maximum to the proper value or using the ForceRedraw method, to no avail.

Do you know any trick to compel the X axis to be rescaled?

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 1 of 7
(2,539 Views)

Hi panter,

 

did you try to rewrite the data after setting the graph to autoscale"?

Best regards,
GerdW


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

No, but it seems a good suggestion. I will give it a try.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 7
(2,530 Views)

No, GerdW, it doesn't work Smiley Sad

I tried also with ScaleFit=1 (Autoscale once now) and with more complicated pattern (for example reinit to default, then autoscale, then rewrite data). No success.

In all cases, it mainly works (but not always) when I run the program in the LV environment. The very opposite when I deal with an executable.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 7
(2,519 Views)

Hi panter,

 

I only had issues like yours when the EXE was very busy and CPU consuming. Is this the case in your application?

Best regards,
GerdW


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

Thank you GerdW for your help. CPU utilization is below 1%.

I will use autoscaling all the time. I don't like the way the graph is compressed during acquisition, but at least there is no risk to miss visualization of some data when the event is especially long.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 6 of 7
(2,513 Views)

Shame on me! It turned out it was a typical race condition, where a LV2 global may be used before being initialized, depending on the program timing details.

Hence, the graph references array was sometimes empty.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 7 of 7
(2,506 Views)