EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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  <20252026  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  <20252026 
<== Date ==> <== Thread ==>

Subject: Re: help requested about motorPI module
From: Dariush Hampai via Tech-talk <[email protected]>
To: "Peterson, Kevin M." <[email protected]>, "[email protected]" <[email protected]>
Date: Wed, 6 Aug 2025 12:05:31 +0200
Hi Kevin,
following the mail of 8 July by Matt, have you included to PIGCS2 the src file for the chain mode?
By this, I will update the module in order to use PIGCS2...
awaiting your reply

Dariush

Il 14/07/2025 16:55, Dariush Hampai ha scritto:
Hi Kevin
following your suggestions I modify the PI_C663.cmd as following:
#drvAsynSerialPortConfigure("serial1", "/dev/ttyS0", 0, 0, 0)

dbLoadTemplate("PI_C663.substitutions")

# PI C-663 driver setup parameters:
#     (1) maximum number of controllers in system
#     (2) motor task polling rate (min=1Hz,max=60Hz)
PIC663Setup(2, 10)

# PI C-663 driver configuration parameters:
#     (1) controller# being configured
#     (2) ASYN port name
#     (3) address (GPIB only)
PIC663Config(0, "serial_pi_1")
#!drvPIC844debug = 4

1) However, is it right "PIC663Config(0, "serial_pi_1")", or "0 controller# being configured?

PI_C663.substitutions as
file "$(MOTOR)/db/motor.db"
{
pattern
{P,     N,  M,        DTYP,      C,  S,  DESC,          EGU, DIR, VELO,  VBAS,  ACCL,  BDST,  BVEL,  BACC,  MRES,  PREC, DHLM, DLLM,  INIT} {pi_1:,   1,  "m$(N)",  "PIC663",  0,  0,  "L-611.90 $(N)", degrees,  Pos,  25,     .1,    200,    0,     1,     .2, 102400, 4,     1000000,   -100,  ""} {pi_1:,   2,  "m$(N)",  "PIC663",  0,  0,  "PLS-85 $(N)",  mm, Pos,  10,     .2,    200,    0,     1,     .2,    409600,  3, 102,   -1,  ""}
}

2) running the st.cmd I obtain errors on controller cards:

[xlabsrv2@xlabsrv2 iocPI]$ ./st.cmd
#!../../bin/linux-x86_64/pi
## You may have to change pi to something else
## everywhere it appears in this file
< envPaths
epicsEnvSet("IOC","iocPI")
epicsEnvSet("TOP","/home/xlabsrv2/epics/IOCs/piIOC")
epicsEnvSet("SUPPORT","/home/xlabsrv2/epics/synApps_6_3/support/")
epicsEnvSet("ASYN","/home/xlabsrv2/epics/synApps_6_3/support//asyn-R4-44-2") epicsEnvSet("STREAM","/home/xlabsrv2/epics/synApps_6_3/support//StreamDevice-2-8-24") epicsEnvSet("MOTOR","/home/xlabsrv2/epics/synApps_6_3/support/motor-R7-3-1")
epicsEnvSet("EPICS_BASE","/home/xlabsrv2/epics")
epicsEnvSet("SNCSEQ","/home/xlabsrv2/epics/synApps_6_3/support//sequencer-mirror-R2-2-9") epicsEnvSet("BUSY","/home/xlabsrv2/epics/synApps_6_3/support//busy-R1-7-4")
epicsEnvSet("IPAC","/home/xlabsrv2/epics/synApps_6_3/support//ipac-2-16")
epicsEnvSet("LUA","/home/xlabsrv2/epics/synApps_6_3/support//lua-R3-1")
######cd "${TOP}"
## Register all support components
dbLoadDatabase "../../dbd/pi.dbd"
pi_registerRecordDeviceDriver pdbbase
#####cd "${TOP}/iocBoot/${IOC}"
## motorUtil (allstop & alldone)
dbLoadRecords("/home/xlabsrv2/epics/synApps_6_3/support/motor-R7-3-1/db/motorUtil.db", "P=pi_1:")
drvAsynIPPortConfigure("serial_pi_1","100.100.0.11:4001",0,0,0)
asynOctetSetInputEos("serial_pi_1",0,"\n")
asynOctetSetOutputEos("serial_pi_1",0,"\n")
##
< PI_C663.cmd
#drvAsynSerialPortConfigure("serial1", "/dev/ttyS0", 0, 0, 0)
dbLoadTemplate("PI_C663.substitutions")
# PI C-663 driver setup parameters:
#     (1) maximum number of controllers in system
#     (2) motor task polling rate (min=1Hz,max=60Hz)
PIC663Setup(2, 10)
# PI C-663 driver configuration parameters:
#     (1) controller# being configured
#     (2) ASYN port name
#     (3) address (GPIB only)
PIC663Config(0, "serial_pi_1")
#!drvPIC844debug = 4
#!< PI_C844.cmd
#!< PI_C848.cmd
#!< PI_E662.cmd
#!< PI_C862.cmd
#!< PI_E816.cmd
iocInit
Starting iocInit
############################################################################
## EPICS R7.0.8.2-DEV
## Rev. R7.0.8.1-142-g144f9756eac4e800f18d
## Rev. Date Git: 2025-02-05 10:16:16 -0600
############################################################################ recGblRecordError: motor_init_record_com(): card does not exist! Illegal field value PV: pi_1:m1 recGblRecordError: motor_init_record_com(): card does not exist! Illegal field value PV: pi_1:m2
iocRun: All initialization complete
## motorUtil (allstop & alldone)
motorUtilInit("pi_1:")
# Boot complete
epics>


What am I wrong?

awaiting your reply
Dariush

p.s.: @Matt, following your PIGC2 mod module, I can use it once it will be implemented in official version...


Il 11/07/2025 18:42, Peterson, Kevin M. ha scritto:
Dariush,

The support in motorPI is very limited compared to the support in motorPIGCS2.  I don't know if copying the C-844 support and renaming it for the C-663 will work.  If it does work, it would be difficult to add missing features to the motorPI support, because the drivers are model-1 drivers, which aren't easily extensible.

A simpler approach would be to use one serial port per C-663 and use motorPIGCS2 or do use the old verison of motorPIGCS2 that supports daisy-chaining.

I will attempt to answer your questions:

1. That st.cmd looks ok to me.

2. In the PI_C663.cmd, this line only specifies one controller:

PIC663Setup(1, 10)

I would change it to support two controllers:

PIC663Setup(2, 10)

3. Macro explanations:

N = a macro that is usually only used to set both the motor name (M) and description (DESC) fields to "m$(N)."  This isn't actually a macro that is required by the database and can be exlcuded if none of the values use "$(N)".
M = the motor's name.  The full record name of the motor is "$(P)$(M)"
C = card index (starting from zero)
S = slot index (starting from zero)

For a daisy chain of multi-axis controllers, C is usually the index of the controller and S is usually the index of the motor.  Some controllers, however, are smart enough to know that multiple controllers are daisy chained and and present themselves as a single controller (C=0 for all axes), so the S in that case would range from 0 to (num controllers * num axes per control - 1).

I don't know how the daisy-chain addressing works with the C-663 controller, so I don't know if the motor record for the 2nd axis should have C=0 & S=1 or C=1 and S=0.

Kevin

--
************************************

Dr. Dariush Hampai, PhD

INFN - LNF
X-Lab Frascati
Via E. Fermi, 54 (ex 40)
I-00044 Frascati (RM)
Italy

Mail Address:
XLab-Frascati
LNF-INFN
Casella Postale 13
Frascati (RM)
Italy

Room:	+39.06.9403.5248
Lab.:	+39.06.9403.2286
Mob.:	+39.06.9403.8025
Fax.:	+39.06.9403.2597

************************************



References:
Re: help requested about motorPI module Dariush Hampai via Tech-talk

Navigate by Date:
Prev: Re: Stopping DB and DBD files being copied to top level Wells, Alex (DLSLtd,RAL,LSCI) via Tech-talk
Next: AreaDetector Collaboration Meeting - August 7th Érico Nogueira Rolim via Tech-talk
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  <20252026 
Navigate by Thread:
Prev: Re: help requested about motorPI module Dariush Hampai via Tech-talk
Next: Re: help requested about motorPI module Dariush Hampai via Tech-talk
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  <20252026 
ANJ, 19 Mar 2026 · Home · News · About · Talk · Base · Modules · Extensions ·
· Distributions · Download · Documents · Links · Licensing ·