9 #define G_LASTINDEX 999 14 int previous_rd,
int rd);
19 osA.open(fileA, ios::out | ios::trunc);
20 osB.open(fileB, ios::out | ios::trunc);
26 "RC 0;' Disable Recording\n" 27 "DP 0, 0;' Set current position to 0\r" 28 "DM posA[1000], posB[1000];' Define a new array that will hold positional data\r" 29 "RA posA[], posB[];' Sets position array to be where recorded data will be stored\r" 30 "RD _TPA, _TPB;' Defines Position to be the type of data that will be recorded\r" 31 "RC 1,-1000;' Begins recording at 512Hz in continuous mode\r" 32 "MO AB;' Turns motors off\r" 33 "AI -1;' Waits for active low on Input 1\r" 34 "RC 0;' Disable Recording after Input 1 goes low\r" 35 "EN;' End program", 0));
44 e(GCmdI(g,
"MG _RD", &rd));
52 e(GCmdI(g,
"MG _RC", &recording));
60 return GALIL_EXAMPLE_OK;
65 int previous_rd,
int rd)
67 char buf[G_HUGE_BUFFER];
71 e(GArrayUpload(g, array_name, previous_rd, rd - 1, G_COMMA, buf, G_HUGE_BUFFER));
76 e(GArrayUpload(g, array_name, previous_rd, G_LASTINDEX, G_COMMA, buf, G_HUGE_BUFFER));
81 e(GArrayUpload(g, array_name, 0, rd - 1, G_COMMA, buf, G_HUGE_BUFFER));
void e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
GReturn record_position(GCon g, char *fileA, char *fileB)
Record user's training and saves to a text file.
void write_array_to_file(GCon g, ofstream &os, const char *array_name, int previous_rd, int rd)
Grabs data from array on controller and writes it to the given text file.