From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 97 labview

Hello partners.

I wanted to ask you a favor, I am doing a project, in which I am communicating with a PLC, the project visualizes the temperature data in different points, and saves them from time to time in an Excel file, the drawback is that I already execute it, and after a certain time, it may be about 15 minutes that is already working, I get ERROR 97, I do not know if someone has an idea why?

Screenshot_1.pngScreenshot_2.png

0 Kudos
Message 1 of 7
(2,515 Views)

My feeling is: If this is running in a loop, this might be the problem. if you call that many times per second, you might have a race condition between the last file saved and the new one you want to modify.

Move that to a lower priority loop.

Benoit

Message 2 of 7
(2,509 Views)

Everything is in a while loop, but the problem of saving is not every second it does every 5 minutes.

By saying move to a lower priority loop ?? I do not understand this well?

0 Kudos
Message 3 of 7
(2,504 Views)

Well, You do have an error during the save report.

I suggest then to isolate the report generation VI and try them alone. Do a simple validation with those.

You will see where it comes from.

Benoit

0 Kudos
Message 4 of 7
(2,484 Views)

The error occurs with Excel Insert Table.  I cannot easily see this in the limited picture you attached.  Please attach the VI (and possibly other VIs, if necessary -- if this is in a LabVIEW Project, you can compress the Project Folder and attach the resulting .zip file).  You are doing something wrong, can't properly see it yet ...

 

Bob Schor

0 Kudos
Message 5 of 7
(2,448 Views)

Hello friend, I attached the file VI in mention, the truth I still try to see my error, but I do not know where it is xD.

0 Kudos
Message 6 of 7
(2,437 Views)

Well, by looking at your code, I think I see the error.  In a single While Loop, you are attempting to write 8 Reports using Microsoft Excel at the same time.  That means you Open Excel, then you Open Excel, then you Create Easy Table, then you Open Excel, then you Do Something Else, then you Open Excel, then you Create Easy Table, ...

 

It would surprise me greatly if you can instantiate 8 simultaneous invocations of Excel and have LabVIEW and Office and Windows be happy about this.  Try serializing things -- run a single Error Line through the 8 different reports, so that you Open Excel, create Report 1, save Report 1, dispose Report (and thereby Close Excel), then repeat for Reports 2 through 8.  A word of caution -- I'd put a delay of maybe half a second between one Dispose Report and the next New Report.  I recall needing to do this when closing and then opening an Excel Report.  I don't remember the value I used, nor the LabVIEW Version I was running at the time (you seem to be running LabVIEW 2012, which sounds around the Version where I noticed the need for such a delay).

 

As another test, try removing seven of the Reports from this routine (so that you only write one) -- does it work OK?  [I'm betting the answer will be "Yes"].

 

Bob Schor

0 Kudos
Message 7 of 7
(2,424 Views)