Encoder Log

To whom it may concern,

Quick question. Is there anyway to store all the values that encoder measures into a text file or spreadsheet? If so, how would I go about doing it? Essentially, I want to write all the values for two encoders to a spreadsheet. Then, with a LabView program, read the file with a file I/O function and pick what information I need.

Thanks,
ty_leatherwood

Em, from what i know about encoders, i doubt it …

See this thread by jpearman. I have not tried this yet but have thought about it and think it’s good for writing telemetry data.

He’s talking about writing data to that bit of memory which sticks around from run to run. You will have to worry about filling up the size of that bufffer however. I am not sure how you would then download that info to your PC, but it seems like an important step 1 in saving telemetry data consistently from the robot.
https://vexforum.com/t/advanced-easyc-programming-non-volatile-parameters/22025/1

Another alternative is to write formatted data to the debug stream and copy the info out of there. There are good and bad points about this method. First one is it’s pretty easy, but you have to have the debugger connected to trap your output and then copy/paste out of the debug stream to your target system. Second is the stream rate needs to keep up with the execution. So don’t write every millisecond to this thing. You can try this one pretty easily so give it a whirl.
http://www.robotc.net/wiki/Debug_Stream

You will want to tag your code properly for use in your analysis. Time stamping each line as well as identifying what variables you are logging in a common format will go a long way when trying to use the data later on. However, the more information you put on that line is less space to store info in memory or more info being streamed which could be dropped on the way to your debugger. Hard coding it to look like XML might be a big hog of space/bandwidth too but will make it much better on the analysis side.

I am sure there is yet another way to read off the data being sent to the joystick/serial cable interface you could syphon off somehow. I think Mr Pearman was toying around with the joystick data ports before as well if you want to look at that avenue in some posts from a month or so ago.

To be clear, I have done what is described in that thread but I have not posted the code to be able to do it and have not decided if I will, there are some potential issues.

ty

How often do you want to collect data and for how long?

Are you using ROBOTC or EasyC?

Can you have the cortex cabled to a computer while you are doing this?