Compare commits
1 Commits
fix_timing
...
6e94c9a9b6
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e94c9a9b6 |
2
Makefile
2
Makefile
@@ -34,4 +34,4 @@ TEMPLATES += db/turboPmac.db
|
|||||||
DBDS += sinqMotor/src/sinqMotor.dbd
|
DBDS += sinqMotor/src/sinqMotor.dbd
|
||||||
DBDS += src/turboPmac.dbd
|
DBDS += src/turboPmac.dbd
|
||||||
|
|
||||||
USR_CFLAGS += -Wall -Wextra -Weffc++ -Wunused-result -Werror # -Wpedantic // Does not work because EPICS macros trigger warnings
|
USR_CFLAGS += -Wall -Wextra -Weffc++ -Wunused-result -Werror -fvisibility=hidden # -Wpedantic // Does not work because EPICS macros trigger warnings
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# turboPmac
|
# turboPmac
|
||||||
|
|
||||||
## <span style="color:red">Please read the documentation of sinqMotor first: https://gitea.psi.ch/lin-epics-modules/sinqMotor</span>
|
## <span style="color:red">Please read the documentation of sinqMotor first: https://git.psi.ch/sinq-epics-modules/sinqmotor</span>
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ This is a driver for the Turbo PMAC motion controller with the SINQ communicatio
|
|||||||
|
|
||||||
## User guide
|
## User guide
|
||||||
|
|
||||||
This driver is a standard sinqMotor-derived which however uses a special low level IP Port driver (`pmacAsynIPPortConfigure`) instead of the standard `drvAsynIPPortConfigure`. For the general configuration, please see https://gitea.psi.ch/lin-epics-modules/sinqMotor/src/branch/main/README.md.
|
This driver is a standard sinqMotor-derived which however uses a special low level IP Port driver (`pmacAsynIPPortConfigure`) instead of the standard `drvAsynIPPortConfigure`. For the general configuration, please see https://git.psi.ch/sinq-epics-modules/sinqmotor/-/blob/main/README.md.
|
||||||
|
|
||||||
The folder "utils" contains utility scripts for working with pmac motor controllers. To read their manual, run the scripts without any arguments.
|
The folder "utils" contains utility scripts for working with pmac motor controllers. To read their manual, run the scripts without any arguments.
|
||||||
- writeRead.py: Allows sending commands to and receiving commands from a pmac controller over an ethernet connection.
|
- writeRead.py: Allows sending commands to and receiving commands from a pmac controller over an ethernet connection.
|
||||||
@@ -67,8 +67,8 @@ dbLoadRecords("$(turboPmac_DB)/asynRecord.db","P=$(INSTR)$(DRIVER_PORT),PORT=$(I
|
|||||||
|
|
||||||
### Versioning
|
### Versioning
|
||||||
|
|
||||||
Please see the documentation for the module sinqMotor: https://gitea.psi.ch/lin-epics-modules/sinqMotor/src/branch/main/README.md.
|
Please see the documentation for the module sinqMotor: https://git.psi.ch/sinq-epics-modules/sinqmotor/-/blob/main/README.md.
|
||||||
|
|
||||||
### How to build it
|
### How to build it
|
||||||
|
|
||||||
This driver can be compiled and installed by running `make install` from the same directory where the Makefile is located. However, since it uses the git submodule sinqMotor, make sure that the correct version of the submodule repository is checked out AND the change is commited (`git status` shows no non-committed changes). Please see the section "Usage as static dependency" in https://gitea.psi.ch/lin-epics-modules/sinqMotor/src/branch/main/README.md for more details.
|
This driver can be compiled and installed by running `make install` from the same directory where the Makefile is located. However, since it uses the git submodule sinqMotor, make sure that the correct version of the submodule repository is checked out AND the change is commited (`git status` shows no non-committed changes). Please see the section "Usage as static dependency" in https://git.psi.ch/sinq-epics-modules/sinqmotor/-/blob/main/README.md for more details.
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,15 @@
|
|||||||
#ifndef turboPmacAXIS_H
|
#ifndef turboPmacAXIS_H
|
||||||
#define turboPmacAXIS_H
|
#define turboPmacAXIS_H
|
||||||
#include "sinqController.h"
|
#include "sinqAxis.h"
|
||||||
#include "turboPmacController.h"
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
struct turboPmacAxisImpl;
|
struct turboPmacAxisImpl;
|
||||||
|
|
||||||
|
// Forward declaration of the controller class to resolve the cyclic dependency
|
||||||
|
// between the controller and the axis .h-file. See
|
||||||
|
// https://en.cppreference.com/w/cpp/language/class.
|
||||||
|
class turboPmacController;
|
||||||
|
|
||||||
class turboPmacAxis : public sinqAxis {
|
class turboPmacAxis : public sinqAxis {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
@@ -138,11 +142,6 @@ class turboPmacAxis : public sinqAxis {
|
|||||||
*/
|
*/
|
||||||
void setNeedInit(bool needInit);
|
void setNeedInit(bool needInit);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Return a pointer to the axis controller
|
|
||||||
*/
|
|
||||||
virtual turboPmacController *pController() override { return pC_; };
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
turboPmacController *pC_;
|
turboPmacController *pC_;
|
||||||
std::unique_ptr<turboPmacAxisImpl> pTurboPmacA_;
|
std::unique_ptr<turboPmacAxisImpl> pTurboPmacA_;
|
||||||
|
|||||||
@@ -206,7 +206,9 @@ asynStatus turboPmacController::writeRead(int axisNo, const char *command,
|
|||||||
|
|
||||||
// Definition of local variables.
|
// Definition of local variables.
|
||||||
asynStatus status = asynSuccess;
|
asynStatus status = asynSuccess;
|
||||||
|
asynStatus paramLibStatus = asynSuccess;
|
||||||
asynStatus timeoutStatus = asynSuccess;
|
asynStatus timeoutStatus = asynSuccess;
|
||||||
|
// char fullCommand[MAXBUF_] = {0};
|
||||||
char drvMessageText[MAXBUF_] = {0};
|
char drvMessageText[MAXBUF_] = {0};
|
||||||
char modResponse[MAXBUF_] = {0};
|
char modResponse[MAXBUF_] = {0};
|
||||||
int motorStatusProblem = 0;
|
int motorStatusProblem = 0;
|
||||||
@@ -254,10 +256,6 @@ asynStatus turboPmacController::writeRead(int axisNo, const char *command,
|
|||||||
pasynOctetSyncIOipPort(), command, commandLength, response, MAXBUF_,
|
pasynOctetSyncIOipPort(), command, commandLength, response, MAXBUF_,
|
||||||
pTurboPmacC_->comTimeout, &nbytesOut, &nbytesIn, &eomReason);
|
pTurboPmacC_->comTimeout, &nbytesOut, &nbytesIn, &eomReason);
|
||||||
|
|
||||||
// if (strchr(command, '=')) {
|
|
||||||
// usleep(20000);
|
|
||||||
// }
|
|
||||||
|
|
||||||
msgPrintControlKey comKey =
|
msgPrintControlKey comKey =
|
||||||
msgPrintControlKey(portName, axisNo, __PRETTY_FUNCTION__, __LINE__);
|
msgPrintControlKey(portName, axisNo, __PRETTY_FUNCTION__, __LINE__);
|
||||||
|
|
||||||
@@ -430,18 +428,41 @@ asynStatus turboPmacController::writeRead(int axisNo, const char *command,
|
|||||||
|
|
||||||
// Log the overall status (communication successfull or not)
|
// Log the overall status (communication successfull or not)
|
||||||
if (status == asynSuccess) {
|
if (status == asynSuccess) {
|
||||||
setAxisParamChecked(axis, motorStatusCommsError, false);
|
paramLibStatus = axis->setIntegerParam(this->motorStatusCommsError_, 0);
|
||||||
} else {
|
} else {
|
||||||
// Check if the axis already is in an error communication mode. If
|
// Check if the axis already is in an error communication mode. If
|
||||||
// it is not, upstream the error. This is done to avoid "flooding"
|
// it is not, upstream the error. This is done to avoid "flooding"
|
||||||
// the user with different error messages if more than one error
|
// the user with different error messages if more than one error
|
||||||
// ocurred before an error-free communication
|
// ocurred before an error-free communication
|
||||||
getAxisParamChecked(axis, motorStatusProblem, &motorStatusProblem);
|
paramLibStatus =
|
||||||
|
getIntegerParam(axisNo, motorStatusProblem_, &motorStatusProblem);
|
||||||
|
if (paramLibStatus != asynSuccess) {
|
||||||
|
return paramLibAccessFailed(paramLibStatus, "motorStatusProblem",
|
||||||
|
axisNo, __PRETTY_FUNCTION__, __LINE__);
|
||||||
|
}
|
||||||
|
|
||||||
if (motorStatusProblem == 0) {
|
if (motorStatusProblem == 0) {
|
||||||
setAxisParamChecked(axis, motorMessageText, drvMessageText);
|
paramLibStatus =
|
||||||
setAxisParamChecked(axis, motorStatusProblem, true);
|
axis->setStringParam(motorMessageText(), drvMessageText);
|
||||||
setAxisParamChecked(axis, motorStatusCommsError, true);
|
if (paramLibStatus != asynSuccess) {
|
||||||
|
return paramLibAccessFailed(paramLibStatus, "motorMessageText",
|
||||||
|
axisNo, __PRETTY_FUNCTION__,
|
||||||
|
__LINE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
paramLibStatus = axis->setIntegerParam(motorStatusProblem_, 1);
|
||||||
|
if (paramLibStatus != asynSuccess) {
|
||||||
|
return paramLibAccessFailed(paramLibStatus,
|
||||||
|
"motorStatusProblem", axisNo,
|
||||||
|
__PRETTY_FUNCTION__, __LINE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
paramLibStatus = axis->setIntegerParam(motorStatusProblem_, 1);
|
||||||
|
if (paramLibStatus != asynSuccess) {
|
||||||
|
return paramLibAccessFailed(paramLibStatus,
|
||||||
|
"motorStatusCommsError", axisNo,
|
||||||
|
__PRETTY_FUNCTION__, __LINE__);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
|
|||||||
@@ -10,13 +10,9 @@
|
|||||||
#define turboPmacController_H
|
#define turboPmacController_H
|
||||||
#include "sinqAxis.h"
|
#include "sinqAxis.h"
|
||||||
#include "sinqController.h"
|
#include "sinqController.h"
|
||||||
|
#include "turboPmacAxis.h"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
// Forward declaration of the controller class to resolve the cyclic dependency
|
|
||||||
// between the controller and the axis .h-file. See
|
|
||||||
// https://en.cppreference.com/w/cpp/language/class.
|
|
||||||
class turboPmacAxis;
|
|
||||||
|
|
||||||
struct turboPmacControllerImpl;
|
struct turboPmacControllerImpl;
|
||||||
|
|
||||||
class turboPmacController : public sinqController {
|
class turboPmacController : public sinqController {
|
||||||
|
|||||||
Reference in New Issue
Block a user