Go to Post I am a FRC Coach/Mentor I don't know the meaning of the words "days off" or "rest". At least not from January to May. - Bob Steele [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

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-10-2009, 03:07 PM
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Data logging to internal memory

This is probably going to be a stupid simple answer, but I am away from the cRIO at the moment and won't be back to it until tomorrow; bear with me.

How would I go about writing a small text file for logging purposes on the cRIO inside WindRiver? Can I just use fstream to write a file? Is there any provision inside WPILib that I should be using instead?

Jacob
__________________
Aren't signatures a bit outdated?
Reply With Quote
  #2   Spotlight this post!  
Unread 02-10-2009, 04:35 PM
Redneck's Avatar
Redneck Redneck is offline
Hacker Hick
AKA: Jamie (2.0) Moran
FRC #0599 (Robodox)
Team Role: Engineer
 
Join Date: Aug 2004
Rookie Year: 2004
Location: California
Posts: 90
Redneck is just really niceRedneck is just really niceRedneck is just really niceRedneck is just really nice
Send a message via AIM to Redneck
Re: Data logging to internal memory

You should be able to just write a file to the cRIO using a regular fstream and retrieve it later via FTP.
__________________


Which badges can you claim?
Reply With Quote
  #3   Spotlight this post!  
Unread 02-10-2009, 06:51 PM
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: Data logging to internal memory

I created a class that provides as a wrapper to the standard C file i/o functions. I'll post it later tonight.
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 02-10-2009, 07:06 PM
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Data logging to internal memory

Quote:
Originally Posted by Redneck View Post
You should be able to just write a file to the cRIO using a regular fstream and retrieve it later via FTP.
Whoa! I didn't know the cRIO has an FTP server! I assume it is on port 21 like a normal FTP server? I guess I'm not reading the right documents...

Quote:
Originally Posted by slavik262 View Post
I created a class that provides as a wrapper to the standard C file i/o functions. I'll post it later tonight.
I would definitely be interested in having a peek; this could save me some time coding a similar structure for myself.

Thanks all,
Jacob
__________________
Aren't signatures a bit outdated?
Reply With Quote
  #5   Spotlight this post!  
Unread 02-10-2009, 11:02 PM
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: Data logging to internal memory

I've attached my class. I need to get some sleep right now, so I apologize for not providing full documentation, but the header file is commented well enough that you should get an idea of how it works fairly easily. The only note I'd like to make is that the read and write functions take pointers to the variables you are reading/writing to. Also, you can use the generic read/write functions to write c-style strings (char arrays). For the pointer to the data, provide the name of the array, dataItemSize should be sizeof(char), and itemCount should be however many characters you want to write. I apologize for lacking full string implementation. I plan on creating a WriteString function that takes a pointer to a null-terminated string later.

I hope this helps you out.

EDIT: I just noticed I left some typedefs and a definition in the header file that I needed when I tested this in Visual C++. Feel free to remove lines 6, 11, and 12 (the _CRT_SECURE_NO_WARNINGS #define and the typedefs).
Attached Files
File Type: cpp FileStream.cpp (3.1 KB, 57 views)
File Type: h FileStream.h (2.4 KB, 49 views)
__________________

Last edited by slavik262 : 02-10-2009 at 11:07 PM.
Reply With Quote
  #6   Spotlight this post!  
Unread 02-12-2009, 07:41 AM
Chief Pride's Avatar
Chief Pride Chief Pride is offline
<3
AKA: James Kiefer
no team
 
Join Date: Sep 2007
Rookie Year: 2007
Location: Kalamazoo, MI
Posts: 653
Chief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond repute
Re: Data logging to internal memory

Would it be possible to write to a USB stick in the drivers station with something like this?
Reply With Quote
  #7   Spotlight this post!  
Unread 02-12-2009, 09:16 AM
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Data logging to internal memory

Quote:
Originally Posted by Chief Pride View Post
Would it be possible to write to a USB stick in the drivers station with something like this?
I am 99.9% sure that the DS ports only will handle HID devices--joysticks and the like. It may be possible to do something like this with a custom circuit, but really I don't think it's worth it. I will just FTP into the cRIO to get the log file.

Though that idea is very cool...

Jacob
__________________
Aren't signatures a bit outdated?
Reply With Quote
  #8   Spotlight this post!  
Unread 02-12-2009, 09:30 AM
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 321
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Data logging to internal memory

Quote:
Originally Posted by JBotAlan View Post
I am 99.9% sure that the DS ports only will handle HID devices--joysticks and the like. It may be possible to do something like this with a custom circuit, but really I don't think it's worth it. I will just FTP into the cRIO to get the log file.

Though that idea is very cool...

Jacob
Well you do use a thumb drive to update the driver station, so the possibility of somthing like that getting implemented may not be far off.

Quote:
Originally Posted by slavik262 View Post
I've attached my class. I need to get some sleep right now, so I apologize for not providing full documentation, but the header file is commented well enough that you should get an idea of how it works fairly easily. The only note I'd like to make is that the read and write functions take pointers to the variables you are reading/writing to. Also, you can use the generic read/write functions to write c-style strings (char arrays). For the pointer to the data, provide the name of the array, dataItemSize should be sizeof(char), and itemCount should be however many characters you want to write. I apologize for lacking full string implementation. I plan on creating a WriteString function that takes a pointer to a null-terminated string later.

I hope this helps you out.

EDIT: I just noticed I left some typedefs and a definition in the header file that I needed when I tested this in Visual C++. Feel free to remove lines 6, 11, and 12 (the _CRT_SECURE_NO_WARNINGS #define and the typedefs).
Can't you just use ofstream?
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -

Last edited by wt200999 : 02-12-2009 at 09:39 AM.
Reply With Quote
  #9   Spotlight this post!  
Unread 02-12-2009, 06:34 PM
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: Data logging to internal memory

Quote:
Originally Posted by wt200999 View Post
Can't you just use ofstream?
Yes, I could. I just prefer the C libraries to the C++ std namespace for certain things.
__________________
Reply With Quote
  #10   Spotlight this post!  
Unread 02-12-2009, 09:37 AM
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Data logging to internal memory

Quote:
Originally Posted by Chief Pride View Post
Would it be possible to write to a USB stick in the drivers station with something like this?
That sounds like a cool feature to add to the 2010 wishlist.
Reply With Quote
  #11   Spotlight this post!  
Unread 02-12-2009, 01:23 PM
Chief Pride's Avatar
Chief Pride Chief Pride is offline
<3
AKA: James Kiefer
no team
 
Join Date: Sep 2007
Rookie Year: 2007
Location: Kalamazoo, MI
Posts: 653
Chief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond repute
Re: Data logging to internal memory

Well, I was thinking because the cRio already saves the images from the camera when processing, it would be cool to save them to the thumbdrive, then write a simple program to arrange the images in order and play them as a video after your match.
Reply With Quote
  #12   Spotlight this post!  
Unread 02-12-2009, 11:00 PM
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 321
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Data logging to internal memory

Quote:
Originally Posted by Chief Pride View Post
Well, I was thinking because the cRio already saves the images from the camera when processing, it would be cool to save them to the thumbdrive, then write a simple program to arrange the images in order and play them as a video after your match.
If I am not mistaken I did see some functions to save as AVI in the nivision.h...
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
Reply With Quote
  #13   Spotlight this post!  
Unread 02-12-2009, 11:28 PM
xtreampb's Avatar
xtreampb xtreampb is offline
Lead Programmer 2642
FRC #2642 (Pitt Pirates)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Snow Hill
Posts: 21
xtreampb is an unknown quantity at this point
Send a message via AIM to xtreampb Send a message via Yahoo to xtreampb
Re: Data logging to internal memory

well how much memory does the cRIO have??? My team would be sending snapshots to our laptop so the driver could tell where he is going but we have to limit our packet size so :/
__________________
~Xtreampb~

Pitt Pirates 2642

Lead Programmer
Reply With Quote
  #14   Spotlight this post!  
Unread 02-13-2009, 12:04 AM
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 321
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Data logging to internal memory

Quote:
Originally Posted by xtreampb View Post
well how much memory does the cRIO have??? My team would be sending snapshots to our laptop so the driver could tell where he is going but we have to limit our packet size so :/
the docs say 128MB of non-volatile memory and 64MB system memory.
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
Reply With Quote
Reply


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
Time Logging and Team Management? asian_701129 General Forum 9 05-14-2008 11:26 PM
pic: Team Data Logging Device falconmaster Extra Discussion 8 03-13-2007 10:01 AM
White Paper Discuss: Orologio Logging System Julia Magoolia Extra Discussion 6 08-20-2005 02:41 AM
Logging into ChiefDelphi.com question Raven_Writer Website Design/Showcase 8 05-30-2004 11:44 AM


All times are GMT -5. The time now is 09:25 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