From da96b4b9730f6c2bca2fddbb77052fc701a61dba Mon Sep 17 00:00:00 2001 From: smathis Date: Wed, 11 Dec 2024 09:49:17 +0100 Subject: [PATCH] Adjusted the encoder type naming to that of the new NICOS class (https://forge.frm2.tum.de/review/c/frm2/nicos/nicos/+/35285) --- README.md | 5 +++-- db/sinqMotor.db | 18 +++++++++--------- src/sinqController.h | 5 +++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d4d7f15..2bf6978 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,8 @@ dbLoadTemplate("$(TOP)/mcu1.substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$ ### Substitution file -The substitution file is a table containing axis-specific information which is used to create the axis-specific PVs. To work with sinqMotor, "mcu1.substitutions" needs to look like this: +The substitution file is a table containing axis-specific information which is used to create the axis-specific PVs. +To work with sinqMotor, "mcu1.substitutions" needs to look like this (the order of columns does not matter): ``` file "$(SINQDBPATH)" { @@ -93,13 +94,13 @@ The variable `SINQDBPATH` has been set in "mcu1.cmd" before calling `dbLoadTempl - `AXIS`: Index of the axis, corresponds to the physical connection of the axis to the MCU. - `M`: The full PV name is created by concatenating the variables INSTR, NAME and M. For example, the PV of the first axis would be "SQ:SINQTEST:mcu1:lin1". -- `DESC`: Description of the motor. This field is just for documentation and is not needed for operating a motor. - `EGU`: Engineering units. For a linear motor, this is mm, for a rotaty motor, this is degree. - `DIR`: If set to "Neg", the axis direction is inverted. - `MRES`: This is a scaling factor determining the resolution of the position readback value. For example, 0.001 means a precision of 1 um. A detailed description can be found in section [Motor record resolution MRES](#motor-record-resolution-mres). #### Optional parameters The default values for those parameters are given for the individual records in db/sinqMotor.db +- `DESC`: Description of the motor. This field is just for documentation and is not needed for operating a motor. - `MSGTEXTSIZE`: Buffer size for the motor message record in characters - `ENABLEMOVWATCHDOG`: Sets `setWatchdogEnabled` during IOC startup to the given value. - `LIMITSOFFSET`: If the motor limits are read out from the controller, they can diff --git a/db/sinqMotor.db b/db/sinqMotor.db index 08f537a..ecaed1b 100755 --- a/db/sinqMotor.db +++ b/db/sinqMotor.db @@ -1,18 +1,18 @@ # The main asyn motor record. Some fields are populated from the substitution # files via macros: -# - $(INSTR): Name of the instrument, e.g. "SQ:SINQTEST:" -# - $(M): Name of the motor in EPICS, e.g. "lin1" -# - $(DESC): Short description of the motor -# - $(DIR): This value is usually set to "Pos". If the motor axis direction +# - INSTR: Name of the instrument, e.g. "SQ:SINQTEST:" +# - M: Name of the motor in EPICS, e.g. "lin1" +# - DESC: Short description of the motor. If not given, this is equal to M +# - DIR: This value is usually set to "Pos". If the motor axis direction # should be inverted, this value can be set to "Neg" -# - $(CONTROLLER): Name of the motor controller, e.g. "mcu1" -# - $(AXIS): Number of the axis, e.g. "1" -# - $(MRES): Motor record resolution. See the README.md for a detailed discussion -# - $(EGU): Engineering units. In case of a rotary axis, this is "degree", in +# - CONTROLLER: Name of the motor controller, e.g. "mcu1" +# - AXIS: Number of the axis, e.g. "1" +# - MRES: Motor record resolution. See the README.md for a detailed discussion +# - EGU: Engineering units. In case of a rotary axis, this is "degree", in # case of a linear axis this is "mm". record(motor,"$(INSTR)$(M)") { - field(DESC,"$(DESC)") + field(DESC,"$(DESC=$(M))") field(DTYP,"asynMotor") field(DIR,"$(DIR=Pos)") field(OUT,"@asyn($(CONTROLLER),$(AXIS))") diff --git a/src/sinqController.h b/src/sinqController.h index 6e4874a..d20c1c6 100644 --- a/src/sinqController.h +++ b/src/sinqController.h @@ -10,8 +10,9 @@ Stefan Mathis, November 2024 #define motorMessageIsFromDriverString "MOTOR_MESSAGE_DRIVER" #define motorMessageTextString "MOTOR_MESSAGE_TEXT" -#define IncrementalEncoder "Incremental encoder" -#define AbsoluteEncoder "Absolute encoder" +#define IncrementalEncoder "incremental" +#define AbsoluteEncoder "absolute" +#define NoEncoder "none" class epicsShareClass sinqController : public asynMotorController { public: