LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving test results for retrieval later.

I have a program that works for testing semiconductors using GPIB control of some HP equipment. The problem is that although it looks like it saves properly (lets me choose directory and name the file), I cannot retrieve any files. When I try to retrieve, the program automatically brings up the last test saved. I am using Open/Create/Replace File, Write File, Close File and Read File. I have an event structure loop that has the options: Run Test, Save Test, Recall Data and Quit. As soon as I hit the recall button the last test saved appears on my graph and output array indicator, then the window comes up asking me for file name etc. I am using LabVIEW 7.0. Any ideas?
0 Kudos
Message 1 of 7
(3,363 Views)

Hi,

From what you say it looks like the issue is with the order in which the tasks are being accomplished.

Are you closing the file refnum after you are done saving?

You may want to make a simpler version of your VI (with dummy input data) that still exhibits this problem and post it here for us to take a look.

Regards,

Khalid


0 Kudos
Message 2 of 7
(3,363 Views)
Hello,
I've attached an example VI that I think shows what you are trying to do. The file refnum is opened and closed in both Save Test and in Recall Data events.
I hope this is what you were looking for.
Zvezdana S.
0 Kudos
Message 3 of 7
(3,363 Views)
I believe I am closing the refnum by using the FileClose VI. I have attached a simpler version of my program that is doing the same thing. I used local variables to create the data types for saving and recalling the files. Do I need to add the file extension when I name the file I am saving? Thank you for looking at this.
0 Kudos
Message 4 of 7
(3,363 Views)
Hi Zvezdana,
This file showed me a few tricks, but I do not want the shared information appened to the end of only one file. I require a separate file for each test run I save. Will I still need to use shift registers for this?
thanks,
BC
0 Kudos
Message 5 of 7
(3,363 Views)

HI BCLioness,

I see the problem in your VI. In the "retrieve data" event, where you use the Read File function, you are not taking the 'data' output and unbundling it. Instead, you are unbundling the local variable which is giving you stale data. You should use the 'data' output.

As a side note, for the File Read's 'byte stream type' input, you do not have to wire the local vairable directly. You can, but it's better to create a constant for your datatype (right-click on your local variable and create constant)and wire this to the byte stream type input. The byte stream type input is only looking for the type of the data, not the actual data. Hope I am not confusing you here.

Regards,

Khalid

0 Kudos
Message 6 of 7
(3,363 Views)
Thank you so VERY much Khalid, this has been plaguing me for a few days now. I was hoping it was something rather simple and I won't let this trip me up again down the road.
Thanks everyone for your input.

BC
0 Kudos
Message 7 of 7
(3,363 Views)