diff --git a/motorApp/NewportSrc/XPSGathering.c b/motorApp/NewportSrc/XPSGathering.c index 0b583d55..4f686e71 100644 --- a/motorApp/NewportSrc/XPSGathering.c +++ b/motorApp/NewportSrc/XPSGathering.c @@ -23,21 +23,22 @@ void xps_gathering() { int status,poll_socket,drive_socket,end=0; int ftpSocket; - char *gatheringData = "GROUP2.POSITIONER1.CurrentPosition;GROUP2.POSITIONER2.CurrentPosition"; - - + char *gatheringData = "GROUP2.POSITIONER1.SetpointPosition;" + "GROUP2.POSITIONER1.CurrentPosition;" + "GROUP2.POSITIONER1.CurrentVelocity;" + "GROUP2.POSITIONER2.SetpointPosition;" + "GROUP2.POSITIONER2.CurrentPosition;" + "GROUP2.POSITIONER2.CurrentVelocity"; char *positioner[NUM_AXES] = {"GROUP2.POSITIONER1", "GROUP2.POSITIONER2"}; char group[] = "GROUP2"; char outputfilename[500]; - double maxp,minp,maxv,maxa; - char buffer[100]; - double motorReadbacks[NUM_AXES][NUM_ELEMENTS+1]; - double motorError[NUM_AXES][NUM_ELEMENTS+1]; - double trajTime = 0,trajStep = 0; + double maxp, minp, maxv, maxa; + char buffer[1000]; + int nitems; + double setpoint, actual, velocity; int i,j; int groupStatus; - double posTheory[NUM_AXES]; - FILE *gatheringFile, *trajFile; + FILE *gatheringFile; int eventID; time_t start_time, end_time; @@ -82,21 +83,23 @@ void xps_gathering() /* Define trajectory output pulses */ printf("Defining output pulses ...\n"); - status = MultipleAxesPVTPulseOutputSet(poll_socket, group, 1, NUM_ELEMENTS, PULSE_TIME); + status = MultipleAxesPVTPulseOutputSet(poll_socket, group, 1, + NUM_ELEMENTS, PULSE_TIME); /*************************** Verify trajectory **********************/ printf("Verifying trajectory ...\n"); status = MultipleAxesPVTVerification(drive_socket, group, TRAJECTORY_FILE); if (status != 0) { - printf(" Error performing MultipleAxesPVTVerification, status=%d\n",status); + printf("Error performing MultipleAxesPVTVerification, status=%d\n",status); end = 1; } printf("Reading verify results ...\n"); printf(" MultipleAxesPVTVerificationResultGet\n"); for (i=0; i 0 && j < (NUM_AXES-1)) { - if (fscanf(trajFile," %lf,%*f,", &trajStep) != 1) printf("trajerror\n"); - } - - if (i == 0) { - posTheory[j] = motorReadbacks[j][i]; - printf("posTheory = %f ",posTheory[j]); - } - else { - posTheory[j]+= trajStep; - } - - motorError[j][i] = posTheory[j] - motorReadbacks[j][i]; - printf("i=%d J=%d ReadBack=%f motorError=%f trajStep%f\n", - i,j,motorReadbacks[j][i],motorError[j][i],trajStep); + nitems = fscanf(gatheringFile,"%lf %lf %lf ", &setpoint, &actual, &velocity); + if (nitems != 3) printf("nitems=%d, should be 3\n", nitems); + printf("Point=%d, axis=%d, setpoint=%f, actual=%f, error=%f, velocity=%f\n", + i+1, j+1, setpoint, actual, actual-setpoint, velocity); } } - - fclose (trajFile); fclose (gatheringFile); - return; }