

You can track up to 8 items the index for each follows the usual way of counting the position in a matrix, so the possible values are 0 to 7 (and not 1 to 8).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 while loop 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 while loop 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 while loop 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

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.
