Other teams might find this Visual Basic program useful. It was developed using Visual Studio 2008.
(I hope the Easy/C developers can use it to find out why Easy/C won’t open the Bluetooth serial port, as explained in my previous posts. It might also help with their comments on data throughput … we find that the data is received very quickly and accurately as long as we don’t output data so often that the robot controller’s time limits aren’t exceeded and the Code Error light comes on.)
We use it, together with our Bluetooth serial adaptor, to produce instant line charts in Excel following a telemetry run. Obviously this requires Microsoft Excel be installed on your computer.
The robot code outputs data in columns, with a header line output first. For example (and this code fragment is for illustration purposes only):
int iJoystick;
int iError;
unsigned int uPWM;
print("
HEADER:
");
print("Joystick,Error,Motor
");
while (1)
{
// read joystick value
...
// compute error and motor PWM values
...
// output data for telemetry
print("%d,%d,%u
", iJoystick, iError, uPWM);
}
It is important that the number of comma-separated fields in the header line, and the number of comma-separated fields in the data lines, are the same.
The data going out the serial port would look something like this:
HEADER:
Joystick,Error,Motor
-12,10,132
-12,10,132
-14,12,145
-16,14,145
You can see this in the Terminal window of Easy/C, but there is no way to capture the data to a file.
You could open the COM port on the PC using Hyperterminal, and capture the data to a log file, but that’s lots of keystrokes and mouse-clicks to repeat on every data run. And if you try to use the same COM port as Easy/C, you will have to close Easy/C between runs to free up the COM port.
Or you could run the attached program and get the data on a different COM port - leaving the original one for Easy/C and program loading. You will need to plug the robot controller’s Program Port into a different port on the PC, during your telemetry test run.
To use the program:
- select the COM port and click the Open button
- hook up the robot controller as described above, and run it to produce data
- click the Excel button to copy the data to Excel. The program fires up Excel automatically, copies the data to rows and columns, creates a chart, and then makes Excel visible.
The ‘Trim Data’ button is provided so that you can restart the robot program multiple times … this results in multiple header lines in the output. Trim looks for the line containing the word HEADER: and removes that line and everything before it. This leaves only the the final header and data lines. After you Trim, then use the Excel button.
Mike
SkyTelemetry1.zip (88.7 KB)
SkyTelemetry1.zip (88.7 KB)