Saving Text to a File on cRIO

Does anyone know how to do it? The labview sample isn’t working for me, and mine doesn’t work either, Google just turns up getting started with labview pdfs from FRIST that don’t explain this. Here is what I have right now.
http://img521.imageshack.us/img521/5453/37611495.png
“test” and “text” are both files I created on the cRIO. The “text” one is the example with a constant file path instead of the default variable one. The “test” version was the one I made. They both have the extension .txt and I’ve tried with and without the extension in the file path.
Thanks in advance,
Steven

I use c: est.txt for the path.

I put a copy of each at C:\ on my computer, it didn’t write to it. Our cRIO’s directory is just / so “text.txt” would be /text.txt not C: ext.txt, at least I think so :confused:

Here’s an example of creating/opening/saving a file on the PC side.

I want to double check the cRIO version, because I haven’t done it in awhile.
The file path is the only tricky part. Try out Joe’s suggestion.

ASCII_data-file.jpg


ASCII_data-file.jpg

When the robot program runs and sees c:\ it puts on the root directory of the cRIO, not your computer.

Joe is right and if you want to get the file from the cRIO you will have to use FTP to get it from the cRIO to your computer.

Another option is to send the data with the dash board data and capture it there.

Omar

Ok I checked the cRIO again and pointing labview to C:\ did work. Thanks guys! I got the spreadsheet writer working, but only a one column deal, does anyone know how to get it into two columns?

Write a CSV text file. Excel can open that directly if you associate the file extension.

**

I can get what I’m writing into Excel just fine, but I can only write one variable to the file. For example one potentiometer is at 70 the other at 450, I can only write the 70 or the 450 not both with a comma or some such thing in between. Currently I get it to write one number per line for example:
70
71
72
70
65
68
So that is keeping track of one potentiometer. I want both in one like this:
70,450
71,451
72,452
70,450
65,445
68,468
That would be potentiometer1,potentiometer2. Hope that helps, here is what I have right now.
http://img513.imageshack.us/img513/7631/20825737.png

I’m not a LabVIEW guru so I can only speculate:

Does LabVIEW have a function analogous to printf? If so use that to write both variables in one operation to one line in the file.

or…

Does the LabVIEW file output function you are using have an option to allow you to suppress the newline? If so, write the first variable without the newline, write the comma without the newline, and finally write the second variable with the newline.

**

I got it working, hers a picture of how. Thanks for the help guys.
http://img62.imageshack.us/img62/3792/74601792.png

Indeed it does. It’s the Format Into String function.