Using ofstream is fine... but one thing. When you create or open ofstream objects, the file is cleared out. If you want to keep a running log, do this so that you only create the objects once.
Code:
//imported #include <fstream>
//leftdrive, rightdrive, and myrobot(leftdrive, rightdrive) are already initilized
int counter;
ofstream left;
ofstream right;
left.open ("LEFT.txt");
right.open ("RIGHT.txt");
while (IsOperatorControl())
{
float driverLeftY = driverXbox->GetRawAxis(2);
float driverRightY = driverXbox->GetRawAxis(5);
myRobot->TankDrive(-driverLeftY, driverRightY);
while (counter <= 1500) //while (samples <= 1500)
{
right << RightDrive->Get() << "," << endl;
left << LeftDrive->Get() << "," << endl;
counter++;
Wait(0.01);
}
}
left.close();
right.close();
Once you have this, use a FTP program like FileZilla to read off the cRIO flash at 10.xx.yy.2
__________________

2012 Head of Programming and Electrical
2013-14 Overall Team Captain and Programming Head
2012-14 Mentor of FLL Team Power Surge
2014 Dean's List Finalist
2014 CIR Xerox Creativity Award
Webpage