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: "Peterson, Kevin M. via Tech-talk" <[email protected]>
To: Dariush Hampai <[email protected]>, "[email protected]" <[email protected]>
Date: Thu, 28 Aug 2025 14:32:14 +0000
Dariush,

Thank you for following up.  I'm sorry I didn't reply sooner.  Your message got lost in a sea of email.

I have not had a chance to look into merging the daisy-chain code.

The following error means the IOC did not recieve a reply from the controller when it first polled the controller during iocInit:

> recGblRecordError: motor_init_record_com(): card does not exist!

There are two ways you can troubleshoot what is happening:

1. Turn on the motor driver debugging by setting the drvPIC663debug to a non-zero value:

var drvPIC663debug 10

2. Turn on asyn traces for the serial_pi_1 port after the call to drvAsynIPPortConfigure and before iocInit:

asynSetTraceIOMask("serial_pi_1", 0, ASCII)
asynSetTraceMask("serial_pi_1", 0, ERROR|DRIVER)

You should see that messages are being sent to the controller but not received.  Specifically, you should see three failed attempts at sending the "VE" command, to query the controllers ID string:

https://urldefense.us/v3/__https://gcc02.safelinks.protection.outlook.com/?url=https*3A*2F*2Fgithub.com*2Fepics-motor*2FmotorPI*2Fblob*2F802e15ebceeb3f5aefdef7a011c453ea005a7d03*2FpiApp*2Fsrc*2FdrvPIC663.cc*23L509-L527&data=05*7C02*7Ctech-talk*40aps.anl.gov*7C77fa803e474c4aeb8ba508dde63faf00*7C0cfca18525f749e38ae7704d5326e285*7C0*7C0*7C638919883371364528*7CUnknown*7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ*3D*3D*7C0*7C*7C*7C&sdata=9QWextKNVAQMkg0F*2F7*2FIdKdQwyOjJFctvQ3mV0aBeVw*3D&reserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUl!!G_uCfscf7eWS!eX8VVFACtDdp6dP1vwXU42WWGwagSW_rW0X5hatH2Fnj-aJHKOfXOT2aX_-DL93I6LoIZRZQSpZiX1SyVQikGTE$ 

Can you share the serial and operating settings of the moxa that is being used to talk to the C-663?

Kevin

________________________________________
From: Dariush Hampai <[email protected]>
Sent: Friday, August 8, 2025 8:37 AM
To: Peterson, Kevin M.; [email protected]
Cc: Rivers, Mark L.; Pearson, Matthew
Subject: Re: help requested about motorPI module

Hi Kevin, awaiting the upgrade of PIGC2 for daisy chain mode, I trid to use the piMotor module. Following your suggestions, the PI_C663. cmd is: dbLoadTemplate("PI_C663. substitutions") # PI C-663 driver setup parameters: #     (1) maximum number
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.

ZjQcmQRYFpfptBannerEnd

Hi Kevin,
awaiting the upgrade of PIGC2 for daisy chain mode, I trid to use the
piMotor module.
Following your suggestions, the PI_C663.cmd is:
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")

and the PI_C663.substitutions is
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",  1,  0,  "PLS-85 $(N)",  mm, Pos,
10,     .2,    200,    0,     1,     .2,    409600,  3, 102,   -1,  ""}
}
(I tried also with C=0 and S=1 for the N=2).
However I receive the following output when start the IOC

  [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


In someway something is wrong (the error led on the controller m1 is on
while the error led of the controlle m2 is off).
Did not understand the meaning of:
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

Moreover on PI_C663.cmd I use
# PI C-663 driver configuration parameters:
#     (1) controller# being configured
#     (2) ASYN port name
#     (3) address (GPIB only)
PIC663Config(0, "serial_pi_1") -> "0" as controller# being configured...
is it right? I have also to put same for the second controller?

awaiting your reply

Dariush

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

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




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

Navigate by Date:
Prev: Re: About motor motion Knap, Giles (DLSLtd,RAL,LSCI) via Tech-talk
Next: Building EPICS base with Yocto Paduan Donadio, Marcio 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 ·