03-15-2012 07:30 AM
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
03-15-2012 07:36 AM - edited 03-15-2012 07:42 AM
HI,
It's difficult to know what your error is without an error code! (next time take a quick screenshot
)
-CC
03-15-2012 07:36 AM - edited 03-15-2012 07:37 AM
[edit: Duplicated post for some reason!
]
03-15-2012 07:38 AM
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.
03-15-2012 07:44 AM
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...
03-15-2012 08:34 AM
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.
03-15-2012 09:43 AM
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
03-15-2012 10:00 AM
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.
03-15-2012 10:04 AM - edited 03-15-2012 10:05 AM
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!
]
03-15-2012 10:09 AM
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.