@@ -150,10 +150,12 @@ asynStatus GalilCSAxis::setDefaults(void)
150150 setDoubleParam (pC_->motorEncoderPosition_ , encoder_position_);
151151 // Pass default direction value to motorRecord
152152 setIntegerParam (pC_->motorStatusDirection_ , direction_);
153+ // Used to stop all motors in this CSAxis in Sync start only mode
153154 // Dont stop the CSAxis now
154155 stop_csaxis_ = false ;
155- // Used to stop all motors in this CSAxis
156- stop_issued_ = false ;
156+ // Used to track whether stop request issued to all motors in this CSAxis
157+ // Default is stop request already issued
158+ stop_issued_ = true ;
157159 // Axis not ready until necessary motor record fields have been pushed into driver
158160 // So we use "use encoder if present" UEIP field to set axisReady_ to true
159161 lastaxisReady_ = axisReady_ = false ;
@@ -1019,6 +1021,7 @@ asynStatus GalilCSAxis::packReadbackArgs(char *axes, double mrargs[])
10191021 for (i = 0 ; axes[i] != ' \0 ' ; i++)
10201022 {
10211023 // Get the readbacks for the axis
1024+ // These can be real, or other CSAxis
10221025 status |= pC_->getDoubleParam (axes[i] - AASCII , pC_->motorEncoderPosition_ , &epos);
10231026 status |= pC_->getDoubleParam (axes[i] - AASCII , pC_->motorPosition_ , &mpos);
10241027 // Retrieve needed motor record fields
@@ -1415,8 +1418,11 @@ asynStatus GalilCSAxis::poller(void)
14151418 pAxis = pC_->getAxis (revaxes_[i] - AASCII );
14161419 // Process or skip
14171420 if (!pAxis) continue ;
1418- // stop the motor
1419- pAxis->pollRequest_ .send ((void *)&MOTOR_STOP , sizeof (int ));
1421+ // Set axis stop code
1422+ sc = pAxis->stop_code_ ;
1423+ // stop the motor if it's not stopping already
1424+ if (!pAxis->done_ && sc != MOTOR_STOP_FWD && sc != MOTOR_STOP_REV && sc != MOTOR_STOP_STOP )
1425+ pAxis->pollRequest_ .send ((void *)&MOTOR_STOP , sizeof (int ));
14201426 }
14211427 // Flag stop has been issued
14221428 stop_issued_ = true ;
0 commit comments