FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading / Writing Files to the cRIO with C/C++

Hi, I'm trying to find a way to read / write basic text files to and from the cRIO using the Windriver Workbench and C/C++ (WPILib), can anyone tell me how?

EDIT: I'm also looking for extra functionality with File I/O such as checking to see if a file exists.

0 Kudos
Message 1 of 6
(6,945 Views)

Hi,

You should be able to read and write files using the standard file API in C (fopen, fread, fwrite, fclose, etc).


Regards,

Jeremy Billheimer
Applications Engineer
National Instruments

Regards,

Jeremy_B

Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(3,456 Views)

Thank you, I didn't know whether using those would work or not as I haven't been able to test with the cRIO because my team's final electrical board is in the making.

0 Kudos
Message 3 of 6
(3,456 Views)

I was thinking about using this for recording a round. I assume if we shut it off after the round the fiel is gone. Is that correct?

Can I get FTP access to the cRIO to get the file off?

Thanks

0 Kudos
Message 4 of 6
(3,456 Views)

When you write a file on the cRIO it's written to an internal flash drive, so you won't lose your data when you shut off power.  You can copy the file using FTP when you turn the robot on again later, just FTP to the cRIO's IP address.  By default there should be no password.

0 Kudos
Message 5 of 6
(3,456 Views)

Also,

Here's a document detailing FTP to the cRIO:

FTP File Transfer to cRIO (Using Image Processing Requiring Template Images)

Best Regards,

~Nate

NI FIRST Support

0 Kudos
Message 6 of 6
(3,456 Views)