Hi Mathias,
-
So now I have 4 executables with the same name:
-
-
./motor/bin/linux-x86_64/motorSim
-
./motor/modules/motorMotorSim/iocs/motorSimIOC/bin/linux-x86_64/motorSim
-
./motor/modules/motorMotorSim/iocs/motorSimIOC/motorSimApp/src/O.linux-x86_64/motorSim
-
./motor/modules/motorMotorSim/motorSimApp/src/O.linux-x86_64/motorSim
-
-
They are different (not the same md5sum).
Actually the first and last in this list should be identical, and the two in the middle should be identical. For some reason motorSim builds 2 IOC applications, one in
motor/modules/motorMotorSim/motorSimApp/src and the other in motor/modules/motorMotorSim/iocs/motorSimIOC/motorSimApp/src. Normally the IOC application would only be built in the second directory.
-
Running any of those gives me an "epics>" prompt.
-
What should I do, to run it to be able to test something with a Python client ? Or at least with caput/caget ?
-
How to configure it (limits, velocity, etc) ?
You should run the application as follows:
$ cd motor/modules/motorMotorSim/iocs/motorSimIOC/iocBoot/iocMotorSim/
$ ../../bin/linux-x86_64/motorSim st.cmd
You will then see this:
################################################
# The is the ASYN example for communication to 4 simulated motors
# "#!" marks lines that can be uncommented.
< envPaths
epicsEnvSet("IOC","iocMotorSim")
epicsEnvSet("TOP","/home/epics/support/motor-7-3/modules/motorMotorSim/iocs/motorSimIOC")
epicsEnvSet("MOTOR","/home/epics/support/motor-7-3")
epicsEnvSet("ASYN","/corvette/home/epics/support/asyn-4-44-2")
epicsEnvSet("SNCSEQ","/corvette/home/epics/support/seq-2-2-9")
epicsEnvSet("BUSY","/corvette/home/epics/support/busy-1-7-3")
epicsEnvSet("IPAC","/corvette/home/epics/support/ipac-2-16")
epicsEnvSet("EPICS_BASE","/corvette/usr/local/epics/base-7.0.7")
epicsEnvSet("SUPPORT","/corvette/home/epics/support")
dbLoadDatabase("/home/epics/support/motor-7-3/modules/motorMotorSim/iocs/motorSimIOC/dbd/motorSim.dbd")
motorSim_registerRecordDeviceDriver(pdbbase)
# Use a local configuration if axes need individual customization
< motorSim.cmd
dbLoadTemplate("motorSim.substitutions")
motorSimCreateController("motorSim1", 8)
#asynSetTraceIOMask("motorSim1", 0, HEX)
#asynSetTraceMask("motorSim1", 0, ERROR|FLOW|DRIVER)
# 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
motorSimConfigAxis("motorSim1", 4, 20000, -20000, 500, 0)
motorSimDriver:motorSimConfigAxis: configuring controller motorSim1 axis 4
motorSimConfigAxis("motorSim1", 5, 20000, -20000, 1500, 0)
motorSimDriver:motorSimConfigAxis: configuring controller motorSim1 axis 5
motorSimConfigAxis("motorSim1", 6, 20000, -20000, 2500, 0)
motorSimDriver:motorSimConfigAxis: configuring controller motorSim1 axis 6
motorSimConfigAxis("motorSim1", 7, 20000, -20000, 3000, 0)
motorSimDriver:motorSimConfigAxis: configuring controller motorSim1 axis 7
# Use a default, 8-axis configuration if axes can start with identical settings
#!< motorSim.iocsh
iocInit
Starting iocInit
############################################################################
## EPICS R7.0.7.1-DEV
## Rev. R7.0.7-125-g5a1f3ecc8b9d97a5fa4f-dirty
## Rev. Date Git: 2023-05-18 11:57:41 -0700
############################################################################
cas WARNING: Configured TCP port was unavailable.
cas WARNING: Using dynamically assigned TCP port 38765,
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
## motorUtil (allstop & alldone)
motorUtilInit("IOC:")
# Boot complete
date
2024/09/17 11:15:05.198444
################################################
At that point you have an IOC running with 8 simulated motors. You can open a display to control this with this command if you build medm.
$ medm -x -macro "P=IOC:,M1=m1,M2=m2,M3=m3,M4=m4,M5=m5,M6=m6,M7=m7,M8=m8" motor8x.adl
You will then see this screen, where I have moved the first motor with the > button by 1 “degree”.

You can also then control the motor from Python using PyEpics to write a new position to IOC:m1.VAL.
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Guijarro Mathias Charles via Tech-talk
Sent: Tuesday, September 17, 2024 9:37 AM
To: tech-talk at aps.anl.gov
Subject: New to EPICS - wants to use motorMotorSim - Python client
I am new to EPICS. I would like to run a motor simulation driver (or is it IOC ? Or "server", well something I can use
to connect to, that would simulate the behaviour of a motor), and to test it with Python.
I do not want to try with Docker, as I prefer to have individual processes running locally, to learn about the
Here is what I did so far:
- made a new Conda environment
- installed Epics from Conda , to have EPICS_BASE in $CONDA_PREFIX/epics
- cloned submodule "motorMotorSim"
- compiled all those (first asyn, then sequencer, then motor)
- had to guess a bit where to put EPICS_BASE directory in various configure/RULES etc
- had to install "sun rpc" on my system, and "re2c" from conda-forge (if I remember correctly)
- at the end I had to manually copy the include, lib, bin, dbd, db files ; is it the normal way ?
- I managed to set IOCS to True to have IOC compiled
So now I have 4 executables with the same name:
./motor/bin/linux-x86_64/motorSim
./motor/modules/motorMotorSim/iocs/motorSimIOC/bin/linux-x86_64/motorSim
./motor/modules/motorMotorSim/iocs/motorSimIOC/motorSimApp/src/O.linux-x86_64/motorSim
./motor/modules/motorMotorSim/motorSimApp/src/O.linux-x86_64/motorSim
They are different (not the same md5sum).
Running any of those gives me an "epics>" prompt.
What should I do, to run it to be able to test something with a Python client ? Or at least with caput/caget ?
How to configure it (limits, velocity, etc) ?
I could not find any guide for this on internet, or at least it was not as easy as I thought... So I prefer
to ask in order to get the "minimum viable information".
Later on I will try to run other simulated devices probably... So better to learn about the system "the hard
Any help would be appreciated.