LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why nothing is displayed in FFT graph?

I have LabView 7.1, Windows XP, PCI-6052E, and a SC-2345 module. For some time now I've been trying to display the FFT in the graphs from the attached application but all my trials lead to nothing. I'm really mad...
Here are the steps I am taking when I am analyzing a saved file (in binary format):
The "Read and Analyze SubVIs.vi" reads data (for example the BinaryFile.dta attached), then when you press 'Return' you are sent in the "Analyze & Present Data.vi" which is providing results for selected intervals from graphs. While everything is displayed correctly, in the FFT graph there is nothing displayed. I do not understand why. I tried different connections and I tried running the "Analyze & Present Data.vi" without the while loop and the other 'fancy' buttons but I still got nothing in the FFTs.
It is really frustrating and at this point any suggestion would be of some help.

Thank you.
RPJ
0 Kudos
Message 1 of 16
(3,948 Views)
You're not getting an FFT because you don't have any time information in the signal. It's being lost during your read VI. Append Waveforms takes dt from Waveform A and Waveform B and compares them and makes sure that they're equal. If not, then it generates a warning. The help says that it will generate an error but all I could see was the warning. I think this is the cause of setting dt to 0 in your waveforms. You've a general error handler in the Read but this won't do anything with a warning. I don't know if one or all of the records in the dat file have different dt records. You might have to go through one by one to find out.
Message 2 of 16
(3,941 Views)
Thank you Dennis.
I noted that something is wrong with the dt...I just did not know this could be because of the Append Waveforms.
You are saying "You might have to go through one by one to find out" - How do I do this?
Is there a way to read the binary file such that I can avoid this dt problem?
(I am actually saving data from 7 channels in a binary file in a while loop. If I could do this using a labview measurement file it would probably help me get rid of the 'reading' problem? However, I tried using a LabView measurement file in the while loop but unsuccessfully...I do not know how to make it work without creating and closing the file with each while loop iteration.)

I am grateful for opening my eyes on the problem.
Anybody sees a solution?

Thank you.
0 Kudos
Message 3 of 16
(3,937 Views)
I looked at your program a little more and determined the actual cause. The data in your files is correct. It is the initialization of the shift registers. You have an empty Y array in them but the dt is 0. Append Waveform uses the dt in the first waveform to set dt for all appended waveforms. You could put the actual dt in the empty waveforms that you use to initialize the shift registers. If the dt might be different at some point, read one record and get dt from that. Then use Build Waveform with that dt and an empty Y array that you would wire to all of the shift register inputs.
0 Kudos
Message 4 of 16
(3,932 Views)
Dennis,

I'm pretty sure you got things right but your suggestions are a little too much for me unfortunately...
I don't know how to put the actual dt in the empty waveforms. You are saying "If the dt might be different at some point, read one record and get dt from that. Then use Build Waveform with that dt and an empty Y array that you would wire to all of the shift register inputs." At this point I'm kind of lost unless you send me some kind of example. I hate being so close to a solution and not knowing how to implement it.

I start writing all 7 channels of data to the file in the same moment, so I suppose the dt should be the same for all waveforms? Would this dt be a problem later when I am selecting only certain intervals from the saved data to be analyzed?
How about if I am appending to the already saved data, the new 'section' would have a different dt? (for example I start the test and then I record data for a while, I stop data writing but I do not close the file; whenever I see an event of interest I start writing data again to the same file and so on).
0 Kudos
Message 5 of 16
(3,927 Views)
Here's what I mean. I just did a single read and extracted the first waveform. I then used The Build Waveform function with an empty Y array. I also modified a single waveform on the front panel with the actual dt. You could also use this constant wired to the shift registers. You only need a single constant for all shift registers since they're all being initialized the same.
0 Kudos
Message 6 of 16
(3,924 Views)
OK, it is getting clearer...
Problem is now I am getting an EOF error at the 'read file' from the outside of the 'for loop':
Error 4 occurred at Read File in ATP Read.vi,
LabVIEW: End of file encountered.
---
NI-488: Invalid argument or arguments.

Any solution to that?
0 Kudos
Message 7 of 16
(3,919 Views)
Sorry about that. I didn't rerun the VI after making the changes. Right click on the pos mode input of the Read File inside the for loop and select Create Constant. Make sure the constant is "Start". I thinks that's all you need to start the read from the beginning. My Read outside the for loop put the current file position at the end of file.
0 Kudos
Message 8 of 16
(3,915 Views)
Good Morning!

Dennis,

The read file works now...but I do not see the right data in the graphs! It is like every time I open a file I get a very similar thing. It is like only a small portion of data is displayed from the beginning of the file. I could not figure out why this is happening; I attached for you the new vis and a binary file for exemplification. From the binary file I should read some variations for the forces but...
Could you have a closer look?

Thank you.
0 Kudos
Message 9 of 16
(3,901 Views)
It looks like I realy messed you up. Sorry. I guess I've been working too many weekends. Lets try this again. What I should have done is set the offset with a shift register and not the pos mode.
Message 10 of 16
(3,884 Views)