Go to Post You won't find anything in school that says you have to share ideas or strategy with your football rivals. - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 10 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 28-02-2011, 17:03
Carmello Carmello is offline
Registered User
no team
 
Join Date: Jan 2010
Location: Connecticut
Posts: 5
Carmello is an unknown quantity at this point
help with file I/O on Crio ... unable to read file when fopen fails

Hi

We have an Iterative robot working using the WPIlib in C++ and would like to store floating point values to the cRio for later use. We created a test program that reads and writes a file in windows using standard fopen\fscanf\fprintf\fclose and then ported it to the cRIO.

We've successfully copied a test.txt to the file system using FTP but the fopen for the read routine is failing.

We've tried "c:\\", " /test.txt" or the "file://" and "text.txt" but none have worked. We found a post that mentioned something about a SetFileWriteAllowed but not sure if that is required for reading. I've searched the other forums with some success but haven't found a working sample using the WPIlib. Let me know and I can post the actual code but here is the idea:


//sample ...

FILE *pFile = fopen("text.txt", "rt");


if(pFile == NULL )
{printf("failed to open"); return false;}

fscanf(pFile,"Offset=%f",&floatTest);


//and later we have something similar in order to write using fprintf
fprintf(pOutFile,"\nLabel_1=%d",floatTest);

Any ideas would be appreciated.
Thanks
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 17:45.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi