05-17-2012 09:59 AM
I am currently working with a very simple VI that consists of a dial connected to a plot with a relay between the two. The relay is controlled by a flip switch. The purpose of this setup is to have the plot display values from the dial only when the switch is on. However, when I run the VI with the switch on and begin to change the dial value, I notice that every time the y-axis of the plot is forced to autoscale, the data on the plot is cleared. When the autoscaling is complete, only the values measured after that point are shown on the plot.
How could I prevent the plot from being cleared every time an autoscale occurs?
Any help would be appreciated.
Solved! Go to Solution.
05-17-2012 10:51 AM
I forgot to add that I am using Labview 2011.
05-17-2012 01:11 PM
It shouldn't be doing that. Perhaps it is some way that the VI was programmed. Please attach your VI so we can look at it and see if anything in there explains it.
05-17-2012 01:12 PM
I'm guessing the output of a case structure where the tunnel is set to "use default if unwired", and the one case is ... unwired.
Who's with me?
05-17-2012 01:28 PM
Thanks for the responses everyone. However, the VI is as simple as what I'd described. There is no case structure or anything like that. The only elements present on the VI are the dial, the switch, the relay, and the plot all enclosed in a while loop. There's also a control for setting the loop repetition period but I've set that to 0 for the time being.
I've attached the VI below if that helps.
Thanks again for the help.
05-17-2012 01:41 PM
Well, you have a chart, and the update mode is set to "scope". The chart clears once it reaches the end of the X axis, regardless of whether the Y axis is autoscaling. That's how it's supposed to work. It's by design. It sounds to me like you want the update mode to be "strip". Please read the LabVIEW Help on charts.
05-17-2012 01:47 PM
Sorry, I attached the wrong version of the VI where I've deleted the relay. I've attached the correct one below. What I'm referring to occurs when you change the vertical scale of the plot. I understand that plot should clear once the limit of the horizontal scale is reached on a "scope" plot.
Thanks.
05-17-2012 02:14 PM
OK, I think I see what you are referring to. It appears to be a drawing issue when the loop rate is too fast and an apparently overagressing autoscaling algorithm. It appears to be related to timing, since if the loop rate is above 3 msec it seems to work fine. Lower than that, and you see the issue.
Other than having a slower loop rate or turning off autoscaling I'm not sure what else to indicate. NI will need to look at this and determine if it's a bug.
05-17-2012 02:36 PM
Actually, when I first looked at this I suspected it had to do with the chart buffer, but I wasn't testing it correctly, so it seemed as if the chart buffer wasn't the factor. I realized that my testing was wrong and see that it has to do with the size of the chart buffer. When you have the delay set to zero the chart buffer is simply filling up too fast and actually being overwritten too fast. If you increase the chart buffer to, say, 4096, then you will see the chart can keep up even with the delay set to 1 msec.
05-17-2012 03:06 PM
Ah ok, increasing the size of the chart buffer solved the problem. Thanks for your help.