prjemian / epics-docker

Provide EPICS IOCs in docker images
9 stars 4 forks source link

v2 image #55

Closed prjemian closed 1 year ago

prjemian commented 1 year ago
prjemian commented 1 year ago

Still seeing the same kind of errors reported previously, even though using export CAPUTRECORDER_HASH=master.

One set for each of the 56 motors.

sky:m56Offset devAsynFloat64::initCommon drvUserCreate drvmotorAsyn::drvUserCreate, unknown command=MOTOR_REC_OFFSET
Error (514,11) PV: sky:m56Offset ao: init_record

sky:m56Resolution devAsynFloat64::initCommon drvUserCreate drvmotorAsyn::drvUserCreate, unknown command=MOTOR_REC_RESOLUTION
Error (514,11) PV: sky:m56Resolution ao: init_record

sky:m56Direction devAsynInt32::initCommon drvUserCreate drvmotorAsyn::drvUserCreate, unknown command=MOTOR_REC_DIRECTION

Need to check if new build has these patches:

prjemian commented 1 year ago

With these IOCS, the apstools unit tests pass locally:

# restart the two IOCs
./resources/iocmgr.sh restart gp gp
./resources/iocmgr.sh restart adsim ad

# check their status
./resources/iocmgr.sh status gp gp
./resources/iocmgr.sh status adsim ad

# run the test suite
cd ../apstools
pytest -vvv --lf ./apstools
prjemian commented 1 year ago

Added scaler2 and scaler3 to IOCGP

prjemian commented 1 year ago

Looking at the IOC startup logs, still some things to change before pushing new image to dockerhub.

ADSIM

envPaths

st_base.cmd

commonPlugins.cmd

GP

prjemian commented 1 year ago

When adding slit2, want to change the slit1 motor assignments to make all slit motors in consecutive numbers. Start from m49.

prjemian commented 1 year ago

Note also that Slit2 GUI support is not 2slit.db but fits the 2slit_soft.vdb database. Note there is a special comment about [synchronization if the slit move is interrupted](https://github.com/epics-modules/optics/blob/caa80b043b5f1ed2478356fda0595c9e0f78e840/opticsApp/Db/2slit_soft.vdb#L1-L100.

prjemian commented 1 year ago

Still seeing the same kind of errors reported previously, even though using export CAPUTRECORDER_HASH=master.

One set for each of the 56 motors.

sky:m56Offset devAsynFloat64::initCommon drvUserCreate drvmotorAsyn::drvUserCreate, unknown command=MOTOR_REC_OFFSET
Error (514,11) PV: sky:m56Offset ao: init_record

sky:m56Resolution devAsynFloat64::initCommon drvUserCreate drvmotorAsyn::drvUserCreate, unknown command=MOTOR_REC_RESOLUTION
Error (514,11) PV: sky:m56Resolution ao: init_record

sky:m56Direction devAsynInt32::initCommon drvUserCreate drvmotorAsyn::drvUserCreate, unknown command=MOTOR_REC_DIRECTION

Need to check if new build has these patches:

The cited issue in motor fixes a different problem.

prjemian commented 1 year ago

The code where the unknown commands are defined is in motor MOTOR/motorApp/MotorSrc/asynMotorController.h:

/* These are per-axis parameters for passing additional motor record information to the driver */
#define motorRecResolutionString        "MOTOR_REC_RESOLUTION"
#define motorRecDirectionString         "MOTOR_REC_DIRECTION"
#define motorRecOffsetString            "MOTOR_REC_OFFSET"
prjemian commented 1 year ago

The IOC st.cmd file calls these lines:

motorSimCreate($(CONTROLLER=0), 0, $(LOW_LIM=-32000), $(HIGH_LIM=32000), $(HOME_POS=0), 1, $(NUM_AXES=1))
drvAsynMotorConfigure("$(INSTANCE)$(CONTROLLER=0)", "$(INSTANCE)", $(CONTROLLER=0), $(NUM_AXES=1))

# this line overrides MOTOR/iocsh/motorSim.iocsh
dbLoadTemplate("./substitutions/motorSim.substitutions", "P=$(PREFIX), DTYP='asynMotor', PORT=$(INSTANCE)$(CONTROLLER=0), DHLM=$(HIGH_LIM=32000), DLLM=$(LOW_LIM=-32000)")

where ./substitutions/motorSim.substitutions contains:

file "$(MOTOR)/db/asyn_motor.db"
{
pattern
{N, M, ADDR, DESC, EGU, DIR, VELO, VBAS, ACCL, BDST, BVEL, BACC, MRES, PREC, DLLM, DHLM, INIT}
{1, "m1", 0, "motor 1", degrees, Pos, 1, .1, .2, 0, 1, .2, 1e-4, 4, -1000, 1000, ""}
{2, "m2", 1, "motor 2", degrees, Pos, 1, .1, .2, 0, 1, .2, 1e-4, 4, -1000, 1000, ""}
{3, "m3", 2, "motor 3", degrees, Pos, 1, .1, .2, 0, 1, .2, 1e-4, 4, -1000, 1000, ""}
{4, "m4", 3, "motor 4", degrees, Pos, 1, .1, .2, 0, 1, .2, 1e-4, 4, -1000, 1000, ""}
{5, "m5", 4, "motor 5", degrees, Pos, 1, .1, .2, 0, 1, .2, 1e-4, 4, -1000, 1000, ""}
{6, "m6", 5, "motor 6", degrees, Pos, 1, .1, .2, 0, 1, .2, 1e-4, 4, -1000, 1000, ""}
... similar for m7-m54
{55, "m55", 54, "motor 55", degrees, Pos, 1, .1, .2, 0, 1, .2, 1e-4, 4, -1000, 1000, ""}
{56, "m56", 55, "motor 56", degrees, Pos, 1, .1, .2, 0, 1, .2, 1e-4, 4, -1000, 1000, ""}
}

With MOTOR=${SUPPORT}/motor-R7-2-2, the asyn_motor.db file contains these lines pertinent to this issue:

# These records make the motor resolution, offset and direction available to the driver
# which is needed for profile moves and other applications

# Motor direction for this axis
record(longout,"$(P)$(M)Direction") {
    field(DESC, "$(M) direction")
    field(DOL,  "$(P)$(M).DIR CP MS")
    field(OMSL, "closed_loop")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT),$(ADDR))MOTOR_REC_DIRECTION")
}

# Motor offset for this axis
record(ao,"$(P)$(M)Offset") {
    field(DESC, "$(M) offset")
    field(DOL,  "$(P)$(M).OFF CP MS")
    field(OMSL, "closed_loop")
    field(DTYP, "asynFloat64")
    field(OUT,  "@asyn($(PORT),$(ADDR))MOTOR_REC_OFFSET")
    field(PREC, "$(PREC)")
}

# Motor resolution for this axis
record(ao,"$(P)$(M)Resolution") {
    field(DESC, "$(M) resolution")
    field(DOL,  "$(P)$(M).MRES CP MS")
    field(OMSL, "closed_loop")
    field(DTYP, "asynFloat64")
    field(OUT,  "@asyn($(PORT),$(ADDR))MOTOR_REC_RESOLUTION")
    field(PREC, "$(PREC)")
}
prjemian commented 1 year ago

See #24, which recommends applying a differences patch to comment out the three records which use these symbols.

prjemian commented 1 year ago

GUI screens orient.ui, orient_full.ui, the motors screen from those two, and orient9.ui all show white boxes for PVs that did not connect.

Some of the white screens reference $(P)SM1 - $(P)SM4 which are not created in the IOC.

prjemian commented 1 year ago

Other white screens (in caQtDM) are due to an undefined $(O) macro. The xxx.ui that calls this screen has this configuration:

             <property name="files">
              <string>orient.ui;orient9.ui</string>
             </property>
             <property name="args">
              <string>P=$(P),O=_0,PM=$(P),mTTH=SM1,mTH=SM2,mCHI=SM3,mPHI=SM4;P=$(P),PM=$(P),mTTH=SM1,mTH=SM2,mCHI=SM3,mPHI=SM4</string>
             </property>

The macro needs to be added to the call to the second file. Same problem in the MEDM file. AND, the motor assignments are different in this IOC instance.

        display[1] {
                label="orient9"
                name="orient9.adl"
                args="P=$(P),PM=$(P),mTTH=m9,mTH=m10,mCHI=m11,mPHI=m12"
        }
prjemian commented 1 year ago

The orient9 screen also relies on additional database or template file to support the p4, p3, p2, p1, m1, m2, m3, m4 rows. Each of these are shown on a orient_slave screen. Need to identify and enable that support to gain these features.

prjemian commented 1 year ago

The xxx.ui screen needs XXX replaced with the the IOC prefix here:

         <property name="text">
          <string>XXX</string>
         </property>
prjemian commented 1 year ago

In the image, when the IOC is started, rename the xxx screen file to iocPRE (PREFIX without trailing :).

prjemian commented 1 year ago

In IOCGP, supply names for scaler1 channels. Use the names from the APS Bluesky Training repo:

channel name
1 timebase
2 I0
3 scint
4 diode
5 I000
6 I0
prjemian commented 1 year ago

Update the documentation and this will be ready to merge.

prjemian commented 1 year ago

Pushed the new prjemian/synapps image v2.0.0 to dockerhub. It's available now.