cancel
Showing results for 
Search instead for 
Did you mean: 

Saving file error

Bombbooo
Active Participant

Saving file error

Message contains an attachment

Hello I got a problem with saving file. After I run the program, I try to open the file I want to save in but there is an error about "format file" or something like that. I am not pretty sure what is wrong exactly. Could you please take a look at my programming and define where the errors are?

 

Thanks

16 REPLIES 16
ChrissyC
Active Participant

Re: Saving file error

HI,

 

It's difficult to know what your error is without an error code! (next time take a quick screenshot Smiley Wink)

 

-CC 

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


ChrissyC
Active Participant

Re: Saving file error

[edit: Duplicated post for some reason! Smiley Frustrated]

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


Pladio
Member

Re: Saving file error

Like Chrissy said, take a screenshot or copy the text, it would help.

 

Also, I would help more, but I can't open the VI. I'm using version 9. If you can save it in version 9 I can have a look at the VI.

GerdW
Knight of NI

Re: Saving file error

Hi Bombbooo,

 

well, you could also check the error numbers. The error indicator will also explain them - just right-click it...

 

One guess: You explicitely "open" a file. When the file does not exist you will get an error...

 

- You don't need to open the file every iteration.

- You don't need to close the file every iteration.

- You don't need an additional wait statement in the file saving loop.

- You could clean up your code even more as shwon in your older thread...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Highlighted
P@Anand
Trusted Enthusiast

Re: Saving file error

I just want to make one point clear are you trying to open the file in LabVIEW or manual. In your code I dont see any file extension that may create a file which windows will not be able to findout. Please clarify these points then we can come to a solution and find out where the exact issue is.

-----

The best solution is the one you find it by yourself
Bombbooo
Active Participant

Re: Saving file error

I want to open the file in excel. I already put the excel file that I created into the file path. but there was the error. I can only open it in Notepad.  You can try to put into youe excel file.

 

Thanks

Dennis_Knutson
Knight of NI

Re: Saving file error

You are not actually creating an excel file no matter what file extension you give it. Excel can open certain types of text files. The Write to Spreadsheet function creates value delimited files that Excel can open. You can use that or fix your program to add a delimiter between the timestamp and the first value.

ChrissyC
Active Participant

Re: Saving file error

Ahh right, you can't simply select an excel file as the one to write to. There are ways to write excel files (Report generation toolkit etc.), but not with the VI's you're using.

 

Your best bet is to use the Write to Spreadsheet VI and then open that file using Excel.

 

-CC 

 

[Edit: Grrr! - getting that cup of tea let Dennis beat me to answer! Smiley Very Happy

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


Bombbooo
Active Participant

Re: Saving file error

But with the spreadsheet file, I can't add any more information like date and time, the name of the channel,...etc. There is no input to add these things on the spreadsheet function.