LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I change the X axis on an XY graph? Trying to plot Frequency vs Gain

Hey guys, I think this is a super simple problem but I am having great difficulty with it for some reason.

 

I have an input signal (which is 4-20mA) which I feed through a filter. I have an output signal which is in Volts. I want to find the frequency response and bode plot of this system. I change the frequency based on the loop iteration (I increase the frequency value each time).

 

I convert the input signal to corresponding volts (multiply by 250). I then calculate my gain (20*log*Vout/Vin). This gain is now in dB.

If I am correct, I should just be able to plot the gain vs the frequency but I am not sure how. Each time I try plotting, its always against time (rather than a logarithmic frequency scale)

 

can anybody help me with this? I have attached the VI below. To run it however you need the FPGA code (should I upload that too? This just creates the sweeping 4-20ma sine wave)

 

Thank you!

 

0 Kudos
Message 1 of 8
(3,423 Views)

Further, I just want to be able to plot the changing frequency with the Gain to get the plot. But I cant graph the frequency on the X axis and Gain on the Y axis. 

0 Kudos
Message 2 of 8
(3,422 Views)

Try the LabVIEW Help and search for XY Graph.

 

billede.png

0 Kudos
Message 3 of 8
(3,383 Views)

Thanks, I hadn't thought of that before.. Smiley LOL

 

Was the first thing I had done. I think part of my problem comes down to my timing and reading data sets, still looking.

0 Kudos
Message 4 of 8
(3,358 Views)

Which part of that help document discussed how to change their data to a logarithmic representation?  Finding "XY Graph" wasn't helpful here.

 

OP, I forget which graphs have the right-click property to view the axis logarithmic.  Take a look at a graph and the xy graph.  If you can't find it on either, I'll check when I'm by a PC with LV installed

0 Kudos
Message 5 of 8
(3,353 Views)

Remember that the word "time" is just the default label for the x-axis.  You can change it to whatever you want.

0 Kudos
Message 6 of 8
(3,345 Views)

Hi guys, just an updated. I was looking at the problem at an incorrect angle. I needed to sample the peak to peak voltages for both in and out (after sampling for X seconds) and then write both these arrays into an XY graph via bundling. I had it inherently wrong. 

 

The log scale is a property of the graph which you can get to by the front panel (right click)

0 Kudos
Message 7 of 8
(3,342 Views)

Hello Muri, 

can you share the vi with the sollution please because i have the same problem ! 

0 Kudos
Message 8 of 8
(3,304 Views)