07-01-2011 09:00 AM
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.
07-04-2011 10:22 AM
Hi,
has any one any clues? Its driving me crazy!
G
07-05-2011 08:59 AM
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,
07-05-2011 09:07 AM
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
07-05-2011 09:24 AM
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,
07-05-2011 09:38 AM
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.
07-06-2011 02:42 AM
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.
07-06-2011 03:13 AM
Actually scrub that.
After 1 hour the error came back.
hmmmm
07-06-2011 04:41 AM
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!
07-08-2011 06:29 AM
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?