Go to Post It's in the RUMOR MILL section, hence it is a RUMOR. Personally I find it entertaining to see what gets started in this particular forum section and have people go off the deep end. - Gary Dillard [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 Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 02-05-2010, 07:26 AM
SteveGarward's Avatar
SteveGarward SteveGarward is offline
Red 5, standing by...
AKA: 7 years already
FRC #0111 (WildStang), FRC #3132 (Thunder Down Under)
Team Role: Mentor
 
Join Date: Dec 2009
Rookie Year: 2010
Location: Gurnee, IL
Posts: 173
SteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud of
Team 3132 - Sample code for writing to a file on the cRIO

There's been a couple of threads about trying to write to a file on the cRIO (including one of my own), and even a request to see how we get it to work.

The code isn't heavily commented, but hopefully you can see what it's doing, as there's not much there.

So, here is code for writing to a log file on the cRIO, courtesy of Team 3132 - The Thunder Down under.

If you add the attached files to your code, you can then call it as follows:
* Get the logger instance through a call such as this..
Logger* logger = Logger::GetInstance();
* Add logging statements to your code as follows:
if (logger->IsLogging())
{
logger->Log(Logger::kINFO, "Bruce has initialised");
}
* The call to IsLogging() is optional, but is a hangover from my day job programming Java, where string creation is (used to be) expensive. Either way, if you have a large amount of code in your debugging, in order to calculate valued to log, but only at certain times, then best to surround it in a similar check so it's not calculated, but then never used.

When your code has finished, you can FTP to your cRIO (10.xx.yy.2) as anonymous (empty username and password) and download the file to your computer to read and analyse.

Standard disclaimers: I wrote it from scratch so I can distribute it, it's provided as is, I can't support you all, try it out if you like, don't blame me if it doesn't work for you, results may vary, handwash only, shrinkage may occur.

Hope this helps some of you.
Attached Files
File Type: h Logger.h (605 Bytes, 61 views)
File Type: cpp Logger.cpp (2.5 KB, 85 views)
__________________
FRC Team 111 - WildStang (Mentor, Drive Coach)
FTC Team 7458 - Full Force! (Mentor, Coach)
FRC Team 3132 - Australia's FIRST FRC Team! (Holy crazy first year, Batman!)

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Data File Writing ... cRIO vs. Driver Station Ziaholic NI LabVIEW 3 01-31-2010 03:20 PM
Where do I download the 2010 sample vision code? CollinRyans Programming 3 01-28-2010 09:42 PM
"Battery: No Code" after uploading .out file to cRIO knine143 FRC Control System 1 12-20-2008 10:14 PM
Getting the .hex code file only for a given function visent Programming 0 02-14-2008 07:06 AM
Reading binary data from a file and writing it in VB complete Programming 1 01-02-2006 09:21 PM


All times are GMT -5. The time now is 09:28 AM.

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