LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot Data Cleared On Autoscale

Solved!
Go to solution

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.

0 Kudos
Message 1 of 10
(2,457 Views)

I forgot to add that I am using Labview 2011.

0 Kudos
Message 2 of 10
(2,450 Views)

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.

0 Kudos
Message 3 of 10
(2,443 Views)

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?

0 Kudos
Message 4 of 10
(2,441 Views)

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.

0 Kudos
Message 5 of 10
(2,439 Views)

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.

0 Kudos
Message 6 of 10
(2,435 Views)

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.

0 Kudos
Message 7 of 10
(2,433 Views)

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.

0 Kudos
Message 8 of 10
(2,425 Views)
Solution
Accepted by topic author Griffon2-6

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.

Message 9 of 10
(2,422 Views)

Ah ok, increasing the size of the chart buffer solved the problem. Thanks for your help.

0 Kudos
Message 10 of 10
(2,414 Views)