From 2e2c24238b9500a282fe815b5a6a9f8caf621cf1 Mon Sep 17 00:00:00 2001 From: smathis Date: Wed, 4 Dec 2024 13:39:36 +0100 Subject: [PATCH] Prototype for v0.2 --- db/pmacv3.db | 20 ++++++++++++++------ src/pmacv3Controller.cpp | 10 ---------- src/pmacv3Controller.h | 11 ----------- 3 files changed, 14 insertions(+), 27 deletions(-) diff --git a/db/pmacv3.db b/db/pmacv3.db index 66eb5ca..9d6cd4c 100644 --- a/db/pmacv3.db +++ b/db/pmacv3.db @@ -1,5 +1,7 @@ -# Encoder type -record(waveform, "$(P)$(M):Encoder_Type") { +# Read out the encoder type in human-readable form. The output numbers can be +# interpreted as ASCII. +# This record is coupled to the parameter library via motorEnable_ -> MOTOR_ENABLE. +record(waveform, "$(INSTR)$(M):Encoder_Type") { field(DTYP, "asynOctetRead") field(INP, "@asyn($(CONTROLLER),$(AXIS),1) ENCODER_TYPE") field(FTVL, "CHAR") @@ -7,15 +9,21 @@ record(waveform, "$(P)$(M):Encoder_Type") { field(SCAN, "I/O Intr") } -# reread encoder -record(longout, "$(P)$(M):Reread_Encoder") { +# Trigger a rereading of the encoder. This action is sometimes necessary for +# absolute encoders after enabling them. For incremental encoders, this is a no-op. +# This record is coupled to the parameter library via rereadEncoderPosition_ -> REREAD_ENCODER_POSITION. +record(longout, "$(INSTR)$(M):Reread_Encoder") { field(DTYP, "asynInt32") field(OUT, "@asyn($(CONTROLLER),$(AXIS),1) REREAD_ENCODER_POSITION") field(PINI, "NO") } -# reread encoder -record(longout, "$(P)$(M):Read_Config") { +# The pmacV3 driver reads certain configuration parameters (such as the velocity +# and the acceleration) directly from the MCU. This reading procedure is performed +# once at IOC startup during atFirstPoll. However, it can be triggered manually +# by setting this record value to 1. +# This record is coupled to the parameter library via readConfig_ -> READ_CONFIG. +record(longout, "$(INSTR)$(M):Read_Config") { field(DTYP, "asynInt32") field(OUT, "@asyn($(CONTROLLER),$(AXIS),1) READ_CONFIG") field(PINI, "NO") diff --git a/src/pmacv3Controller.cpp b/src/pmacv3Controller.cpp index d88fc87..58bbd97 100644 --- a/src/pmacv3Controller.cpp +++ b/src/pmacv3Controller.cpp @@ -405,16 +405,6 @@ asynStatus pmacv3Controller::writeRead(int axisNo, const char *command, return asynSuccess; } -asynStatus pmacv3Controller::readInt32(asynUser *pasynUser, epicsInt32 *value) { - if (pasynUser->reason == motorCanDisable_) { - // By default, motors cannot be disabled - *value = 1; - return asynSuccess; - } else { - return sinqController::readInt32(pasynUser, value); - } -} - asynStatus pmacv3Controller::writeInt32(asynUser *pasynUser, epicsInt32 value) { int function = pasynUser->reason; diff --git a/src/pmacv3Controller.h b/src/pmacv3Controller.h index 22651c3..c4a474f 100644 --- a/src/pmacv3Controller.h +++ b/src/pmacv3Controller.h @@ -50,17 +50,6 @@ class pmacv3Controller : public sinqController { */ pmacv3Axis *getAxis(int axisNo); - /** - * @brief Overloaded function of sinqController - * - * The function is overloaded to read the canDisable property. - * - * @param pasynUser Specify the axis via the asynUser - * @param value Read-out value - * @return asynStatus - */ - asynStatus readInt32(asynUser *pasynUser, epicsInt32 *value); - /** * @brief Overloaded function of sinqController *