1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 <2018> 2019 2020 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 <2018> 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Problems with soft motors |
From: | "Mooney, Tim M." <[email protected]> |
To: | "Rivers, Mark L." <[email protected]>, "Peterson, Kevin M." <[email protected]>, "Johnson, Andrew N." <[email protected]> |
Cc: | "'[email protected]'" <[email protected]> |
Date: | Sat, 8 Sep 2018 03:30:00 +0000 |
Hi Mark,
Awesome. I don't have the understanding of the differences between 3.15 and EPICS 7 to guess how they are actually playing underneath. It seems to me this code should not only be modified, but rethought. I think we should think of it as an initial stab at a soft motor, for the purpose of enabling the study of problems in writing databases involving several soft motors, and it served pretty well for that purpose. But I have never thought DINP should be handled in this way. Unfortunately, I can't now remember why I thought that, and I can't study it now because I'm on travel next week and have to prepare.
Tim Mooney ([email protected]) (630)252-5417
Beamline Controls Group (www.aps.anl.gov) Advanced Photon Source, Argonne National Lab From: Mark Rivers <[email protected]>
Sent: Friday, September 7, 2018 6:20:14 PM To: Mooney, Tim M.; Peterson, Kevin M.; Johnson, Andrew N. Cc: '[email protected]' Subject: RE: Problems with soft motors I’ve figured out why it is not adding the dinp link for some motors.
This is the current code with my previous fix:
if (mr->dinp.value.constantStr == NULL) ptr->default_done_behavior = true; else if (mr->dinp.value.pv_link.pvname != NULL) { ptr->default_done_behavior = false; printf("devSoftAux::soft_motor_task: adding dinp link for motor %s link=%s\n", mr->name, mr->dinp.value.pv_link.pvname); SEVCHK(ca_search(mr->dinp.value.pv_link.pvname, &dinp), "ca_search() failure");
The problem is that for motors pm2, pm4, pm6 mr->dinp.value.constantStr is NULL, so it does not call the ca_search.
I don’t understand link structures well enough to understand why for some records mr->dinp.value.constantStr is NULL, while for others it is not. For all motors mr->dinp.value.pv_link.pvname contains the correct value.
I can fix the problems completely by changing the code to the following:
if (mr->dinp.value.pv_link.pvname == NULL) ptr->default_done_behavior = true; else { ptr->default_done_behavior = false; printf("devSoftAux::soft_motor_task: adding dinp link for motor %s link=%s\n", mr->name, mr->dinp.value.pv_link.pvname); SEVCHK(ca_search(mr->dinp.value.pv_link.pvname, &dinp), "ca_search() failure");
So I am replacing the test mr->dinp.value.constantStr==NULL with the test mr->dinp.value.pv_link.pvname==NULL. But I don’t know if this is the desired behavior when the DINP field is not defined.
Thanks, Mark
From: Mark Rivers
Hi Tim,
Ø Do you see the error message "cannot find dbCaLink task." in the IOC console output after iocInit?
No, but there are definitely problems in devSoftAux.cc.
I have found that there were 2 problems.
1) devSoftAux::soft_motor_task has calls to the CA library like this: SEVCHK(ca_search(mr->dinp.value.pv_link.pvname, &dinp), "ca_search() failure");
This means that if there is a CA error then it kills the task and no other needed CA callbacks get established. In one of my IOCs where no soft motor callbacks were happening at all, this was the issue. The soft_motor_task did not exist, whereas it did exist in all the other IOCs. I tracked the problem down to one soft motor in the system that does not have string defined for the DINP link. In previous versions of base this worked OK. However, in base 7 it caused the task to exit with the following error:
CA.Client.Exception............................................... Error: "Invalid string" Context: "ca_search() failure" Source File: ../devSoftAux.cc line 172 Current Time: TUE SEP 04 2018 13:39:36.049462058
This is the code that did it:
if (mr->dinp.value.constantStr == NULL) ptr->default_done_behavior = true; else { ptr->default_done_behavior = false; SEVCHK(ca_search(mr->dinp.value.pv_link.pvname, &dinp), "ca_search() failure");
The problem is that since when the link is not defined dinp.value.pv_link.pvname is NULL, and ca_search returns an error. I don’t know why this worked in 3.14 and 3.15, but it did. I was able to fix this problem by not calling the CA functions if dinp.value.pv_link.pvname is NULL.
if (mr->dinp.value.constantStr == NULL) ptr->default_done_behavior = true; else if (mr->dinp.value.pv_link.pvname != NULL) { ptr->default_done_behavior = false; printf("devSoftAux::soft_motor_task: adding dinp link for motor %s link=%s\n", mr->name, mr->dinp.value.pv_link.pvname); SEVCHK(ca_search(mr->dinp.value.pv_link.pvname, &dinp), "ca_search() failure");
I also temporarily added the debugging printf for each type of link that gets callbacks established in this function. That let me see what the second problem is.
2) The second problem is exposed with the printf statements added when the callbacks are established. This is what I see during iocInit: devSoftAux::soft_motor_task: adding dinp link for motor 13BMA:pm1 link=13BMA:KBVB:Done devSoftAux::soft_motor_task: adding urip link for motor 13BMA:pm1 link=13BMA:KBVB:Readback.G devSoftAux::soft_motor_task: adding urip link for motor 13BMA:pm2 link=13BMA:KBVB:Readback.H devSoftAux::soft_motor_task: adding dinp link for motor 13BMA:pm3 link=13BMA:KBVP:Done devSoftAux::soft_motor_task: adding urip link for motor 13BMA:pm3 link=13BMA:KBVP:Readback.G devSoftAux::soft_motor_task: adding urip link for motor 13BMA:pm4 link=13BMA:KBVP:Readback.H devSoftAux::soft_motor_task: adding dinp link for motor 13BMA:pm5 link=13BMA:KBVT:Done devSoftAux::soft_motor_task: adding urip link for motor 13BMA:pm5 link=13BMA:KBVT:Readback.G devSoftAux::soft_motor_task: adding urip link for motor 13BMA:pm6 link=13BMA:KBVT:Readback.H
The above output shows the problem. For each soft motor it should be adding callbacks for both the dinp (done moving) and urip (position) links. It is correctly adding the urip link for each motor. However, it is only adding the dinp links for every other motor (pm1, pm3, pm5). It is not adding the dinp link for (pm2,pm4,pm6).
I don’t understand this, since pm1 and pm2 seem to be defined identically for their DINP links.
ioc13bma> dbpr "13BMA:pm1",2 ACCL: 0.1 ACKS: NO_ALARM ACKT: YES ADEL: 0 ASG: ATHM: 0 BACC: 0.1 BDST: 0 BKPT: 00 BVEL: 1 CDIR: 0 CNEN: Disable DCOF: 0 DESC: Curvature DHLM: 10000 DIFF: 0 DINP:DB_LINK 13BMA:KBVB:Done NPP NMS DIR: Pos DISA: 0 DISP: 0 DISS: NO_ALARM DISV: 1 DLLM: -10000 DLY: 0 DMOV: 1 DOL:CONSTANT DRBV: 0.25 DTYP: Soft Channel DVAL: 0.25 EGU: mm ERES: 1.0e-04 EVNT: FLNK:CONSTANT FOF: 0 FOFF: Frozen FRAC: 1 HHSV: NO_ALARM HIGH: 0 HIHI: 0 HLM: 10000 HLS: 0 HLSV: NO_ALARM HOMF: 0 HOMR: 0 HOPR: 0 HSV: NO_ALARM HVEL: 0.1 ICOF: 0 IGSET: 0 INIT: JAR: 10 JOGF: 0 JOGR: 0 JVEL: 1 LCNT: 0 LDVL: 0.25 LLM: -10000 LLS: 0 LLSV: NO_ALARM LOCK: NO LOLO: 0 LOPR: 0 LOW: 0 LRLV: 0 LRVL: 2500 LSPG: Go LSV: NO_ALARM LVAL: 0.25 LVIO: 0 MDEL: 0 MISS: 0 MOVN: 0 MRES: 1.0e-04 NAME: 13BMA:pm1 NSEV: NO_ALARM NSTA: NO_ALARM NTM: NO NTMF: 2 OFF: 0 OMSL: supervisory OUT:DB_LINK 13BMA:pm1DVAL.VAL PP MS PACT: 0 PCOF: 0 PHAS: 0 PINI: NO POST: PP: 0 PREC: 3 PREM: PRIO: LOW PUTF: 0 RBV: 0.25 RCNT: 0 RDBD: 1.0e-04 RDBL:DB_LINK 13BMA:KBVB:Readback.G NPP NMS RDIF: 0 REP: 0 RHLS: 0 RINP:CONSTANT RLLS: 0 RLNK:CONSTANT RLV: 0 RMOD: Default RMP: 2500 RPRO: 0 RRBV: 2500 RRES: 1 RTRY: 0 RVAL: 2500 RVEL: 0 S: 50 SBAK: 50 SBAS: 5 SCAN: Passive SDIS:CONSTANT SET: Use SEVR: NO_ALARM SMAX: 50 SPMG: Go SREV: 200 SSET: 0 STAT: NO_ALARM STOO:DB_LINK 13BMA:KBVB:Stop PP MS STOP: 0 SUSE: 0 SYNC: 0 TDIR: 0 TIME: 2018-09-07 17:04:51.807438608 TPRO: 0 TSE: 0 TSEL:CONSTANT TWF: 0 TWR: 0 TWV: 0.2 UDF: 0 UDFS: INVALID UEIP: No UREV: 0.02 URIP: Yes VAL: 0.25 VBAS: 0.1 VELO: 1 VERS: 6.1 VMAX: 1 VOF: 0 value = 0 = 0x0
ioc13bma> dbpr "13BMA:pm2",2 ACCL: 0.1 ACKS: NO_ALARM ACKT: YES ADEL: 0 ASG: ATHM: 0 BACC: 0.1 BDST: 0 BKPT: 00 BVEL: 1 CDIR: 0 CNEN: Disable DCOF: 0 DESC: Ellipticity DHLM: 10000 DIFF: 0 DINP:DB_LINK 13BMA:KBVB:Done NPP NMS DIR: Pos DISA: 0 DISP: 0 DISS: NO_ALARM DISV: 1 DLLM: -10000 DLY: 0 DMOV: 1 DOL:CONSTANT DRBV: -0.0999 DTYP: Soft Channel DVAL: -0.0999 EGU: mm ERES: 1.0e-04 EVNT: FLNK:CONSTANT FOF: 0 FOFF: Frozen FRAC: 1 HHSV: NO_ALARM HIGH: 0 HIHI: 0 HLM: 10000 HLS: 0 HLSV: NO_ALARM HOMF: 0 HOMR: 0 HOPR: 0 HSV: NO_ALARM HVEL: 0.1 ICOF: 0 IGSET: 0 INIT: JAR: 10 JOGF: 0 JOGR: 0 JVEL: 1 LCNT: 0 LDVL: -0.0999 LLM: -10000 LLS: 0 LLSV: NO_ALARM LOCK: NO LOLO: 0 LOPR: 0 LOW: 0 LRLV: 0 LRVL: -999 LSPG: Go LSV: NO_ALARM LVAL: -0.0999 LVIO: 0 MDEL: 0 MISS: 0 MOVN: 0 MRES: 1.0e-04 NAME: 13BMA:pm2 NSEV: NO_ALARM NSTA: NO_ALARM NTM: NO NTMF: 2 OFF: 0 OMSL: supervisory OUT:DB_LINK 13BMA:pm2DVAL.VAL PP MS PACT: 0 PCOF: 0 PHAS: 0 PINI: NO POST: PP: 0 PREC: 3 PREM: PRIO: LOW PUTF: 0 RBV: -0.0999 RCNT: 0 RDBD: 1.0e-04 RDBL:DB_LINK 13BMA:KBVB:Readback.H NPP NMS RDIF: 0 REP: 0 RHLS: 0 RINP:CONSTANT RLLS: 0 RLNK:CONSTANT RLV: 0 RMOD: Default RMP: -999 RPRO: 0 RRBV: -999 RRES: 1 RTRY: 0 RVAL: -999 RVEL: 0 S: 50 SBAK: 50 SBAS: 5 SCAN: Passive SDIS:CONSTANT SET: Use SEVR: NO_ALARM SMAX: 50 SPMG: Go SREV: 200 SSET: 0 STAT: NO_ALARM STOO:DB_LINK 13BMA:KBVB:Stop PP MS STOP: 0 SUSE: 0 SYNC: 0 TDIR: 0 TIME: 2018-09-07 17:04:51.807438608 TPRO: 0 TSE: 0 TSEL:CONSTANT TWF: 0 TWR: 0 TWV: 0.1 UDF: 0 UDFS: INVALID UEIP: No UREV: 0.02 URIP: Yes VAL: -0.0999 VBAS: 0.1 VELO: 1 VERS: 6.1 VMAX: 1 VOF: 0 value = 0 = 0x0
So one problem is fixed, and I know what the other problem is, but not yet how to fix it.
Mark
From: Mooney, Tim M. <[email protected]>
Hi Mark,
I'll make a wild guess: The function, soft_init(), in motor/motorApp/SoftMotorSrc/devSoftAux.cc, seems vulnerable to changes in EPICS base that might not have had consequences for other code I know of. This code has always seemed a little hinky to me. Do you see the error message "cannot find dbCaLink task." in the IOC console output after iocInit?
Tim Mooney ([email protected]) (630)252-5417 From: Mark Rivers <[email protected]>
Hi, |