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 5 occurred at Open/Create/Replace File in Write spreadsheet String.vi

Hi everyone,

can anyone help me with this problem?

 

"error 5 occurred at Open/Create/Replace File in Write spreadsheet String.vi "

 

I've been using this part of the program for over a year an suddenly this error occures. But not always, mainly at the very beginning of my tests when the file should not be open.

 

Info: I'm using a realtime PXI-System. Maybe the amount of data can cause the problem? (about 2MB)

 

Grüße

Meike

 

Download All
0 Kudos
Message 1 of 8
(4,435 Views)

Hallo Meike,

 

when you're using a realtime system you usually don't have access to your PCs harddrive!

 

Please check the path you write to file to!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(4,423 Views)

Hey Gerd,

 

Thanks for your quick answer.

 

Since I don't have access to my PC's hardware I save the data on the PXI-System and collect it via FTP afterwards.

 

Best regards

Meike

0 Kudos
Message 3 of 8
(4,412 Views)

Hi Meike,

 

is the file opened by a different program? Do you try to access it by FTP in parallel to your VI?

 

You could use basic file functions instead of WriteSpreadsheetFile. That way you could open the file before starting the loop, keep it open all the time and close it once you're finished - with the added benefit of easier error handling…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(4,406 Views)

Hey GerdW,

 

not, it's not accessed by FTP in parallel.

Is there a maximum of lines or colums you can write with Write Spreadsheet File ? Or maybe it takes too long and gets disturbed by the timed loop above? But still, there are greater files for which the function works fine.

 

Maybe I should try your idea of simple file-open-write-close programming. 😕 on monday then...

 

Have a great weekend!

Meike

0 Kudos
Message 5 of 8
(4,402 Views)

Hi Meike,

 

there is no timed loop in your picture…

 

Well, you might also think about using some producer-consumer scheme to de-couple DAQ from file writing…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(4,398 Views)

Hey GerdW,

 

Thank you very much for your help!

It's working now... and I didn't do anything in this code :-).

Seems like the spreadsheet function takes hours (well, not hours but more than 500ms?) to close the file again.

Now I wait for a second before reading the file and everything is fine.

 

Best regards
Meike

Message 7 of 8
(4,353 Views)

Can you share the reference where you have gone through?


As it is mention to use wait time untill it closes the reference.

im also facing such issue in the Application where im using the read Spreadsheet function in reentrant VI.

Regards,
Sathish Kumar A
Certified LabVIEW Architect (CLA)
0 Kudos
Message 8 of 8
(1,931 Views)