07-13-2017 01:32 AM
Hi all.
I am plotting very small relative pressure changes on a waveform graph and want a fixed range Y axis (say plus or minus 50). However, the measurements are affected by atmospheric pressure so the absolute level changes from day to day, one day it could be that the axis needs to be 100 to 200, the next day it might be 600 to 700.
In this example, I don't want an axis that goes from 0 to 800, you wouldn't see the small relative measurements. Nor do I want an autoscaling Y axis that jumps about and fills the screen with signal.
What I would like to do is to adapt the scale so that it is, say, 50 above and 50 below the mean of the signal over a short period. The operator could adjust the scale manually but I would like to do it programmatically.
I have tried to simulate the sort of signal in the enclosed vi. The actual code needs the hardware to produce anything.
Thanks for any help.
Andrew
Solved! Go to Solution.
07-13-2017 02:09 AM
07-13-2017 04:24 AM
Thanks for that. I don't know why I didn't think of it. I've tried it and it works nicely, by averaging the dataset that I'm plotting. I just want to set the scale when the vi is run for the first time but it is adapting with each dataset coming in. I suppose I could set a one time flag and put the bit of code in a case loop?
07-13-2017 04:30 AM
07-13-2017 08:33 AM
@ASH2020 wrote:
I suppose I could set a one time flag and put the bit of code in a case loop?
You might want to add a button to rescale the axis on demand as well. So it would be First Call? OR Rescale to do the analysis and set the scale.
07-13-2017 04:29 PM
@crossrulz wrote:
@ASH2020 wrote:
I suppose I could set a one time flag and put the bit of code in a case loop?
You might want to add a button to rescale the axis on demand as well. So it would be First Call? OR Rescale to do the analysis and set the scale.
That's a great idea. I will do a button. Thanks.
07-13-2017 04:31 PM