LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error 5 delete in save report

Hi,

 

i have a problem with a section of my code. Really hope someone can help!

 

When i have created my exe and its running, 50% of the time i get the attached error when i click "save,print".

 

I have it collecting the data from the array and front panel and placing it in a test certificate for our customers. It does this using RGT and opening an excel template, putting the data in, saving it under a different name (wired from its description) to keep in our records and then printing it and disposing of it.

 

It also uses the write to spreadsheet vi to save the raw data for me to look at later on. I don't want to have to collect the data from mutiple saved documents. I therefor have 3 files. The orignal excel template, the new named certificate containing the data, and a raw excel document with all of the results being built up day by day.

 

I have attached a few pictures of the vi for you to see what i'm doing. Sorry they are a bit messy, but its the best i can do.

 

One thing to note (which is where i think the problem may be), when i'm developing this and running the exe on my XP machine in the office i have NEVER had this error. I then installed it on a machine in the factory and the error occurred. The machine was running Vista (only spare pc we had).

 

I'm now due to roll this out on 4 new systems with Windows 7 and i need to solve this before i have 5 operators wanting my head!

 

Thanks all.

 

Graham.

 

Error.jpg

 

 

Download All
0 Kudos
Message 1 of 10
(2,665 Views)

Hi,

 

has any one any clues? Its driving me crazy!

 

G

0 Kudos
Message 2 of 10
(2,631 Views)

Hi Graham,

 

I am sorry to hear that you are experiencing some difficulties with your executable.

 

The error you are getting is not a very common one and hence I could not find a solution for now. It might be related to the LabVIEW version you are using. According to my research similar errors (with RGT) have been encountered with LaVIEW 8.6. Which version of LabVIEW are you using?

 

I will keep you updated if I find something useful.

 

Regards,

Shalini B
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 3 of 10
(2,597 Views)

Hi Shalini,

 

Thanks for getting back to me. I am using version 2010 SP1.

 

Its strange that it doesn't occur with XP. Only Vista. I have tried puting timers in there to see if that helps. I thought it might be the time it takes the printer to respond via the network compared to my pc having a printer linked directly but no luck.

 

My next step is to wire my code so the different sections execute at different times rather than all just doing what they do within the same case structure.

 

Any help would be appreciated.

 

BR

 

G

0 Kudos
Message 4 of 10
(2,593 Views)

Hi G,

 

Have you tried implementing a simple and smaller version of the code on the vista machine? You might want to check this to see if you get the same error. Sometimes it might be the way you implemented the code where your code is trying to open a file that might be already open somewhere else.

 

I have also found this: https://decibel.ni.com/content/docs/DOC-7212 which talks about ways to implement your code to avoid error 5.

 

But it still puzzling as to why it would work fine in XP and not Vista.

 

Regards,

Shalini B
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 5 of 10
(2,586 Views)

Hi,

 

yes i've been through that error handling vi. It just bugs me how i can test for weeks on my XP pc and then roll it out and have issues. It is not an overly complex vi, The other problem is that i'm saving a data file of the certificate as explained. When i get the error i get a file in my storage folder with the correct saved name etc but it contains no data. It also has no file extension.When the error doesn't occur the file saves as it should, an excel file.

0 Kudos
Message 6 of 10
(2,583 Views)

Hi,

 

last night i built some executables with a different vi removed each time. I built one with 'discard report' (picture 1 top right) removed and my error has disappeared. Unfortunately i now have lots of excel files left open which must be closed by the user.

 

Is this a timing issue or has anyone any other suggestions.

 

BR

 

Graham.

0 Kudos
Message 7 of 10
(2,567 Views)

Actually scrub that.

 

After 1 hour the error came back.

 

hmmmm

0 Kudos
Message 8 of 10
(2,559 Views)

Hi,

 

i've gone through the other exe i'd created and i seem to have no error when i remove the 'save report to file' vi. Problem is now i'm not backing up my reports! I am only printing a hard copy and i'd like to keep a soft one also.

 

So the current (with error) vi works like this.

 

1. Open template file,

2. Load data into template file.

3. Save template file as test certificate (customer name, date, time) as the file name.

4. Print  test certificate.

5. Discard file.

 

Is this correct? Isn't there then two files to discard after step 3?


I feel like i'm getting somewhere but not quite there yet!

0 Kudos
Message 9 of 10
(2,554 Views)

Hi

 

i've completed some more tests to see if i can find out what is going on.

 

I now have this installed on one of the new shiny windows 7 machines.

 

I still get the error BUT it only occurs the first time the sequence happens, ie the first time i load the exe and print save i get an error 5. the times after that i get no error.

 

Is this due to timing of excel opening, it takes longer the first time than it does the second and subseqent prints.

 

I've tried playing with timing but its not really helping if i'm honest. Its like something is opening on reference of the exe opening, and it isn't closed properly until the exe does it.

 

Any ideas?

0 Kudos
Message 10 of 10
(2,539 Views)