11-04-2013 04:05 AM - edited 11-04-2013 04:26 AM
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?
11-04-2013 04:08 AM
11-04-2013 04:13 AM
No, but it seems a good suggestion. I will give it a try.
11-04-2013 04:54 AM
No, GerdW, it doesn't work
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.
11-04-2013 05:01 AM
11-04-2013 05:13 AM
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.
11-04-2013 05:54 AM
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.