Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e30331c92 | |||
| 2578081814 |
@@ -331,6 +331,8 @@ available in the IOC shell.
|
||||
This function is also available in the IOC shell.
|
||||
- `setScaleMovTimeout`: Set a scaling factor for the expected movement time.
|
||||
This function is also available in the IOC shell.
|
||||
- `setMode`: This is an empty function which should be overwritten by concrete
|
||||
driver implementations.
|
||||
|
||||
#### msgPrintControl.h
|
||||
In addition to the two extension classes this library also includes a mechanism
|
||||
|
||||
@@ -245,6 +245,10 @@ asynStatus sinqAxis::forcedPoll(bool *moving) {
|
||||
// Clear the communication
|
||||
setAxisParamChecked(this, motorStatusCommsError, false);
|
||||
|
||||
// Assume the motor is initially connected. During the poll, this value will
|
||||
// be set to false if the motor is not connected.
|
||||
setAxisParamChecked(this, motorConnected, true);
|
||||
|
||||
/*
|
||||
The poll function is just a wrapper around doPoll and handles mainly the
|
||||
callParamCallbacks() function. This wrapper is used to make sure
|
||||
@@ -252,6 +256,11 @@ asynStatus sinqAxis::forcedPoll(bool *moving) {
|
||||
*/
|
||||
poll_status = doPoll(moving);
|
||||
|
||||
// Motor is not connected
|
||||
if (poll_status == asynDisconnected) {
|
||||
setAxisParamChecked(this, motorConnected, false);
|
||||
}
|
||||
|
||||
/*
|
||||
If the poll did not succeed OR if an error message is waiting, something
|
||||
went wrong and the motor has a status problem. Otherwise, delete the error
|
||||
@@ -732,6 +741,11 @@ void sinqAxis::setTargetPosition(double targetPosition) {
|
||||
pSinqA_->targetPosition = targetPosition;
|
||||
}
|
||||
|
||||
asynStatus sinqAxis::setMode(int mode) {
|
||||
(void)mode;
|
||||
return asynSuccess;
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// IOC shell functions
|
||||
extern "C" {
|
||||
|
||||
@@ -434,6 +434,18 @@ class HIDDEN sinqAxis : public asynMotorAxis {
|
||||
*/
|
||||
asynStatus assertConnected();
|
||||
|
||||
/**
|
||||
* @brief Set the operation mode (position or velocity) of the axis. It
|
||||
* should be implemented by a child class of sinqAxis.
|
||||
*
|
||||
* This function is called from within sinqController::writeInt32 if a new
|
||||
* operation mode has been set.
|
||||
*
|
||||
* @param mode: New operation mode. 0 is position mode, 1 is velocity mode.
|
||||
* @return asynStatus
|
||||
*/
|
||||
virtual asynStatus setMode(int mode);
|
||||
|
||||
/**
|
||||
* @brief Return a pointer to the axis controller.
|
||||
*
|
||||
|
||||
@@ -510,7 +510,7 @@ asynStatus sinqController::writeInt32(asynUser *pasynUser, epicsInt32 value) {
|
||||
// for velocity mode):
|
||||
if (value == 0 || value == 1) {
|
||||
setAxisParamChecked(axis, motorMode, value);
|
||||
return asynMotorController::writeInt32(pasynUser, value);
|
||||
return axis->setMode(value);
|
||||
} else {
|
||||
int axisNo;
|
||||
getAddress(pasynUser, &axisNo);
|
||||
|
||||
Reference in New Issue
Block a user