LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

X-Axis Scaling

Hello,
 
I am using the "AI Acquire Waveform" VI to obtain an analog signal from the function generator of the NI ELVIS and a "Waveform Graph" VI to display it. When I run the VI, the x-axis goes from 0 to 0.1, so low-frequency signals can be displayed very well in this range. However, when I get a higher-frequency signal, say 100 kHz, I cannot even distinghuish the shape of the signal. I can manually change the scale to go from 0 to 0.00001 to show 1 period, but I would like to know if there is any way to auto adjust the x-axis depending on the frequency of the signal so that I can always see at most 1 or 2 periods on the graph. For example, if the frequency is 100 Hz, the x-axis should go from 0 to 0.01, if the frequency is 10 kHz, the x-axis should go from 0 to 0.0001, etc. I hope someone can help me. Thanks!!!
0 Kudos
Message 1 of 6
(3,029 Views)
You can set the x-axis range programmatically to anything you want via a property node. Just calculate the appropriate range according to your data.
0 Kudos
Message 2 of 6
(3,025 Views)
I attached a simple VI that uses a simulated signal. Could you please take a look at it and tell me where to add the property node. THANKS A LOT!!!
0 Kudos
Message 3 of 6
(3,016 Views)
Have a look at this:


Ton

Message Edited by TonP on 03-03-2007 01:38 PM

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 6
(3,006 Views)
Yes, that's about what I had in mind. 🙂
 
Make sure that you disable autoscaling on the x-axis so they don't constantly fight each other. Property nodes are relatively expensive operations so you should only rewrite it when the frequency input changes and not at each iteration of the loop.
 
Note also that you have the simulation set to run as fast as possible an you don't have any pacing delay in the loop. This is not reasonable. Either simulate acquisition timing or place a small delay inside the loop. 🙂
 
0 Kudos
Message 5 of 6
(2,997 Views)
Thank you so much for your help. It was exactly what I needed!!!
0 Kudos
Message 6 of 6
(2,974 Views)