01-18-2010 02:33 PM
System: cFP-2220 running LabVIEW 8.5
We are using the Write to Spreadsheet File.vi to log data onto our cFP and getting a very strange error. It will not accept the file name and gives us and error that the file name is empty or relative. The file name is built as "YYYY-MM LogFile.txt" and the actual value is "c:\2010-01_LogFile.txt". Thus, it is not relative and the correct name is fed to the vi. This vi is polymorphic and I am using 2D DBL data. I changed the data to text, but it did not help. In addition, I changed the filename/path to "c:\1.txt" in case it was a file name length issue. Nothing has worked.
Any and all suggestions and help is greatly appreciated...
Don
Solved! Go to Solution.
01-19-2010 06:37 AM
FilterGeek,
If memory serves you'll always get an error if you try to write a file to the root of a cFP. Create a sub-directory and try writing your log file there.
01-19-2010 10:43 AM
The root directory is not the issue. I tried adding a Sub Directory and it still gives me the same error. I have attached the error message I get. BTW if I am not connected to the cFP, the code works perfectly on the pc.
01-19-2010 10:53 AM
FilterGeek,
Post a sample vi. I'll test it on my cFP-2020.
01-19-2010 11:09 AM
I am new to this and could not figure out how to post a vi or use the Insert Code feature. However, It is a very simple vi so I just did a screen shot.
Thanks,
Don
01-19-2010 12:00 PM
The screenshot of the error message shows a forward slash / as part of the filename. Is that an illegal character for the file system?
-AK2DM
01-19-2010 01:02 PM
01-19-2010 01:22 PM
FilterGeek,
I've attached my recreation of your vi. It works just fine using LV 8.2 and cFP-2020. Try running this on your cFP. If it works, I suggest you look at your string constants and make sure you don't have any control characters hidden in any of them.
Attaching a vi is pretty simple. Click the Add Attachments link, browse to the file you wish to attach and press the 'open' button to finish your selection.
01-19-2010 01:24 PM
Hi FilterGeek
Your cFP-2020 and your cFP-2220 are actually running different operating system. The cFP-2020 is using Phar Lap and the cFP-2220 is using VxWorks.
The two operating system use different path conventions. Your specific issue is explained here.
Please let me know if you have any issues implementing the workaround that is listed in the article.
01-19-2010 01:45 PM