> Ok. I see. Do you know how can I get some information on how to do this?
There is online EPICS training here:
http://www.aps.anl.gov/epics/docs/APS2015.php
Under the Hardware Interfacing section there are 4 talks about motors. I'm pretty sure what you need to know is explained there.
> I mean, is the driver complete and I just need to create the st.cmd file, or is there something else to it?
The driver should be complete, and all you need to do is to create the st.cmd and motors.template files. However, if you need specialized functions in the controller that are not in the current EPICS driver then you might need to enhance
the driver, but probably not.
> Also, where can I find information on writing this kind of file? What language is it written in?
The file is an IOC shell (iocsh) script. The IOC shell is documented here:
http://www.aps.anl.gov/epics/base/R3-15/5-docs/AppDevGuide/IOCShell.html#x19-73300018
You can start an example IOC with simulated motors by doing the following:
cd devel/motor/iocBoot/iocWithAsyn/
../../bin/linux-x86_64/WithAsyn st.cmd.sim
You should then see something like the following:
# The is the ASYN example for communication to 4 simulated motors
# "#!" marks lines that can be uncommented.
< envPaths
epicsEnvSet("IOC","iocWithAsyn")
epicsEnvSet("TOP","/home/epics/devel/motor-6-9")
epicsEnvSet("SUPPORT","/corvette/home/epics/devel")
epicsEnvSet("ASYN","/corvette/home/epics/devel/asyn-4-31")
epicsEnvSet("SNCSEQ","/corvette/home/epics/devel/seq-2-2-4")
epicsEnvSet("BUSY","/corvette/home/epics/devel/busy-1-7")
epicsEnvSet("EPICS_BASE","/corvette/usr/local/epics-devel/base-3.15.5")
epicsEnvSet("IPAC","/corvette/home/epics/devel/ipac-2-14")
dbLoadDatabase("/home/epics/devel/motor-6-9/dbd/WithAsyn.dbd")
WithAsyn_registerRecordDeviceDriver(pdbbase)
dbLoadTemplate("motor.substitutions.sim")
motorSimCreateController("motorSim1", 4)
#asynSetTraceIOMask("motorSim1", 0, 4)
#asynSetTraceMask("motorSim1", 0, 255)
# motorSimConfigAxis(port, axis, lowLimit, highLimit, home, start)
motorSimConfigAxis("motorSim1", 0, 20000, -20000, 500, 0)
motorSimDriver:motorSimConfigAxis: configuring controller motorSim1 axis 0
motorSimConfigAxis("motorSim1", 1, 20000, -20000, 1500, 0)
motorSimDriver:motorSimConfigAxis: configuring controller motorSim1 axis 1
motorSimConfigAxis("motorSim1", 2, 20000, -20000, 2500, 0)
motorSimDriver:motorSimConfigAxis: configuring controller motorSim1 axis 2
motorSimConfigAxis("motorSim1", 3, 20000, -20000, 3000, 0)
motorSimDriver:motorSimConfigAxis: configuring controller motorSim1 axis 3
iocInit
Starting iocInit
############################################################################
## EPICS R3.15.5
## EPICS Base built Apr 17 2017
############################################################################
cas warning: Configured TCP port was unavailable.
cas warning: Using dynamically assigned TCP port 45582,
cas warning: but now two or more servers share the same UDP port.
cas warning: Depending on your IP kernel this server may not be
cas warning: reachable with UDP unicast (a host's IP in EPICS_CA_ADDR_LIST)
iocRun: All initialization complete
You can then type the "help" command to see what commands are available at the IOC shell. The available commands depends on how your application was built.
epics> help
Type 'help <command>' to see the arguments of <command>.
# A3200AsynConfig A3200AsynSetup ACRCreateController
AG_CONEXCreateController AG_UCCreateAxis AG_UCCreateController
ANC150AsynConfig ANC150AsynSetup ClockTime_Report
ClockTime_Shutdown ESP300Config ESP300Setup
EnsembleAsynConfig EnsembleAsynSetup
HXPCreateController IM483PLConfig IM483PLSetup IM483SMConfig
IM483SMSetup ImsMDrivePlusCreateController MAXvConfig MAXvSetup
MCB4BConfig MCB4BCreateController MCB4BSetup MDriveConfig
MDriveSetup MM3000Config MM300Setup MM4000AsynConfig
MM4000AsynSetup MM4000Config MM4000Setup MVP2001CreateAxis
MVP2001CreateController OmsPC68Config OmsPC68Setup PIC630Config
PIC630Setup PIC662Config PIC662Setup PIC663Config PIC663Setup
PIC844Config PIC844Setup PIC848Config PIC848Setup PIC862Config
PIC862Setup PIE516Config PIE516Setup PIE517Config PIE517Setup
PIE710Config PIE710Setup PIE816Config PIE816Setup
PI_GCS2_CreateController PM304Config PM304Setup PM500Config
PM500Setup SC800Config SC800Setup SMC100CreateController
SMChydraCreateController SmartMotorConfig
SmartMotorSetup SoloistConfig SoloistSetup
WithAsyn_registerRecordDeviceDriver XPSAuxConfig XPSConfig
XPSConfigAxis XPSCreateAxis XPSCreateController
XPSCreateProfile XPSDisableAutoEnable XPSDisablePoll
XPSEnableMoveToHome XPSEnableMovingMode
XPSEnableSetPosition XPSGathering XPSInterpose
XPSNoDisableError XPSSetPosSleepTime XPSSetup
asDumpHash asInit asSetFilename asSetSubstitutions
ascar asdbdump asphag aspmem asprules
aspuag astac asynAutoConnect asynEnable
asynInterposeEosConfig asynInterposeFlushConfig
asynMotorEnableMoveToHome asynOctetConnect
asynOctetDisconnect asynOctetFlush asynOctetGetInputEos
asynOctetGetOutputEos asynOctetRead asynOctetSetInputEos
asynOctetSetOutputEos asynOctetWrite asynOctetWriteRead
asynRegisterTimeStampSource asynReport asynSetAutoConnectTimeout
asynSetMinTimerPeriod asynSetOption asynSetTraceFile
asynSetTraceIOMask asynSetTraceIOTruncateSize
asynSetTraceInfoMask asynSetTraceMask asynShowOption
asynUnregisterTimeStampSource asynWaitConnect callbackParallelThreads
callbackSetQueueSize casr cd coreRelease
date dbDumpBreaktable dbDumpDevice dbDumpDriver
dbDumpField dbDumpFunction dbDumpMenu dbDumpPath dbDumpRecord
dbDumpRecordType dbDumpRegistrar dbDumpVariable dbLoadDatabase
dbLoadRecords dbLoadTemplate dbLockShowLocked dbNotifyDump
dbPutAttribute dbPvdDump dbPvdTableSize dbReportDeviceConfig
dbStateClear dbStateCreate dbStateSet dbStateShow dbStateShowAll
dba dbap dbb dbc dbcar
dbd dbel dbgf dbgrep dbhcr
dbior dbl dbla dblsr dbnr
dbp dbpf dbpr dbs dbsr
dbstat dbtgf dbtpf dbtpn dbtr
drvAsynIPPortConfigure drvAsynIPServerPortConfigure
drvAsynMotorConfigure drvAsynSerialPortConfigure echo
eltc epicsEnvSet epicsEnvShow epicsMutexShowAll
epicsParamShow epicsPrtEnvParams epicsThreadResume
epicsThreadShow epicsThreadShowAll epicsThreadSleep
errlog errlogInit errlogInit2 exit
generalTimeReport gft help
installLastResortEventProvider iocBuild iocInit iocLogInit
iocLogPrefix iocLogShow iocPause iocRun iocshCmd
iocshLoad iocshRun listMovingMotors
motorSimConfigAxis motorSimCreate motorSimCreateController
motorUtilInit oms58Setup pft phytronCreateAxis
phytronCreateController postEvent printChIDlist pwd
registryDeviceSupportFind registryDriverSupportFind registryDump
registryFunctionFind registryRecordTypeFind
scanOnceSetQueueSize scanpel scanpiol scanppl
seq seqChanShow seqQueueShow seqShow seqStop
seqcar setIdlePollPeriod setIocLogDisable
setMovingPollPeriod taskwdShow tclcall tpn
var xps_gathering
epics>
Mark
-----Original Message-----
From: Guilherme Jovanini Montagner [mailto:[email protected]]
Sent: Wednesday, September 13, 2017 9:04 AM
To: Mark Rivers
Cc: Ronald L. Sluiter; tech-talk
Subject: Re: Help creating motorR6-9 examples
Hello.
Ok. I see. Do you know how can I get some information on how to do this?
I mean, is the driver complete and I just need to create the st.cmd file, or is there something else to it? Also, where can I find information on writing this kind of file? What language is it written in?
Thanks for your help!
Guilherme Jovanini Montagner
+55 19 2517.8911
+55 19 99806.9117
[email protected]
----- Mensagem original -----
De: "Mark Rivers" <[email protected]>
Para: "guilherme" <[email protected]>
Cc: "Ronald L. Sluiter" <[email protected]>, "tech-talk" <[email protected]>
Enviadas: Quarta-feira, 13 de setembro de 2017 10:14:18
Assunto: RE: Help creating motorR6-9 examples
> Let me ask you then, if I want to connect to a PI controller, do I need to create a st.cmd file that loads the right resources for that purpose?
Yes. motor/iocBoot/iocWithAsyn contains example st.cmd.* files for a number of controllers, but I don't see any examples for a PI controller.
I think the commands you need are, for example:
drvAsynIPPortConfigure("PI", "xxx.xxx.xxx.xxx:PORT", 0, 0, 0)
PI_GCS2_CreateController("PI_MOTOR", "PI", int numAxes, int priority, int stackSize, int movingPollingRate, int idlePollingRate)
Where PI is the name of an asyn IP port driver you create, xxx.xxx.xxx.xxx is the IP address of your controller, PORT is the TCP port that the controller accepts connections on, and PI_MOTOR is the name you give to the motor controller
you create. PI_MOTOR is the name you give in your motor template file.
Mark
________________________________________
From: Guilherme Jovanini Montagner [[email protected]]
Sent: Wednesday, September 13, 2017 7:53 AM
To: Mark Rivers
Cc: Ronald L. Sluiter; tech-talk
Subject: Re: Help creating motorR6-9 examples
Hello
Thank you! it worked. Now I've got a bin folder and an executable file WithAsyn within it.
Let me ask you then, if I want to connect to a PI controller, do I need to create a st.cmd file that loads the right resources for that purpose?
Because the preinstalled files don't seem to be what i want to run.
Sorry, I'm new to EPICS and am still investigating how can we develop applications for it.
Thanks
Guilherme Jovanini Montagner
+55 19 2517.8911
+55 19 99806.9117
[email protected]
----- Mensagem original -----
De: "Mark Rivers" <[email protected]>
Para: "guilherme" <[email protected]>, "Ronald L. Sluiter" <[email protected]>
Cc: "tech-talk" <[email protected]>
Enviadas: Quarta-feira, 13 de setembro de 2017 9:03:19
Assunto: RE: Help creating motorR6-9 examples
> Can it be because I have another folder with motorR6-8 on the machine?
No, this error is because motor R6-9 is not compatible with base 3.15 or 3.16. PI_GCS2Support.dbd includes the motor record, which it should not do.
You can comment out these 2 lines in PI_GCS2Support.dbd
include "asyn.dbd"
include "motorRecord.dbd"
Or you can get the master branch from github,
https://github.com/epics-modules/motor
I know that the master branch works on base 3.15.5, but I see that are working with base 3.16.1 and I am not sure if that has been tested with motor yet.
Mark
________________________________________
From: [email protected] [[email protected]] on behalf of Guilherme Jovanini Montagner [[email protected]]
Sent: Wednesday, September 13, 2017 6:51 AM
To: Ronald L. Sluiter
Cc: tech-talk
Subject: Re: Help creating motorR6-9 examples
Hello again, good morning.
I've just tried that, and then, make outputs the following error:
"(...)
Creating dbd file WithAsyn.dbd
perl -CSD /home/setup/Downloads/base-3.16.1/bin/linux-x86_64/dbdExpand.pl -I. -I.. -I../O.Common -I../../../dbd -I/home/setup/Downloads/support/asyn4-31/dbd -I/home/setup/Downloads/base-3.16.1/dbd -I../../../dbd -o WithAsyn.dbd base.dbd
motorSupport.dbd PI_GCS2Support.dbd
dbdExpand.pl: Duplicate definition of record type 'motor'
Context: recordtype(motor) in file '../../../dbd/motorRecord.dbd' in file '../../../dbd/PI_GCS2Support.dbd'
while reading 'PI_GCS2Support.dbd' to create 'WithAsyn.dbd'
dbdExpand.pl: Exiting due to errors
(...)
"
Can it be because I have another folder with motorR6-8 on the machine?
Thanks again.
Guilherme Jovanini Montagner
+55 19 2517.8911
+55 19 99806.9117
[email protected]
----- Mensagem original -----
De: "Ronald L. Sluiter" <[email protected]>
Para: "tech-talk" <[email protected]>
Enviadas: Terça-feira, 12 de setembro de 2017 18:05:43
Assunto: Fwd: Re: Help creating motorR6-9 examples
-------- Forwarded Message --------
Subject: Re: Help creating motorR6-9 examples
Date: Tue, 12 Sep 2017 15:57:49 -0500
From: Ronald L. Sluiter <[email protected]>
To: Guilherme Jovanini Montagner <[email protected]>
Hello Guilherme,
I see from the makedump.txt file you sent that you are only building the
"MotorSrc" and "PIGCS2Src" directories. That is OK, but the <motor>/motorExApp
assumes that all the support directories are built.
You could follow one of two paths. One path would be to restore
motorR6-9/motorApp/Makefile to its' orginial state and rebuild.
The other, minimalist, path would be to comment out (or remove) from motorExApp
everything irrelavent to PIGCS2Src support. That requires;
- In motorR6-9/motorExApp/Makefile, comment out "DIRS += NoAsyn" (there is no
PIGCS2Src support in NoAsyn).
- Replace motorR6-9/motorExApp/WithAsyn/Makefile with the attached copy.
- rebuild
I think that should work.
Ron
On 09/12/2017 03:25 PM, Guilherme Jovanini Montagner wrote:
> Hi.
> Ok, here it is (attached)
> I'll have to go now, but I'll come back.
> Thanks!
>
> Guilherme Jovanini Montagner
> +55 19 2517.8911
> +55 19 99806.9117
> [email protected]
>
> ----- Mensagem original -----
> De: "Ronald L. Sluiter" <[email protected]>
> Para: "guilherme" <[email protected]>
> Cc: "tech-talk" <[email protected]>
> Enviadas: Terça-feira, 12 de setembro de 2017 17:17:16
> Assunto: Re: Help creating motorR6-9 examples
>
> Could you run the following command at the top directory,
>> make >& makedump.txt
> and send me the file.
>
> Ron
>
> On 09/12/2017 03:13 PM, Guilherme Jovanini Montagner wrote:
>> Hi again. Yes, I have run make from the top, and after, tried running it again from the child directory.
>>
>> Guilherme Jovanini Montagner
>> +55 19 2517.8911
>> +55 19 99806.9117
>> [email protected]
>>
>> ----- Mensagem original -----
>> De: "Ronald L. Sluiter" <[email protected]>
>> Para: "guilherme" <[email protected]>, "tech-talk" <[email protected]>
>> Enviadas: Terça-feira, 12 de setembro de 2017 17:06:32
>> Assunto: Re: Help creating motorR6-9 examples
>>
>> If you did not run "make" from the top level "motorR6-9" directory, that could
>> be why you are getting these errors. The EPICS motor module, like EPICS base and
>> most other EPICS modules, assumes that "make" is run 1st from the top level
>> directory. After running 'make' from the top level you can make custom changes
>> and taylor the module to your specific needs, but you should run make from the
>> top 1st.
>>
>> Ron
>>
>> On 09/12/2017 02:57 PM, Ronald L. Sluiter wrote:
>>> Hello Guilherme,
>>>
>>> I am guessing that the SoftMotorSrc directory did not get built. If you 'ls'
>>> the SoftMotorSrc directory you should get this;
>>>
>>>> % ls motorApp/SoftMotorSrc
>>>> devSoftAux.cc devSoft.cc devSoft.h devSoftMotor.dbd Makefile O.Common
>>>> O.linux-x86_64
>>> and there should be a 'devSoftMotor.dbd' file installed in the top 'dbd'
>>> directory.
>>>
>>>> galadriel% ls dbd
>>>> ACRMotorSupport.dbd devDeltaTau.dbd devMclennanMotor.dbd
>>>> devNewport.dbd devPIJena.dbd *devSoftMotor.dbd* MicronixSupport.dbd
>>>> motorSupport.dbd omsAsynSupport.dbd
>>>> devAcsMotor.dbd devFaulhaberMotor.dbd devMicos.dbd devOms.dbd
>>>> devPIMotor.dbd devSPiiPlus.dbd motorRecord.dbd NoAsyn.dbd
>>>> phytron.dbd
>>>> devAerotech.dbd devImsMotor.dbd devMicroMo.dbd devOriel.dbd
>>>> devSmarActMCSMotor.dbd devThorLabs.dbd motorSim.dbd NoAsynVx.dbd
>>>> PI_GCS2Support.dbd
>>>> devAttocube.dbd devKohzuMotor.dbd devNewFocus.dbd
>>>> devPC6K.dbd devSmartMotorMotor.dbd HytecMotorDriver.dbd
>>>> motorSimSupport.dbd NPointMotorSupport.dbd
>>> What do you see in those two directories?
>>>
>>> Ron
>>>
>>> On 09/12/2017 02:25 PM, Guilherme Jovanini Montagner wrote:
>>>> Hi!
>>>> I'm involved in a Project in which EPICS is to be used, and am currently
>>>> trying to create a working example using a PI piezo controller.
>>>> I want some help doing this.
>>>> I've uncommented the lines
>>>>
>>>> DIRS += motorExApp iocBoot
>>>> motorExApp_DEPEND_DIRS = motorApp
>>>> iocBoot_DEPEND_DIRS = motorExApp
>>>>
>>>> from the top makefile. I've also uncommented the line "MOTOR=$(TOP)" in
>>>> configure/RELEASE file
>>>> Also, on the file motorApp/Makefile, I've got the lines
>>>>
>>>> DIRS +=PIGCS2Src
>>>> PIGCS2Src_DEPEND_DIRS = MotorSrc
>>>>
>>>> uncommented.
>>>>
>>>> The problem is, when I run make on top, I get the following message:
>>>>
>>>> [setup@localhost motorExApp]$ make
>>>> make -C ./NoAsyn install
>>>> make[1]: Entering directory
>>>> `/home/setup/Downloads/support/motor/motorR6-9/motorExApp/NoAsyn'
>>>> make -C O.linux-x86_64 -f ../Makefile TOP=../../.. \
>>>> T_A=linux-x86_64 install
>>>> make[2]: Entering directory
>>>> `/home/setup/Downloads/support/motor/motorR6-9/motorExApp/NoAsyn/O.linux-x86_64'
>>>> Creating dbd file NoAsyn.dbd
>>>> perl -CSD /home/setup/Downloads/base-3.16.1/bin/linux-x86_64/dbdExpand.pl -I.
>>>> -I.. -I../O.Common -I../../../dbd
>>>> -I/home/setup/Downloads/support/asyn4-31/dbd
>>>> -I/home/setup/Downloads/base-3.16.1/dbd -o NoAsyn.dbd base.dbd
>>>> motorRecord.dbd devSoftMotor.dbd Misc.dbd
>>>> dbdExpand.pl: Can't find file 'devSoftMotor.dbd'
>>>> while reading 'devSoftMotor.dbd' to create 'NoAsyn.dbd'
>>>> Your Makefile may need this dependency rule:
>>>> $(COMMON_DIR)/NoAsyn.dbd: $(COMMON_DIR)/devSoftMotor.dbd
>>>> dbdExpand.pl: Exiting due to errors
>>>> make[2]: *** [../O.Common/NoAsyn.dbd] Error 255
>>>> make[2]: Leaving directory
>>>> `/home/setup/Downloads/support/motor/motorR6-9/motorExApp/NoAsyn/O.linux-x86_64'
>>>> make[1]: *** [install.linux-x86_64] Error 2
>>>> make[1]: Leaving directory
>>>> `/home/setup/Downloads/support/motor/motorR6-9/motorExApp/NoAsyn'
>>>> make: *** [NoAsyn.install] Error 2
>>>>
>>>>
>>>>
>>>> Then, I proceeded to add the mentioned line on motorExApp/NoAsyn/Makefile:
>>>>
>>>> #----------------------------------------
>>>> #
>>>> ADD MACRO DEFINITIONS AFTER THIS LINE
>>>> #=============================
>>>> $(COMMON_DIR)/NoAsyn.dbd: $(COMMON_DIR)/devSoftMotor.dbd
>>>> PROD_IOC_DEFAULT = NoAsyn
>>>> PROD_IOC_vxWorks = NoAsynVx
>>>>
>>>> COMMONDBDS = base.dbd
>>>> COMMONDBDS += motorRecord.dbd
>>>> COMMONDBDS += devSoftMotor.dbd
>>>> #!COMMONDBDS += devMXmotor.dbd
>>>>
>>>>
>>>>
>>>> but when I run make again, after doing that, I get the following error:
>>>>
>>>>
>>>>
>>>> [setup@localhost motorExApp]$ make
>>>> make -C ./NoAsyn install
>>>> make[1]: Entering directory
>>>> `/home/setup/Downloads/support/motor/motorR6-9/motorExApp/NoAsyn'
>>>> make -C O.linux-x86_64 -f ../Makefile TOP=../../.. \
>>>> T_A=linux-x86_64 install
>>>> make[2]: Entering directory
>>>> `/home/setup/Downloads/support/motor/motorR6-9/motorExApp/NoAsyn/O.linux-x86_64'
>>>> Creating dbd file devSoftMotor.dbd
>>>> perl -CSD /home/setup/Downloads/base-3.16.1/bin/linux-x86_64/dbdExpand.pl -I.
>>>> -I.. -I../O.Common -I../../../dbd
>>>> -I/home/setup/Downloads/support/asyn4-31/dbd
>>>> -I/home/setup/Downloads/base-3.16.1/dbd -o devSoftMotor.dbd
>>>> dbdExpand.pl: No input files for devSoftMotor.dbd
>>>> make[2]: *** [../O.Common/devSoftMotor.dbd] Error 255
>>>> make[2]: Leaving directory
>>>> `/home/setup/Downloads/support/motor/motorR6-9/motorExApp/NoAsyn/O.linux-x86_64'
>>>> make[1]: *** [install.linux-x86_64] Error 2
>>>> make[1]: Leaving directory
>>>> `/home/setup/Downloads/support/motor/motorR6-9/motorExApp/NoAsyn'
>>>> make: *** [NoAsyn.install] Error 2
>>>> [setup@localhost motorExApp]$
>>>>
>>>> I don't know where is this devSoftMotor.dbd being called, and why it doesn't
>>>> have input arguments.
>>>>
>>>> Could you help me, please?
>>>> Thanks,
>>>> Guilherme
>>>>
>>>>
>>>> *Guilherme Jovanini Montagner*
>>>> +55 19 2517.8911
>>>> +55 19 99806.9117
>>>> [email protected]
>>>>
>>>> --------------------------------------------------------------------------------