|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
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 |
|
#2
|
||||
|
||||
|
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.
|
|
#3
|
||||
|
||||
|
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.
|
|
#4
|
|||||
|
|||||
|
Re: Data logging to internal memory
Quote:
I assume it is on port 21 like a normal FTP server? I guess I'm not reading the right documents...Quote:
Thanks all, Jacob |
|
#5
|
||||
|
||||
|
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). Last edited by slavik262 : 10-02-2009 at 23:07. |
|
#6
|
|||||
|
|||||
|
Re: Data logging to internal memory
Would it be possible to write to a USB stick in the drivers station with something like this?
|
|
#7
|
|||||
|
|||||
|
Re: Data logging to internal memory
Quote:
Though that idea is very cool... Jacob |
|
#8
|
||||
|
||||
|
Re: Data logging to internal memory
Quote:
Quote:
Last edited by wt200999 : 12-02-2009 at 09:39. |
|
#9
|
|||
|
|||
|
Re: Data logging to internal memory
That sounds like a cool feature to add to the 2010 wishlist.
|
|
#10
|
|||||
|
|||||
|
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.
|
|
#11
|
||||
|
||||
|
Re: Data logging to internal memory
Yes, I could. I just prefer the C libraries to the C++ std namespace for certain things.
|
|
#12
|
||||
|
||||
|
Re: Data logging to internal memory
If I am not mistaken I did see some functions to save as AVI in the nivision.h...
|
|
#13
|
||||
|
||||
|
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 :/
|
|
#14
|
||||
|
||||
|
Re: Data logging to internal memory
the docs say 128MB of non-volatile memory and 64MB system memory.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Time Logging and Team Management? | asian_701129 | General Forum | 9 | 14-05-2008 23:26 |
| pic: Team Data Logging Device | falconmaster | Extra Discussion | 8 | 13-03-2007 10:01 |
| White Paper Discuss: Orologio Logging System | Julia Magoolia | Extra Discussion | 6 | 20-08-2005 02:41 |
| Logging into ChiefDelphi.com question | Raven_Writer | Website Design/Showcase | 8 | 30-05-2004 11:44 |