From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-09-2011 07:32 AM
Hi experts,
I've a problem with the YScale.ScaleFit property of WaveformGraphs. My VI is attached.
The idea is using a checkbox (Full Range) on the GUI front panel to control Y-axis Autoscale. When the checkbox is off, autoscale is disabled and custom scale values are set. When the checkbox is on, autoscale is re-enabled. This is where the VI doesn't work: autoscale is re-enabled only for some of the graphs in the GUI. The VI gets the references of these graphs as an array of strict references. I tried to force a redraw but it doesn't help at all. Interestingly, the drop down menu that I get by right clicking on the graph, has the correct Autoscale setting! So I don't see why soem graphs get stucked...
I'm using LV2010 on Windows 7.
Thanks,
Dan
10-09-2011 09:52 AM
Update: I noticed that, after YScale.ScaleFit has been set to 2, I can "unfreeze" the graph just by manually changing a value on the Y scale.
So, I modified my code like this: before setting YScale.ScaleFit to 2 I put another property node, that sets Y.Maximum to 2 (could be any other number). This way the code works, but that's weird. Why does the graph gets stuck and needs a kick to get back to normality?
10-11-2011 12:11 PM
Hello dany1,
I am not pretty sure I understand your question. As you can see in the help context, by choosing between values 0,1,2 as inputs in the property node , you achieve 3 different things.
0 is for Do not Autoscale
1 is for Autoscale once
2 is for Autoscale
This means that when you give 2 as an input in the property node, the scaling will change automatically depending on the amplitude. If 0, the scaling will remain the same.
In the attached file I changed a bit your .vi. It works fine I think.
10-11-2011 12:57 PM
Antonios,
thanks for your response and the attached file. I red the help context before posting, and it was pretty clear. Unfortunately, the function works only with the workaround that I explained. I tried to turn the workaround off, and the previous behavior re-appeared.
When I disable autoscale, I change the Y-Scale values right away. Could it be that this operation prevents in some way the re-activation of autoscaling?
The thing that puzzles me most, is that the problem happens only for some of the 16 graphs I have on the FP! Considering I use a For Loop, and the code it's always the same, I see no reason for this.
Best,
Dan
10-11-2011 01:24 PM
Can you attach a full demo code that shows the problem? How are you calling this subVI? Why are you closing the references?
10-11-2011 02:19 PM
In the code you supplied the array you used to set the Y scale is empty. The for loop will not execute, you must have as many values in this array as you have in your reference array. If your code only works for some of the graphs but not all it suggests that the sizes of the two arrays don't match.
Ian
10-11-2011 03:05 PM
Hi Ian,
the array is actually made of 16 global variables (I should change that I know). So the size is not a problem: I checked that the loop runs for 16 iterations.
Altenbach: I'll try to reproduce the thing and post it.
10-19-2011 03:42 PM
Hi everybody,
I have an update, though I haven't been able to put together a demo that shows the problem.
I generated an array that collects all the event types that occur during execution of my sub-VI. I found that, when I zoom into the graph, the Scale Range Change Event gets triggered twice (in a row). When I autoscale the plot, I get 2 Autoscale Range Change Events and then 2 Scale Range Change Event. This way, autoscale is disabled again, immediately. I'm adding a workaround to avoid this.
What is the reason for this? Maybe I get one event for Y.Maximum change and one for Y.Minimum change?