You can include variables or stuff like joystick and sensor values, as shown in this example.The datalogAddValue() function takes 2 parameters: the index of the thing you’re keeping track of, and the thing you’re keeping track of.
#Robotc functions code#
This block of code is inside the while loop I’m using to create my PID function, so that each time through the loop, it adds another row to the data with the current iteration’s values. To make it work, these calls have to be sandwiched in between a “start” and an “end” instruction, like so, with one “add” statement for each variable you want to track: datalogDataGroupStart() ĭatalogAddValue( 4, SensorValue ) The datalogAddValue() function does just what it says: it adds data to the output listing.
#Robotc functions plus#
(There’s also datalogAddValueWithTimeStamp, which does the same thing with - duh - a time stamp, plus a few others I have not used.) So far I’ve only used the datalogAddValue function, which I’ll talk about here. There are not that many items to choose from. The RobotC functions for the datalog can be found in the left-hand column of the help page above. The datalog feature only works if you add code to your program to tell it to keep track of the stuff you want. Instead, as shown in the screenshot below, you’ll want to navigate to Command Library – VEX Cortex > ROBOTC > Datalogging. This is NOT the place to find datalog information (thanks a lot, RobotC). The confusing part of finding this datalog information is not done yet from the main help page, in the left-hand column is a table of contents, and one of the items at the top level of navigation says “ROBOTC Debugger”.
#Robotc functions full#
I include the full path here instead of embedding the link because RobotC has various different wiki/help sections, and as shown in the URL, this one is specifically for VEX. So, start here on the RobotC help page for VEX.
One thing that has prompted me to write this post is that I find the RobotC datalog documentation difficult to locate via Googling, so I wanted to make finding it easier for everyone else. The Help Page’s Secret Hiding Place Revealed
I happened to be working on writing a PID function, but you could use this feature any time you want to be able to look back through the execution of the program to see what *really* happened at each step.
The way I’ve been using it so far is to track data during the execution of a while loop. Since I’ve been using this for like a week, I’m sure I have only scratched the surface of what it’s capable of. RobotC’s datalog feature allows you to track up to 8 pieces of data (variables, sensor values, etc.) as the program executes, with super-easy, one-click exporting to a CSV file and automated, customizable graphs. With eas圜, you’re limited to either making good use of the LCD screen or having your robot tethered to your computer and doing a lot of print-to-screens, which zoom by at a million miles an hour, with data that’s really hard to get into a spreadsheet afterward. So what is the datalog? In short, it’s print-to-screen on steroids in the most helpful way. The datalog is one of the multitude of benefits I’m experiencing with RobotC over eas圜, which we have used up to this season. Thanks once again to the coaches on the VEX World Coaches Association Facebook group for guiding me along here. 🙂 This week I learned about RobotC’s datalog functionality. When I learn something new, all you readers get to learn it too.