-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vmcExApp/ #21
base: master
Are you sure you want to change the base?
Add vmcExApp/ #21
Conversation
Make it a little bit easier for beginners to use this module for a very first IOC with motion control. On my system a binary is created here: .../modules/motor/bin/darwin-x86/vmc (MacOs) .../modules/motor/bin/windows-x64-mingw/vmc.exe (MINGW) which is the one to be started as an example IOC. Problem(s) that may needed to be solved: The windows machine does not find the dlls, like asyn.dll Copying them into .../modules/motor/bin/windows-x64-mingw/ allows to start the binary. More needs to be done, all macros need to be defined to get any record loaded.
Need to dig deeper to fix the failing tests |
Hello evereone, I have pulled the EuropeanSpallationSource:add-vmcExApp branch. It is possible to run make. I have also copied the missing dlls to vmc.exe folder and can start vmc.exe but with a lot of errors. I have changed
But for some reasons IOC has reported missing macros ASYNC and MOTOR. I have created
Consider, that MOTOR points to motorApp and not to motor.
Now $ ../../../../bin/windows-x64-mingw/vmc.exe st.cmd
#!../../bin/windows-x64-mingw/vmc
< envPaths
epicsEnvSet("TOP","c:/Users/AlexK/work/epics/Modules/motorVMC")
epicsEnvSet("IOC","iocvmc")
epicsEnvSet("MOTOR","c:/Users/AlexK/work/epics/Modules/motor/motorApp")
epicsEnvSet("ASYN","c:/Users/AlexK/work/epics/Modules/asyn")
cd "c:/Users/AlexK/work/epics/Modules/motorVMC/iocs/vmcIOC/iocBoot/iocvmc"
## Register all support components
dbLoadDatabase "c:/Users/AlexK/work/epics/Modules/motorVMC/dbd/vmc.dbd"
vmc_registerRecordDeviceDriver pdbbase
Warning: IOC is booting with TOP = "c:/Users/AlexK/work/epics/Modules/motorVMC"
but was built with TOP = "/c/Users/AlexK/work/epics/Modules/motorVMC"
registerChannelProviderLocal firstTime true
# Define the IOC prefix
< settings.iocsh
# prefix used for all PVs in this IOC
epicsEnvSet("PREFIX", "vmc:")
# Allstop, alldone
iocshLoad("c:/Users/AlexK/work/epics/Modules/motor/motorApp/iocsh/allstop.iocsh", "P=vmc:")
# ### allstop.iocsh ###
dbLoadRecords("c:/Users/AlexK/work/epics/Modules/motor/motorApp/db/motorUtil.db", "P=vmc:")
doAfterIocInit("motorUtilInit('vmc:')")
allstop.iocsh line 10: Command doAfterIocInit not found.
# Virtual Motor Controller
< vmc.cmd
### Virtual Motor Controller support
epicsEnvSet("VMC_PORT", "31337")
drvAsynIPPortConfigure("VMC_ETH","127.0.0.1:31337", 0, 0, 0)
# Show communication
#!asynSetTraceMask("VMC_ETH", 0, 3)
# Only show errors
asynSetTraceMask("VMC_ETH", 0, 1)
# Leave ascii selected so traces can be turned on with a single click
asynSetTraceIOMask("VMC_ETH", 0, 1)
# Set end-of-string terminators
asynOctetSetInputEos("VMC_ETH",0,"\r\n")
asynOctetSetOutputEos("VMC_ETH",0,"\r")
2023/06/06 12:16:43.104 VMC_ETH -1 autoConnect could not connect: Can't connect to 127.0.0.1:31337: Unknown error
# These motor records can get their prefix from the environment variable
dbLoadRecords("c:/Users/AlexK/work/epics/Modules/motor/motorApp/db/asyn_motor.db","P=vmc:,M=m1,DTYP=asynMotor,PORT=VMC1,ADDR=0,DESC=X,EGU=mm,DIR=Pos,VELO=1,VBAS=.1,ACCL=.2,BDST=0,B
VEL=1,BACC=.2,MRES=.0025,PREC=4,DHLM=100,DLLM=-100,INIT=")
dbLoadRecords("c:/Users/AlexK/work/epics/Modules/motor/motorApp/db/asyn_motor.db","P=vmc:,M=m2,DTYP=asynMotor,PORT=VMC1,ADDR=1,DESC=Y,EGU=mm,DIR=Pos,VELO=1,VBAS=.1,ACCL=.2,BDST=0,B
VEL=1,BACC=.2,MRES=.0025,PREC=4,DHLM=100,DLLM=-100,INIT=")
dbLoadRecords("c:/Users/AlexK/work/epics/Modules/motor/motorApp/db/asyn_motor.db","P=vmc:,M=m3,DTYP=asynMotor,PORT=VMC1,ADDR=2,DESC=Z,EGU=mm,DIR=Pos,VELO=1,VBAS=.1,ACCL=.2,BDST=0,B
VEL=1,BACC=.2,MRES=.0025,PREC=4,DHLM=100,DLLM=-100,INIT=")
# The dbLoadTemplate approach is a cleaner way to load multiple database instances
#!dbLoadTemplate("vmc.substitutions", "P=$(PREFIX)")
# VirtualMotorController(
# portName The name of the asyn port that will be created for this driver
# VirtualMotorPortName The name of the drvAsynSerialPort that was created previously to connect to the VirtualMotor controller
# numAxes The number of axes that this controller supports
# movingPollPeriod The time between polls when any axis is moving
# idlePollPeriod The time between polls when no axis is moving
# 1-second idle polling
VirtualMotorCreateController("VMC1", "VMC_ETH", 3, 250, 1000)
# 10-second idle polling
#!VirtualMotorCreateController("VMC1", "VMC_ETH", 3, 250, 10000)
# No idle polling
#!VirtualMotorCreateController("VMC1", "VMC_ETH", 3, 250, 0)
# Extra axes, 10-second idle polling
#!VirtualMotorCreateController("VMC1", "VMC_ETH", 8, 250, 10000)
dbLoadRecords("c:/Users/AlexK/work/epics/Modules/asyn/db/asynRecord.db","P=vmc:,R=asyn1,PORT=VMC_ETH,ADDR=0,OMAX=0,IMAX=0")
iocInit
Starting iocInit
############################################################################
## EPICS R7.0.4.1
## Rev. 2023-05-03T15:03+0200
############################################################################
2023/06/06 12:16:43.254 vmc:asyn1: queueRequest failed
Warning: Duplicate EPICS CA Address list entry "192.168.56.255:5065" discarded
iocRun: All initialization complete
# Boot complete
epics> dbl
vmc:m1_vCh
vmc:m1_twCh
vmc:m2_vCh
vmc:m2_twCh
vmc:m3_vCh
vmc:m3_twCh
vmc:alldoneBlink
vmc:allstop
vmc:m1_able
vmc:m2_able
vmc:m3_able
vmc:alldone
vmc:m1
vmc:m2
vmc:m3
vmc:asyn1
vmc:movingDiff
vmc:m1Offset
vmc:m1Resolution
vmc:m2Offset
vmc:m2Resolution
vmc:m3Offset
vmc:m3Resolution
vmc:moving
vmc:m1Direction
vmc:m2Direction
vmc:m3Direction But, if i try to access a PV from second terminal via CAGET i get timeout:
|
@keale : Congratulations for figuring this all out. What happens if you write EPICS_CA_ADDR_LIST=127.0.0.1 caget vmc:m1.VEL (it may be a firewall problem as well, depending on your system configuration) |
Aha, an enlightenment! The Python script is the device simulator... And motorVMC is the EPICS wrapper around it. You've explained it to us, but I've only just figured it out.... I have in MSYS2 terminals set
192.xxx belongs to second ethernet card, for lab intranet and aliases for connection to test devices.
but still:
May be I need to set a firewire rule for 5075. I will try tommorow. |
(Technically, we could move the discussion away from the PR, Back to caget and friends, lets leave pvget/pvlist out for a second.
For the IOC, try For the client, a different set of shell variables is used: That should work as well. For pvacess on the IOC, I have to dig out the shell variables. EPICS_PVA_AUTO_ADDR_LIST=NO |
I have tried to set the BEACON env vars in
and in
but ioc shell epicsEnvShow don't shows them. I did it in the MSYS shell, this has worked. After I have killed
I see vmc process in ps, but i can not kill them from MSYS2 terminal. So I killed them in taskmanager.
The access via caput/caget is not possible again. After windows reboot it works again. |
Killing the IOC process (vmc.exe, right) may result in TCP ports being blocked Does caget work after a fresh windows restart ? |
yes, it did after reboot.
But i didn't kill vmc.exe. I stoped server.py. After this vmc shell was frozen. It seems motorVMC hat trouble with socket interrupts. I couldn't do exit or something else, the ioc shell just doesn't react, nevertheless how long I have waited.
|
I dislike the *ExApp approach to creating example binaries used by many of the EPICS modules; it encourages people to use the module as an IOC directory. I prefer the example IOC approach used by the motor driver modules (which was modeled after areaDetector), because it makes it trivial to copy the IOC out of the module directory and build it. |
The Makefile in the example IOC's start directory only creates
The Makefile should include dllPath.bat puts the .dll files from the EPICS modules used by the IOC on the path so they don't need to be copied. |
|
Make it a little bit easier for beginners to use this module for a very first IOC with motion control.
On my system a binary is created here:
.../modules/motor/bin/darwin-x86/vmc (MacOs)
.../modules/motor/bin/windows-x64-mingw/vmc.exe (MINGW)
which is the one to be started as an example IOC.
Problem(s) that may needed to be solved:
The windows machine does not find the dlls, like asyn.dll Copying them into .../modules/motor/bin/windows-x64-mingw/ allows to start the binary.
More needs to be done, all macros need to be defined to get any record loaded.