LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT SAVE and X-axis update issues

Solved!
Go to solution

Hi all,

 

 I created the following VI and have a couple of problems I cannot understand.  The first of which is that the save and open or read and write files are working, but I have to stop the VI operation and then choose save or read and then start the VI again for the program to recognize a change in state.  Although the buttons are in my main while loop.

 

 Also,  I have used a button ( FFT. time) to change the X.axis of the FFT graph however it gives me a data at end of file error is it is used when opening a file.  Undernormal operations, i.e. connected to a scope signal it works well, but only the error is data is read from file, the button does not work.  IS there an issue of using a command like this when reading from a file. 

 

Please have a look-

 

 

 

true.JPGfalse.JPG

                  

0 Kudos
Message 1 of 9
(3,912 Views)
The inability to select anything is because you have that second while loop. While that loop is running, nothing else can. Get rid of that and see if this other error goes away.
0 Kudos
Message 2 of 9
(3,905 Views)
OK, I changed the while loop to a case with the same button as activation.  However, I still get the error end of file with version 8.5.  I found a like about the same problem with the user having an older version.  IS there still a bug with using the express VI for read data to file?  Do you know a way to eliminate the end of file error?
0 Kudos
Message 3 of 9
(3,897 Views)
I don't use Express VIs so I'm not sure what your problem could be. Why don't you attach the file?
0 Kudos
Message 4 of 9
(3,893 Views)

Sorry lost the link but this was the previos answer to the same problem..

 Looks like this might be your answer. It appears to be a limitation in the Express VI itself that won't allow multiple read accesses after the end of the file has been reached (even if new data is appended).

I do have a workaround, however, that isn't listed in the KnowledgeBase listed above that should only take a couple seconds to implement. The reason this error is occuring is that this VI "remembers" that it has already run before and encountered the EOF. It does this by setting internal flags. My trick will be to wipe the VIs memory after every time it runs. You might want to try this on a backup copy of your VI first. Here's how:

First, we will need to convert the Read from Measurement File Express VI into a normal VI. You can do this by right clicking the VI and selecting Open Front Panel. A dialog will ask you if you want to convert. Select Yes. Your Express VI has now been turned into a normal VI whose parameters you set are hard-coded into the VI. In other words, you won't be able to use the configuration dialog to change any more settings at this point.

Save your new VI with whatever name you choose. Now that the Express VI is a normal VI, we can change the way a VI is loaded into memory as a subVI (this is a NEW feature in LabVIEW 8, and one of the really cool ones). Right click the new VI and select Call Setup. It will bring up a dialog asking you how you want to load the subVI. "With Callers" just means a completely normal subVI. We want the option called "Reload for each call". This means that every time the VI is called, it is loaded into memory, and then unloaded from memory when it is finished executing. This, in effect, wipes the VI's memory after every call. Check out the modified VI I created below. After taking these steps, there is no more Error 4 when calling this VI in a loop. Hope this helps!
Message Edited by Jarrod S. on 07-06-2006 10:36 AM
 
Jarrod S.
National Instruments

 

0 Kudos
Message 5 of 9
(3,891 Views)

Here is my final VI.  Is it easier to do this without express VI.  The problem is that I have a german software version I have to complete this on and I am using 8.5.1

0 Kudos
Message 6 of 9
(3,886 Views)
That is much different than what you originally posted and the data that you are saving does not make any sense. What you are writing to file is just the channel number and not the acquisition. Since you are acquiring a waveform data type, you could try using the Export Waveforms to Spreadsheet File.
0 Kudos
Message 7 of 9
(3,866 Views)

I believe I have the right signal now for saving.  That was a mistake, grabbed the wrong value.  However, the end of file problem is now solved.  I have to connect the end of file to stop the loop in the True state of the read file.  Changes of working VI are attached.

 

However, one last question if you could.  When I create an exe. will I loose the Run button or arrow that is usually used, and if so how do I run the exe.  Will toggling the stop button on the loop serve as the run/stop button or does the VI automatically start.

 

 

 

0 Kudos
Message 8 of 9
(3,857 Views)
Solution
Accepted by topic author begovatp
When you build an exe, the default setting is to run when opened. You would need to change the VI Properties>Window Appearance to remove the tool bar. I would recomend that you do this.
0 Kudos
Message 9 of 9
(3,850 Views)