Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add securuity group and extra parameters #788

Merged
merged 4 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MCLEN/MCLEN-IOC-01App/Db/mclen_motor_extra.db
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ record(motor, "$(P)$(M)") {
field(PCOF, "$(PCOF)")
field(HVEL, "$(HVEL)")
field(RDBD, "$(RDBD)")
field(ASG, "WASL0")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything including the SPs and home/stop buttons are disabled for me - do I need some sort of access control file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was being stupid, accessSecurity submodule was out of date

Copy link
Contributor

@rerpha rerpha Jun 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can still change OFF, SET, FOFF, CNEN and BDST - probably don't want to do at least the first one?i'm not sure we ever set BDST to anything other than 0.

Copy link
Member Author

@FreddieAkeroyd FreddieAkeroyd Jun 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do set BSDT on some Galil systems, in fact SANS2D tank might be one of them, but probably won't set it on a mclennan as it has its own backup steps controller parameter. My concern with protecting OFF/SET is don't reflectometer scientists use it - home to neutrons and then define that as zero? This is more thinking of using this more widely, OFF should ideally be protected on a Mclennan as it is a macro, but we are limited in access control levels so we may need to leave it unprotected. The key things to protect here, and the driver for the ticket, was to avoid confusion when electronics/mechatronics group are trying to fault find a mclennan that doesn't move (properly). So they are likely to try and change ERES/MRES/UEIP/ACCL/VELO etc as part of this so they need to be protected to avoid confusion. I feel they are unlikely to try and change OFF in this case, though in an ideal world we would protect it for a mclennan

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While looking at this is did however make me realise we need to protect the status update button too ISISComputingGroup/IBEX#7837

}
93 changes: 60 additions & 33 deletions MCLEN/iocBoot/iocMCLEN-IOC-01/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,23 @@
<macro name="ERES7" pattern="^-?[0-9]+/[0-9]+$" description="Encoder ratio (default: 400/4096)" defaultValue="400/4096" hasDefault="YES" />
<macro name="ERES8" pattern="^-?[0-9]+/[0-9]+$" description="Encoder ratio (default: 400/4096)" defaultValue="400/4096" hasDefault="YES" />

<macro name="DHLM1" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (default: 200)" defaultValue="200" hasDefault="YES" />
<macro name="DHLM2" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (default: 200)" defaultValue="200" hasDefault="YES" />
<macro name="DHLM3" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (default: 200)" defaultValue="200" hasDefault="YES" />
<macro name="DHLM4" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (default: 200)" defaultValue="200" hasDefault="YES" />
<macro name="DHLM5" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (default: 200)" defaultValue="200" hasDefault="YES" />
<macro name="DHLM6" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (default: 200)" defaultValue="200" hasDefault="YES" />
<macro name="DHLM7" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (default: 200)" defaultValue="200" hasDefault="YES" />
<macro name="DHLM8" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (default: 200)" defaultValue="200" hasDefault="YES" />

<macro name="DLLM1" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DLLM2" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DLLM3" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DLLM4" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DLLM5" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DLLM6" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DLLM7" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DLLM8" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DHLM1" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (units) (default: 200)" defaultValue="200" hasDefault="YES" />
<macro name="DHLM2" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (units) (default: 200)" defaultValue="200" hasDefault="YES" />
<macro name="DHLM3" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (units) (default: 200)" defaultValue="200" hasDefault="YES" />
<macro name="DHLM4" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (units) (default: 200)" defaultValue="200" hasDefault="YES" />
<macro name="DHLM5" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (units) (default: 200)" defaultValue="200" hasDefault="YES" />
<macro name="DHLM6" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (units) (default: 200)" defaultValue="200" hasDefault="YES" />
<macro name="DHLM7" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (units) (default: 200)" defaultValue="200" hasDefault="YES" />
<macro name="DHLM8" pattern="^-?[0-9]*\.?[0-9]*$" description="Position upper limit (units) (default: 200)" defaultValue="200" hasDefault="YES" />

<macro name="DLLM1" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (units) (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DLLM2" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (units) (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DLLM3" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (units) (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DLLM4" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (units) (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DLLM5" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (units) (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DLLM6" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (units) (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DLLM7" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (units) (default: -200)" defaultValue="-200" hasDefault="YES" />
<macro name="DLLM8" pattern="^-?[0-9]*\.?[0-9]*$" description="Position lower limit (units) (default: -200)" defaultValue="-200" hasDefault="YES" />

<macro name="CMOD1" pattern="^(OPEN|CLOSED)$" description="Loop control mode (default: CLOSED)" defaultValue="CLOSED" hasDefault="YES" />
<macro name="CMOD2" pattern="^(OPEN|CLOSED)$" description="Loop control mode (default: CLOSED)" defaultValue="CLOSED" hasDefault="YES" />
Expand All @@ -111,14 +111,14 @@
<macro name="CMOD7" pattern="^(OPEN|CLOSED)$" description="Loop control mode (default: CLOSED)" defaultValue="CLOSED" hasDefault="YES" />
<macro name="CMOD8" pattern="^(OPEN|CLOSED)$" description="Loop control mode (default: CLOSED)" defaultValue="CLOSED" hasDefault="YES" />

<macro name="HOME1" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME2" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME3" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME4" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME5" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME6" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME7" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME8" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME1" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero, 5: forward limit, reverse home and zero, 6: Reverse limit, forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME2" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero, 5: forward limit, reverse home and zero, 6: Reverse limit, forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME3" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero, 5: forward limit, reverse home and zero, 6: Reverse limit, forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME4" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero, 5: forward limit, reverse home and zero, 6: Reverse limit, forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME5" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero, 5: forward limit, reverse home and zero, 6: Reverse limit, forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME6" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero, 5: forward limit, reverse home and zero, 6: Reverse limit, forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME7" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero, 5: forward limit, reverse home and zero, 6: Reverse limit, forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />
<macro name="HOME8" pattern="^([0-4])$" description="Homing mode [0: Hardware defined, 1: Constant velocity move, 2: Reverse home and zero, 3. Constant velocity move and zero, 4: Forward home and zero, 5: forward limit, reverse home and zero, 6: Reverse limit, forward home and zero] (default: 1)" defaultValue="1" hasDefault="YES" />

<macro name="NAME1" pattern="^[\x20-\x7E]*$" description="Name used to identify the motor" hasDefault="NO"/>
<macro name="NAME2" pattern="^[\x20-\x7E]*$" description="Name used to identify the motor" hasDefault="NO"/>
Expand All @@ -129,14 +129,41 @@
<macro name="NAME7" pattern="^[\x20-\x7E]*$" description="Name used to identify the motor" hasDefault="NO"/>
<macro name="NAME8" pattern="^[\x20-\x7E]*$" description="Name used to identify the motor" hasDefault="NO"/>

<macro name="OFST1" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST2" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST3" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST4" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST5" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST6" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST7" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST8" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST1" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (units) (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST2" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (units) (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST3" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (units) (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST4" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (units) (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST5" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (units) (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST6" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (units) (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST7" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (units) (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="OFST8" pattern="-?[0-9]*\.?[0-9]*$" description="Motor offset (units) (default: 0)" defaultValue="0" hasDefault="YES" />

<macro name="BOST1" pattern="-?[0-9]*$" description="Backoff steps (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="BOST2" pattern="-?[0-9]*$" description="Backoff steps (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="BOST3" pattern="-?[0-9]*$" description="Backoff steps (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="BOST4" pattern="-?[0-9]*$" description="Backoff steps (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="BOST5" pattern="-?[0-9]*$" description="Backoff steps (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="BOST6" pattern="-?[0-9]*$" description="Backoff steps (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="BOST7" pattern="-?[0-9]*$" description="Backoff steps (default: 0)" defaultValue="0" hasDefault="YES" />
<macro name="BOST8" pattern="-?[0-9]*$" description="Backoff steps (default: 0)" defaultValue="0" hasDefault="YES" />

<macro name="CRST1" pattern="[0-9]*$" description="Creep steps (default: 10)" defaultValue="10" hasDefault="YES" />
<macro name="CRST2" pattern="[0-9]*$" description="Creep steps (default: 10)" defaultValue="10" hasDefault="YES" />
<macro name="CRST3" pattern="[0-9]*$" description="Creep steps (default: 10)" defaultValue="10" hasDefault="YES" />
<macro name="CRST4" pattern="[0-9]*$" description="Creep steps (default: 10)" defaultValue="10" hasDefault="YES" />
<macro name="CRST5" pattern="[0-9]*$" description="Creep steps (default: 10)" defaultValue="10" hasDefault="YES" />
<macro name="CRST6" pattern="[0-9]*$" description="Creep steps (default: 10)" defaultValue="10" hasDefault="YES" />
<macro name="CRST7" pattern="[0-9]*$" description="Creep steps (default: 10)" defaultValue="10" hasDefault="YES" />
<macro name="CRST8" pattern="[0-9]*$" description="Creep steps (default: 10)" defaultValue="10" hasDefault="YES" />

<macro name="SETL1" pattern="[0-9]*$" description="Settle time (ms) (default: 100)" defaultValue="100" hasDefault="YES" />
<macro name="SETL2" pattern="[0-9]*$" description="Settle time (ms) (default: 100)" defaultValue="100" hasDefault="YES" />
<macro name="SETL3" pattern="[0-9]*$" description="Settle time (ms) (default: 100)" defaultValue="100" hasDefault="YES" />
<macro name="SETL4" pattern="[0-9]*$" description="Settle time (ms) (default: 100)" defaultValue="100" hasDefault="YES" />
<macro name="SETL5" pattern="[0-9]*$" description="Settle time (ms) (default: 100)" defaultValue="100" hasDefault="YES" />
<macro name="SETL6" pattern="[0-9]*$" description="Settle time (ms) (default: 100)" defaultValue="100" hasDefault="YES" />
<macro name="SETL7" pattern="[0-9]*$" description="Settle time (ms) (default: 100)" defaultValue="100" hasDefault="YES" />
<macro name="SETL8" pattern="[0-9]*$" description="Settle time (ms) (default: 100)" defaultValue="100" hasDefault="YES" />

</macros>
<pvsets>
Expand Down
18 changes: 9 additions & 9 deletions MCLEN/iocBoot/iocMCLEN-IOC-01/st-motor-init.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@ asynOctetWrite("MKINIT","$(MN)TR4000")
asynOctetWrite("MKINIT","$(MN)SL0")

## backoff steps as 0
#asynOctetWrite("MKINIT","$(MN)BO0")
asynOctetWrite("MKINIT","$(MN)BO$(BOSTI)")

## creep steps at end of move
#asynOctetWrite("MKINIT","$(MN)CR10")
#asynOctetWrite("MKINIT","$(MN)CR5")
## creep steps at end of move, 10 is default for stepper
asynOctetWrite("MKINIT","$(MN)CR$(CRSTI)")

## creep speed, 800 is default
#asynOctetWrite("MKINIT","$(MN)CS250")
asynOctetWrite("MKINIT","$(MN)SC$(CRSPI)")

## settle time, how long must remain in Window at end of move
#asynOctetWrite("MKINIT","$(MN)SE1000")
## settle time, how long must remain in Window at end of move, 100 is default
asynOctetWrite("MKINIT","$(MN)SE$(SETLI)")

## set abort mode, controller default is 00000000
## however passing 00111000 for example would make stall error, tracking error and timeout error not abort motion
asynOctetWrite("MKINIT","$(MN)AM00000000")

## set datum mode, controller default is 00000000
## this also controls expected encoder index polarity, automatic direction search etc. on datum
## not set at moment
## so not set at moment in case mess up encoder? It is partly adjusted in the main
## driver depending on homing mode
#asynOctetWrite("MKINIT","$(MN)DM00000000")

## note: SH command generally not set here, if we chose appropriate hardware home
## it will do a SH0 before himing to datum and applying it
## main driver will do a SH0 before homing to datum if in appropriate mode
#asynOctetWrite("MKINIT","$(MN)SH0")
7 changes: 7 additions & 0 deletions MCLEN/iocBoot/iocMCLEN-IOC-01/st-motor.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ dcalc("MRESI", "1.0/$(MSTPI)", 1, 12)
dcalc("JVELCALC", "0.1*$(VELOI)",1,3)
dcalc("HVELCALC", "0.1*$(VELOI)",1,3)

# 10 creep steps is hardware default for a stepper
epicsEnvSet("CRSTI",$(CRST$(MN)=10))

epicsEnvSet("BOSTI",$(BOST$(MN)=0))
epicsEnvSet("SETLI",$(SETL$(MN)=100))
epicsEnvSet("CRSPI",$(CRSP$(MN)=800))

## calculate what the encoder resolution (in motor record terms) is just to get
## a correct retry deadband. We leave motor record ERES as 0 as not used by
## driver. we need an appropriate retry deadband in case retries are enabled
Expand Down