02-14-2012 06:42 AM
I have tried to write an 2D matrix to file using the function "Write To Spreadsheet File VI" and gives me an error.
I have attached the simple code and the error (the function to write is inserted in a time looped file which is not visible in the print screen).
I don´t know if anyone is familiar to this error...!
Regards
José Pedro
02-14-2012 07:22 AM
This is a very common error. Have you verified the path is correct to your data file? Leave the fp window open to your VI when you run the main code and verify your path. At some point, LV cannot find the file your are intending to use, as the error implies.
02-14-2012 07:23 AM
My first thoughts would be to check the path is correct, I have recreated the error you are seeing from the screen shot by putting an incorrect string here, if this is not the problem would it be possible for you to post the time looped part as well.
Hope youo find the problem
TDarkins
02-14-2012 07:56 AM
I think the likely issue is that the path shown may be for a directory, rather than a file. You cannot write data to a directory.
02-14-2012 08:03 AM
if the all but the final name exist as a directory then LV creates a file called whatever the final name is but with no file extension, if the directory doesnt structure previous is wrong then error 7 occurs. using the problem : if the director c:\documents and settings\jpsousa\ambiente de trabalho\cenas exists then a file called ficheiro(with no extension) will be created. if the directory doesnt exist then error 7 will occur.
hope it helps,
02-14-2012 10:07 AM - edited 02-14-2012 10:10 AM
@Tdarkins wrote:
if the all but the final name exist as a directory then LV creates a file called whatever the final name is but with no file extension, if the directory doesnt structure previous is wrong then error 7 occurs. using the problem : if the director c:\documents and settings\jpsousa\ambiente de trabalho\cenas exists then a file called ficheiro(with no extension) will be created. if the directory doesnt exist then error 7 will occur.
hope it helps,
No, he is opening the file (if memory serves). If the input enum is set to replace or create, then it will create a new file, but not with "open."
Edit: Correction, you are correct. I forgot which VI he was using. Forget what I said (My memory wasn't serving me).
02-17-2012 01:01 PM
Thank you very much for your replies.
However, I have tried sereval times to write to an spreadsheet the matrix and nothing worked... It gave all the time these errors: 7 and 43.
I started to thought the problem was my pc. So, I made a simple VI, please look to the attached file, in which I save an empty matrix. The configurations are in the left and the error in the right.
I would ask if you can do this simple VI in your pc to figure what the problem is.
Thank you in advance.
Regards
José Pedro
02-18-2012 06:56 PM
If you wire an empty path into the Write to Spreadsheet File VI, then it will ask you where to save the file. You must have clicked Cancel on the dialog, and so you get error 43. That's by design.
As for error 7, as noted already, you need to verify the path is correct.
Also, you do not need to convert the array to matrices. You do not need to deal with matrices unless you are doing linear algebra. Are you? Just wire the array into the "1D array" input.
02-21-2012 07:56 AM
I think I know what the problem is, but I have got no solution for it
When I make a regular VI in my pc, I can the matrix to a spreadsheet with no problem. When I make the same program in real-time, occurs every time the error 43, even with the simplest program.
Can't we save data matrix in real-time VI's??