4 Commits
0.2.0 ... 0.3.0

Author SHA1 Message Date
2636296539 Removed debug messages 2025-05-15 13:50:26 +02:00
b09f081db9 Updated turboPmac and sinqMotor versions 2025-05-15 13:35:16 +02:00
af5d349254 Updated static dependency turboPmac to 0.15.1 2025-05-14 16:34:44 +02:00
d71c80fcb3 Changed turboPmac to static dependency. 2025-05-12 17:40:34 +02:00
7 changed files with 71 additions and 16 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "turboPmac"]
path = turboPmac
url = https://gitea.psi.ch/lin-epics-modules/turboPmac

View File

@ -12,9 +12,6 @@ REQUIRED+=motorBase
# Specify the version of motorBase we want to build against # Specify the version of motorBase we want to build against
motorBase_VERSION=7.2.2 motorBase_VERSION=7.2.2
# Specify the version of turboPmac we want to build against
turboPmac_VERSION=0.13.0
# These headers allow to depend on this library for derived drivers. # These headers allow to depend on this library for derived drivers.
HEADERS += src/seleneGuideController.h HEADERS += src/seleneGuideController.h
HEADERS += src/seleneLiftAxis.h HEADERS += src/seleneLiftAxis.h
@ -22,15 +19,27 @@ HEADERS += src/seleneAngleAxis.h
HEADERS += src/seleneOffsetAxis.h HEADERS += src/seleneOffsetAxis.h
# Source files to build # Source files to build
SOURCES += turboPmac/sinqMotor/src/msgPrintControl.cpp
SOURCES += turboPmac/sinqMotor/src/sinqAxis.cpp
SOURCES += turboPmac/sinqMotor/src/sinqController.cpp
SOURCES += turboPmac/src/pmacAsynIPPort.c
SOURCES += turboPmac/src/turboPmacAxis.cpp
SOURCES += turboPmac/src/turboPmacController.cpp
SOURCES += turboPmac/src/pmacAsynIPPort.c
SOURCES += src/seleneGuideController.cpp SOURCES += src/seleneGuideController.cpp
SOURCES += src/seleneLiftAxis.cpp SOURCES += src/seleneLiftAxis.cpp
SOURCES += src/seleneAngleAxis.cpp SOURCES += src/seleneAngleAxis.cpp
SOURCES += src/seleneOffsetAxis.cpp SOURCES += src/seleneOffsetAxis.cpp
# Store the record files # Store the record files
TEMPLATES += turboPmac/sinqMotor/db/asynRecord.db
TEMPLATES += turboPmac/sinqMotor/db/sinqMotor.db
TEMPLATES += turboPmac/db/turboPmac.db
TEMPLATES += db/seleneGuide.db TEMPLATES += db/seleneGuide.db
# This file registers the motor-specific functions in the IOC shell. # This file registers the motor-specific functions in the IOC shell.
DBDS += turboPmac/sinqMotor/src/sinqMotor.dbd
DBDS += turboPmac/src/turboPmac.dbd
DBDS += src/seleneGuide.dbd DBDS += src/seleneGuide.dbd
USR_CFLAGS += -Wall -Wextra -Weffc++ -Wunused-result -Wextra -Werror # -Wpedantic // Does not work because EPICS macros trigger warnings USR_CFLAGS += -Wall -Wextra -Weffc++ -Wunused-result -Wextra -Werror # -Wpedantic // Does not work because EPICS macros trigger warnings

View File

@ -90,13 +90,13 @@ seleneVirtualAxes("$(NAME)", 1, 2, 3, 4, 5, 6, 9, 10);
# Parametrize the EPICS record database with the substitution file named after the motor controller. # Parametrize the EPICS record database with the substitution file named after the motor controller.
# In order to provide the PVs for absolute position and normalization, the # In order to provide the PVs for absolute position and normalization, the
# corresponding `seleneGuide.db` file is loaded here as well. # corresponding `seleneGuide.db` file is loaded here as well.
epicsEnvSet("SINQDBPATH","$(sinqMotor_DB)/sinqMotor.db") epicsEnvSet("SINQDBPATH","$(seleneGuide_DB)/sinqMotor.db")
dbLoadTemplate("$(TOP)/motors/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)") dbLoadTemplate("$(TOP)/motors/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)")
epicsEnvSet("SINQDBPATH","$(turboPmac_DB)/turboPmac.db") epicsEnvSet("SINQDBPATH","$(seleneGuide_DB)/turboPmac.db")
dbLoadTemplate("$(TOP)/motors/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)") dbLoadTemplate("$(TOP)/motors/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)")
epicsEnvSet("SINQDBPATH","$(seleneGuide_DB)/seleneGuide.db") epicsEnvSet("SINQDBPATH","$(seleneGuide_DB)/seleneGuide.db")
dbLoadTemplate("$(TOP)/motors/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)") dbLoadTemplate("$(TOP)/motors/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)")
dbLoadRecords("$(sinqMotor_DB)/asynRecord.db","P=$(INSTR)$(NAME),PORT=$(ASYN_PORT)") dbLoadRecords("$(seleneGuide_DB)/asynRecord.db","P=$(INSTR)$(NAME),PORT=$(ASYN_PORT)")
``` ```
### Substitution file ### Substitution file

View File

@ -22,6 +22,20 @@ seleneAngleAxis::seleneAngleAxis(seleneGuideController *pController, int axisNo,
pC_->paramLibAccessFailed(status, "motorCanDisable", axisNo_, pC_->paramLibAccessFailed(status, "motorCanDisable", axisNo_,
__PRETTY_FUNCTION__, __LINE__); __PRETTY_FUNCTION__, __LINE__);
} }
// Even though this happens already in sinqAxis, a default value for
// motorMessageText is set here again, because apparently the sinqAxis
// constructor is not run before the string is accessed?
status = setStringParam(pC_->motorMessageText(), "");
if (status != asynSuccess) {
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d:\nFATAL ERROR "
"(setting a parameter value failed "
"with %s)\n. Terminating IOC",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->stringifyAsynStatus(status));
exit(-1);
}
} }
asynStatus seleneAngleAxis::stop(double acceleration) { asynStatus seleneAngleAxis::stop(double acceleration) {
@ -59,7 +73,7 @@ asynStatus seleneAngleAxis::targetPosition(double *targetPosition) {
asynStatus seleneAngleAxis::doPoll(bool *moving) { asynStatus seleneAngleAxis::doPoll(bool *moving) {
char userMessage[pC_->MAXBUF_] = {0}; char errorMessage[pC_->MAXBUF_] = {0};
// In the doPoll method of `seleneLiftAxis`, the parameters // In the doPoll method of `seleneLiftAxis`, the parameters
// `motorStatusMoving` and `motorStatusDone` of this axis have already been // `motorStatusMoving` and `motorStatusDone` of this axis have already been
@ -189,15 +203,15 @@ asynStatus seleneAngleAxis::doPoll(bool *moving) {
// axis. // axis.
pl_status = pl_status =
pC_->getStringParam(liftAxis_->axisNo(), pC_->motorMessageText(), pC_->getStringParam(liftAxis_->axisNo(), pC_->motorMessageText(),
sizeof(userMessage), userMessage); sizeof(errorMessage), errorMessage);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorMessageText", return pC_->paramLibAccessFailed(pl_status, "motorMessageText",
liftAxis_->axisNo(), liftAxis_->axisNo(),
__PRETTY_FUNCTION__, __LINE__); __PRETTY_FUNCTION__, __LINE__);
} }
if (strlen(userMessage) != 0) { if (strlen(errorMessage) != 0) {
pl_status = setStringParam(pC_->motorMessageText(), userMessage); pl_status = setStringParam(pC_->motorMessageText(), errorMessage);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_", return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,

View File

@ -99,6 +99,20 @@ seleneLiftAxis::seleneLiftAxis(seleneGuideController *pC, int axis1No,
pC_->paramLibAccessFailed(status, "motorCanDisable", axisNo_, pC_->paramLibAccessFailed(status, "motorCanDisable", axisNo_,
__PRETTY_FUNCTION__, __LINE__); __PRETTY_FUNCTION__, __LINE__);
} }
// Even though this happens already in sinqAxis, a default value for
// motorMessageText is set here again, because apparently the sinqAxis
// constructor is not run before the string is accessed?
status = setStringParam(pC_->motorMessageText(), "");
if (status != asynSuccess) {
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d:\nFATAL ERROR "
"(setting a parameter value failed "
"with %s)\n. Terminating IOC",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->stringifyAsynStatus(status));
exit(-1);
}
} }
asynStatus seleneLiftAxis::init() { asynStatus seleneLiftAxis::init() {
@ -493,10 +507,6 @@ asynStatus seleneLiftAxis::startCombinedMove() {
if (status != asynSuccess) { if (status != asynSuccess) {
return status; return status;
} }
errlogPrintf("Target lift: %lf, Target angle: %lf\n", liftTargetPosition,
angleTargetPosition);
auto targetPositions = auto targetPositions =
positionsFromLiftAndAngle(liftTargetPosition, angleTargetPosition); positionsFromLiftAndAngle(liftTargetPosition, angleTargetPosition);
@ -516,8 +526,6 @@ asynStatus seleneLiftAxis::startCombinedMove() {
targetPositions[0], targetPositions[1], targetPositions[2], targetPositions[0], targetPositions[1], targetPositions[2],
targetPositions[3], targetPositions[4], targetPositions[5]); targetPositions[3], targetPositions[4], targetPositions[5]);
errlogPrintf("%s\n", command);
// No answer expected // No answer expected
return pC_->writeRead(axisNo_, command, response, 0); return pC_->writeRead(axisNo_, command, response, 0);
} }

View File

@ -80,6 +80,20 @@ seleneOffsetAxis::seleneOffsetAxis(seleneGuideController *pController,
pC_->paramLibAccessFailed(status, "motorCanDisable", axisNo_, pC_->paramLibAccessFailed(status, "motorCanDisable", axisNo_,
__PRETTY_FUNCTION__, __LINE__); __PRETTY_FUNCTION__, __LINE__);
} }
// Even though this happens already in sinqAxis, a default value for
// motorMessageText is set here again, because apparently the sinqAxis
// constructor is not run before the string is accessed?
status = setStringParam(pC_->motorMessageText(), "");
if (status != asynSuccess) {
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d:\nFATAL ERROR "
"(setting a parameter value failed "
"with %s)\n. Terminating IOC",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->stringifyAsynStatus(status));
exit(-1);
}
} }
asynStatus seleneOffsetAxis::init() { asynStatus seleneOffsetAxis::init() {
@ -199,6 +213,12 @@ asynStatus seleneOffsetAxis::doPoll(bool *moving) {
// Update the parameter library // Update the parameter library
if (error != 0) { if (error != 0) {
status = setStringParam(pC_->motorMessageText(), userMessage);
if (status != asynSuccess) {
return pC_->paramLibAccessFailed(status, "motorMessageText",
axisNo_, __PRETTY_FUNCTION__,
__LINE__);
}
status = setIntegerParam(pC_->motorStatusProblem(), true); status = setIntegerParam(pC_->motorStatusProblem(), true);
if (status != asynSuccess) { if (status != asynSuccess) {
return pC_->paramLibAccessFailed(status, "motorStatusProblem_", return pC_->paramLibAccessFailed(status, "motorStatusProblem_",

1
turboPmac Submodule

Submodule turboPmac added at 75292a6a9c