Skip to content

Commit 3572349

Browse files
Add error message to pmacCSAxis::move to expose scale_==0
1 parent bce3070 commit 3572349

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pmacApp/src/pmacCSAxis.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,12 @@ asynStatus pmacCSAxis::move(double position, int /*relative*/, double min_veloci
213213
}
214214
}
215215

216-
deviceUnits = position / (double) scale_;
217-
216+
if (scale_ == 0) {
217+
debug(DEBUG_ERROR, functionName, "Error getting CSAxis scale");
218+
debug(DEBUG_ERROR, functionName, " scale_", scale_);
219+
} else {
220+
deviceUnits = position / static_cast<double>(scale_);
221+
}
218222

219223
if (pC_->movesDeferred_ == 0) {
220224
sprintf(command, "&%d%s%sQ7%d=%.12f", pC_->getCSNumber(), vel_buff,

0 commit comments

Comments
 (0)