LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

wrong time results in wrong frequency

Hello
 
Sorry I take your time. for my project I am using hot wire anemometer for
measuring velocity fluctuations, I have used the attached Labview
program. I have saved the data in a Labview measurment file (and I
am sure that the time is real time I mean the time saved in that file
is correct and real time)
but when I used read from labview measurment file the time axis is
not right so I got funny frequency by using FFT.( fo example I saved the data
for about 15 Sec but after using read from measurment file the x-axis
is from 0 to 125!!!!!)
 
I have attached thoes programs and output from program
 
thanks ever so much for your help.
Kia
 
 
0 Kudos
Message 1 of 9
(3,813 Views)
If you look at your measurement file, you have lost the X0 and dX values (X0=0, dX=1), so this is why you get the X axis going to 125 when you  read the file back in.

Looking at your code, I believe the error is in youre wire vi here (see the red box):




You may not be able to see it, but there is a coercion dot where you wire the waveform into the Y input.  This strips the waveform of all information except for the Y values, including your X0 and dX values.

My first question is do you need to replace the time value to begin with?  I do not have a DAQ card to test, so you may not even need to do what you are doing in the red box.  Assumign you do, then you need to do one of two things.  You have an array of waveforms coming out of your mean/RMS VI.  If there is more than one element in the array, then do the following:




If you only have one element in the array, then you can do the following:




As I said, I do not have a DAQ card available to me to see exactly what your data looks like.  If you make these changes and they do not work, post the new measurement files.  Or, perhaps someone with access to a DAQ card will chime in.


Message Edited by Matthew Kelton on 12-21-2007 02:00 AM
Download All
Message 2 of 9
(3,795 Views)
Hello,
 
Thanks ever so much for your kind help.
I have tried thoes ways that you have suggested, but I still have the
same problem. I just got data for about 15 Sec ( I have attached
the LVM output file) but when I am reading from that file the time
scale shows 4 ?!!!
 
PS. in the read file I have chosen "retrive segments of specified size"
becasue if I chose "retrive segments of original size" it won't show
me any thing.
 
anyhow thanks for you help.
Kind Regards
 
Kia
0 Kudos
Message 3 of 9
(3,782 Views)
The files are here
0 Kudos
Message 4 of 9
(3,781 Views)
I see that dX is not right, but cannot determine where the problem is.  My guess is that the coercion of signals to waveforms is doing it.

Can you run your wire.vi.  After it runs and you have plot data, can you select Edit->Make Selected Values Default and repost the wire.vi.  That way I should be able to look at the data flow without having the DAQ card.
0 Kudos
Message 5 of 9
(3,778 Views)
Thanks for your time.
I really appreciate that.
0 Kudos
Message 6 of 9
(3,772 Views)
The issue is that You are only writing one entry to the file per loop, so the dt value is pretty meaningless.  You can do something like this:



This will force your loop timing and then set the dt for the file to the dt of the loop.


Message Edited by Matthew Kelton on 12-24-2007 01:29 PM
0 Kudos
Message 7 of 9
(3,742 Views)
Thanks Matthew,
 
now the time is fine. I really appreciate your help.
but I have still problem with frequency I wanna
plot Power Spectral Density but nothing is
shown in the plot. I attached the reading file.
 
anyhow thanks ever so much for your help.
0 Kudos
Message 8 of 9
(3,731 Views)
The problems you've been running into mainly lie in the fact that the Measurement File VIs have some severe limitations.  This latest problem comes from the fact you are reading in more samples than you actually collect.  You've set the VI to read 1000 samples, so you get all these zeros which give you the PSD error.

If you modify the wire.vi to be similar to below, then you're sample numbers stored in the measurement file will be correct.  This works only in the case where you have one Y value (which is your case) or the dt in the waveform I use to get the Y values is the same as the dt I set (you don't have to worry about this).  The downside to this is if your VI were to crash while it is running, you lose all data, as it doesn't get saved until the end.



If you modify your read.vi to use the original sample size, you will not get all those zeros:




Message Edited by Matthew Kelton on 12-24-2007 04:43 PM
Download All
0 Kudos
Message 9 of 9
(3,727 Views)