07-05-2006 12:51 PM
07-05-2006 03:53 PM
07-05-2006 04:19 PM
07-06-2006 08:13 AM
07-06-2006
10:33 AM
- last edited on
06-19-2026
08:13 AM
by
Content Cleaner
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
07-06-2006 10:42 AM
07-06-2006 02:54 PM
Hi Jarrod,
Thanks for the help! You're right, I dont get that Error 4 message anymore! ![]()
I have some more questions. When I save the measurements to a file on my VI, my vi then outputs what I saved on the spectrum analyzer. But when i save it again, the display doesn't change at all. I know that there are noticeable miniscule changes on the spectrum analyzer as it runs in real time, but the display on my VI doesn't change at all. Also, when I open the destination file that I saved the plot to (after clicking "save" numerous times when the vi was running to double check if the display changed at all), I get a long list of measurements and apparently, everytime i click save, the measurements were appended to the end of the file. This is weird because I already told the "Write to Measurement File.vi" to overwrite file if a file name already exists. There isn't any append to file setting for "Read from Measurement File.vi." Do you know what could be wrong?
Also, the display from the saved file seems like it's been offsetted to the right compared to the display of that from the "dump" function. Could it be possible that the "Write to Measurement File.vi" starts the x-axis from 0? I've included a picture of this occurrence and my vi.
Thanks Jarrod for the help!
- Sammy
07-06-2006 03:06 PM
07-07-2006 12:01 PM
Hi Lynn,
I don't see the reset parameter on the Read Measurement vi. Do you mean overwrite samples parameter?
Thanks,
Sammy
07-07-2006 12:07 PM
Hi Lynn,
Nevermind! I know what you mean now. Haha..Thanks!! The display from the file is changing everytime I press save now. Although the offset still occurs. I'm not sure what's happening there. Could you help me out on that issue too?
Thank you so much,
Sammy