FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

cFP-2020 error using Write to Spreadsheet File.vi

Solved!
Go to solution

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

0 Kudos
Message 1 of 11
(8,822 Views)

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.

0 Kudos
Message 2 of 11
(8,814 Views)

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.

 

cFPError.jpg

0 Kudos
Message 3 of 11
(8,803 Views)

FilterGeek,

 

Post a sample vi.  I'll test it on my cFP-2020.

0 Kudos
Message 4 of 11
(8,799 Views)

cFPError1.jpg

 

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

0 Kudos
Message 5 of 11
(8,796 Views)

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

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 6 of 11
(8,787 Views)
Now it gets really wierd.  I have a cFP-2020 (that we use to develop on) and the above code runs perfect on that unit.  We installed a cFP-2220 on our test equipment and on this 2220 the above code gives me the Error 1430 I posted above.  Exact same vi deployed on a 2020 and a 2220 and it works on one, but not the other...  I am really confused now...
0 Kudos
Message 7 of 11
(8,774 Views)

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. 

0 Kudos
Message 8 of 11
(8,769 Views)
Solution
Accepted by FilterGeek

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.

 

Justin Parker
National Instruments
Product Support Engineer
Message 9 of 11
(8,767 Views)
That was it.  I changed it to use the build path shown in the link and it works on both systems now...THANK YOU!!!
0 Kudos
Message 10 of 11
(8,754 Views)