LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Difficulties plotting from a text file

Solved!
Go to solution

Hey folks, I am having difficulties plotting some data points from a text file, when I try plotting them myself in labview I get a graph that is frequency v.s. data points(16000) and that is not what I am hoping for, I am looking to plot magnitude(y) v.s. frequency(x).

If someone could help me out that would be greatly appreciated.

I have attached the file I wish to plot as well as what the plot should look like once you plot it.

Download All
0 Kudos
Message 1 of 7
(2,270 Views)

So the plot is backwards?  Can you post your code?

 

Matt

0 Kudos
Message 2 of 7
(2,260 Views)

OOpps i misread it

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 7
(2,249 Views)

You probably only need to re-scale your X-Axis to your frequency units.  Since it appears the frequency data is evenly spaced every data point is equal to 1062500 HZ.  Just right click on the graph and adjust the multiplier property.  You can, of course, read in both columns and make an XY graph as well.  Look at some of the shipping examples:  Help > Find Examples > Building User Interfaces > Displaying Data > Charts and Graphs.

 

If you have trouble post your code...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 4 of 7
(2,237 Views)

Yes, thanks for the quick reply!

I did the program on a stand alone that has labview, this network computer does not have labview let me know if you are able to read the file

Download All
0 Kudos
Message 5 of 7
(2,234 Views)
Solution
Accepted by topic author ztjackson

If you're going to send a 2D array to a waveform graph (it expects a constant time between samples - dt) then you get multiple plots.  One for each 1D array.  You can either scale your x-axis or use an XY graph.  The XY Graph is more useful in applications where the dt of the waveform is not constant but it can be used here.

XY Graph.png

I used Index Array to get freq and amp, then bundled them for display in the XY Graph.  

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 6 of 7
(2,201 Views)

Thanks Niquist your response worked!

Thank you to oeveryone else as well!

0 Kudos
Message 7 of 7
(2,175 Views)