- IOC Deployment and Troubleshooting
- 5 Add virtual motors to the IOC
- 5.1 Add motorVMC to the IOC's RELEASE file
- 5.2 Add motorVMC to the IOC's src/Makefile
- 5.3 Rebuild the IOC (Attempt #1)
- 5.4 Resolve the build error
- 5.5 Rebuild the IOC
- 5.6 Confirm the libvmc is included in the IOC's binary
- 5.7 Add the VMC config to the IOC
- 5.7.1 Copy the example VMC config
- 5.7.2 Modify iocsh/vmc.cmd
- 5.7.3 Modify st.cmd.Linux
- 5.8 Launch a motor screen
- 5.9 Run the IOC
- 5.10 Start the Virtual Motor Controller
- 5.10.1 server.py syntax
- 5.10.2 Start servery.py in a different terminal window
- 5.11 Start the IOC
- 6 asyn troubleshooting
IOC Deployment and Troubleshooting
[previous section] [next section]
5 Add virtual motors to the IOC
5.1 Add motorVMC to the IOC's RELEASE file
Use the same variable that was set in motorVMC's RELEASE.local file
$ cd ${IOC_DIR}/xxx
$ gedit configure/RELEASE &
hint
$ grep MOTOR_VMC ${SUPPORT_DIR}/motorVMC/configure/RELEASE.local
MOTOR_VMC=/home/beams/USERNAME/PET-S2/epics/synApps/support/motorVMC
solution
diff --git a/configure/RELEASE b/configure/RELEASE
index e7aba0e..39736e4 100644
--- a/configure/RELEASE
+++ b/configure/RELEASE
@@ -35,6 +35,8 @@ SUPPORT=/APSshare/epics/synApps_6_2_1/support
#TDS3000 = $(SUPPORT)/../nonSynAppsSupport/tds3000-2.4
#FLY = $(SUPPORT)/../nonSynAppsSupport/fly-0-0
+MOTOR_VMC=~/PET-S2/epics/synApps_6_2_1/support/motorVMC
+
# For a local, custom configuration; copy $(SUPPORT)/configure/RELEASE
# to this directory as the file MASTER_RELEASE, edit the file, comment out
# the above include, and uncomment the following line.
5.2 Add motorVMC to the IOC's src/Makefile
Add the motorVMC database and library to xxxApp/src/Makefile
$ gedit xxxApp/src/Makefile &
hint
Remember that the names of the files that need to be added to the Makefile are in the top-level build directories of motorVMC.
$ ls -l ${SUPPORT_DIR}/motorVMC/{dbd,lib/${EPICS_HOST_ARCH}}
/home/beams/USERNAME/PET-S2/epics/synApps/support/motorVMC/dbd:
total 0
-r--r--r-- 1 username group 32 Feb 2 15:44 vmcSupport.dbd
/home/beams/USERNAME/PET-S2/epics/synApps/support/motorVMC/lib/linux-x86_64:
total 92
-r--r--r-- 1 username group 34518 Feb 2 15:44 libvmc.a
-r-xr-xr-x 1 username group 47696 Feb 2 15:44 libvmc.so*
The easiest way to add the motorVMC support to the Makefile is to copy the modbus section and replace the modbus references.
ifdef MODBUS
$(DBD_NAME)_DBD += modbusSupport.dbd
$(PROD_NAME)_LIBS := modbus $($(PROD_NAME)_LIBS)
endif
solution
$ git diff xxxApp/src/Makefile
diff --git a/xxxApp/src/Makefile b/xxxApp/src/Makefile
index 9692f5a..14855f8 100644
--- a/xxxApp/src/Makefile
+++ b/xxxApp/src/Makefile
@@ -284,6 +284,11 @@ ifdef MODBUS
$(PROD_NAME)_LIBS := modbus $($(PROD_NAME)_LIBS)
endif
+ifdef MOTOR_VMC
+ $(DBD_NAME)_DBD += vmcSupport.dbd
+ $(PROD_NAME)_LIBS := vmc $($(PROD_NAME)_LIBS)
+endif
+
ifdef MOTOR
$(DBD_NAME)_DBD += motorSupport.dbd devAcsMotor.dbd devAerotech.dbd
$(DBD_NAME)_DBD += devAttocube.dbd devFaulhaberMotor.dbd devImsMotor.dbd
5.3 Rebuild the IOC (Attempt #1)
If the following build succeeds, proceed to step 5.6.
$ make
output
make -C ./configure install
make[1]: Entering directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/configure'
perl -CSD /APSshare/epics/base-7.0.4.1/bin/rhel8-x86_64/makeMakefile.pl O.rhel8-x86_64 ../..
mkdir -p O.Common
make -C O.rhel8-x86_64 -f ../Makefile TOP=../.. \
T_A=rhel8-x86_64 install
make[2]: Entering directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/configure/O.rhel8-x86_64'
perl -CSD /APSshare/epics/base-7.0.4.1/bin/rhel8-x86_64/convertRelease.pl checkRelease
Definition of MOTOR conflicts with MOTOR_VMC support.
In this application or module, a RELEASE file
conflicts with MOTOR_VMC at /home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/support/motorVMC
Here: MOTOR = /APSshare/epics/synApps_6_2_1/support/motor-R7-2-2
MOTOR_VMC: MOTOR = /net/aquila/export/APSmaster/gateway/epics/synApps_6_2_1/support/motor-R7-2-2
make[2]: *** [/APSshare/epics/base-7.0.4.1/configure/RULES_BUILD:190: checkRelease] Error 1
make[2]: Leaving directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/configure/O.rhel8-x86_64'
make[1]: *** [/APSshare/epics/base-7.0.4.1/configure/RULES_ARCHS:58: install.rhel8-x86_64] Error 2
make[1]: Leaving directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/configure'
make: *** [/APSshare/epics/base-7.0.4.1/configure/RULES_DIRS:85: configure.install] Error 2
5.4 Resolve the build error
This is the same build error as in step 4.5, so the solution is very similar.
solution
$ echo "CHECK_RELEASE = NO" >> configure/CONFIG_SITE.local
Note: The >> is needed here because the file already exists. > was used in step 4.6 because the file needed to be created.
5.5 Rebuild the IOC
$ make
output
make -C ./configure install
make[1]: Entering directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/configure'
make -C O.rhel8-x86_64 -f ../Makefile TOP=../.. \
T_A=rhel8-x86_64 install
make[2]: Entering directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/configure/O.rhel8-x86_64'
Warning: RELEASE file consistency checks have been disabled
make[2]: Nothing to be done for 'install'.
make[2]: Leaving directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/configure/O.rhel8-x86_64'
make[1]: Leaving directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/configure'
make -C ./xxxApp install
make[1]: Entering directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/xxxApp'
make -C ./src install
make[2]: Entering directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/xxxApp/src'
make -C O.rhel8-x86_64 -f ../Makefile TOP=../../.. \
T_A=rhel8-x86_64 install
make[3]: Entering directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/xxxApp/src/O.rhel8-x86_64'
Creating dbd file iocxxxLinux.dbd
perl -CSD /APSshare/epics/base-7.0.4.1/bin/rhel8-x86_64/dbdExpand.pl -I. -I.. -I../O.Common -I../../../dbd -I/APSshare/epics/base-7.0.4.1/dbd -I/APSshare/epics/synApps_6_2_1/support/alive-R1-3-1/dbd -I/APSshare/epics/synApps_6_2_1/support/asyn-R4-42/dbd -I/APSshare/epics/synApps_6_2_1/support/autosave-R5-10-2/dbd -I/APSshare/epics/synApps_6_2_1/support/busy-R1-7-3/dbd -I/APSshare/epics/synApps_6_2_1/support/calc-R3-7-4/dbd -I/APSshare/epics/synApps_6_2_1/support/camac-R2-7-4/dbd -I/APSshare/epics/synApps_6_2_1/support/caputRecorder-R1-7-3/dbd -I/APSshare/epics/synApps_6_2_1/support/dac128V-R2-10-1/dbd -I/APSshare/epics/synApps_6_2_1/support/delaygen-R1-2-2/dbd -I/APSshare/epics/synApps_6_2_1/support/dxp-R6-0/dbd -I/APSshare/epics/synApps_6_2_1/support/dxpSITORO-R1-2/dbd -I/APSshare/epics/synApps_6_2_1/support/iocStats-3-1-16/dbd -I/APSshare/epics/synApps_6_2_1/support/ether_ip-ether_ip-3-2/dbd -I/APSshare/epics/synApps_6_2_1/support/Galil-3-0-V3-6/dbd -I/APSshare/epics/synApps_6_2_1/support/ip-R2-21-1/dbd -I/APSshare/epics/synApps_6_2_1/support/ipac-2-16/dbd -I/APSshare/epics/synApps_6_2_1/support/ip330-R2-10/dbd -I/APSshare/epics/synApps_6_2_1/support/ipUnidig-R2-12/dbd -I/APSshare/epics/synApps_6_2_1/support/LabJack-master/dbd -I/APSshare/epics/synApps_6_2_1/support/love-R3-2-8/dbd -I/APSshare/epics/synApps_6_2_1/support/lua-R3-0-2/dbd -I/APSshare/epics/synApps_6_2_1/support/mca-R7-9/dbd -I/APSshare/epics/synApps_6_2_1/support/measComp-R4-0/dbd -I/APSshare/epics/synApps_6_2_1/support/modbus-R3-2/dbd -I/APSshare/epics/synApps_6_2_1/support/motor-R7-2-2/dbd -I/APSshare/epics/synApps_6_2_1/support/motorAcsMotion-R2-0-bugfix/dbd -I/APSshare/epics/synApps_6_2_1/support/optics-R2-13-5/dbd -I/APSshare/epics/synApps_6_2_1/support/quadEM-R9-4/dbd -I/APSshare/epics/synApps_6_2_1/support/scaler-4-0/dbd -I/APSshare/epics/synApps_6_2_1/support/softGlue-R2-8-3/dbd -I/APSshare/epics/synApps_6_2_1/support/softGlueZynq-R2-0-4/dbd -I/APSshare/epics/synApps_6_2_1/support/sscan-R2-11-4/dbd -I/APSshare/epics/synApps_6_2_1/support/std-R3-6-3/dbd -I/APSshare/epics/synApps_6_2_1/support/StreamDevice-2-8-16/dbd -I/APSshare/epics/synApps_6_2_1/support/vac-R1-9-1/dbd -I/APSshare/epics/synApps_6_2_1/support/vme-R2-9-4/dbd -I/APSshare/epics/synApps_6_2_1/support/xspress3-2-5/dbd -I/APSshare/epics/synApps_6_2_1/support/Yokogawa_DAS-R2-0-1/dbd -I/APSshare/epics/synApps_6_2_1/support/xxx-R6-2-1/dbd -I/APSshare/epics/synApps_6_2_1/support/areaDetector-R3-12-1/ADCore/dbd -I/APSshare/epics/synApps_6_2_1/support/seq-2-2-9/dbd -I/APSshare/epics/synApps_6_2_1/support/allenBradley-2-3/dbd -I/home/beams/KPETERSN/PET-S2/epics/synApps_6_2_1/support/motorVMC/dbd -o iocxxxLinux.dbd base.dbd NDPluginSupport.dbd ADSupport.dbd NDFileNull.dbd NDPluginPva.dbd PVAServerRegister.dbd NDFileNetCDF.dbd NDFileMagick.dbd NDFileTIFF.dbd NDFileNexus.dbd NDFileHDF5.dbd NDFileJPEG.dbd asyn.dbd aliveSupport.dbd asSupport.dbd busySupport.dbd calcSupport.dbd devIocStats.dbd sscanSupport.dbd caputRecorder.dbd drvAsynSerialPort.dbd drvAsynIPPort.dbd drvVxi11.dbd devGpib.dbd stdSupport.dbd scalerSupport.dbd sscanProgressSupport.dbd opticsSupport.dbd mcaSupport.dbd drvAHxxx.dbd drvTetrAMM.dbd ipSupport.dbd luaSupport.dbd modbusSupport.dbd vmcSupport.dbd motorSupport.dbd devAcsMotor.dbd devAerotech.dbd devAttocube.dbd devFaulhaberMotor.dbd devImsMotor.dbd devKohzuMotor.dbd devMclennanMotor.dbd devMicos.dbd devMicroMo.dbd devNewFocus.dbd devNewport.dbd devAerotechSeq.dbd devNewportSeq.dbd devOriel.dbd devPC6K.dbd devPIJena.dbd devPIMotor.dbd devSPiiPlus.dbd devSmartMotorMotor.dbd devSoftMotor.dbd devThorLabs.dbd motorSimSupport.dbd stream.dbd devIocStats.dbd iocAdmin.dbd ether_ip.dbd delaygenSupport.dbd vacSupport.dbd dxpSupport.dbd drvIpac.dbd ipUnidigSupport.dbd dac128VSupport.dbd ip330Support.dbd softGlueSupport.dbd softGlueZynqSupport.dbd mw100Support.dbd GalilSupport.dbd
perl -CSD /APSshare/epics/base-7.0.4.1/bin/rhel8-x86_64/registerRecordDeviceDriver.pl -I. -I.. -I../O.Common -I../../../dbd -I/APSshare/epics/base-7.0.4.1/dbd -I/APSshare/epics/synApps_6_2_1/support/alive-R1-3-1/dbd -I/APSshare/epics/synApps_6_2_1/support/asyn-R4-42/dbd -I/APSshare/epics/synApps_6_2_1/support/autosave-R5-10-2/dbd -I/APSshare/epics/synApps_6_2_1/support/busy-R1-7-3/dbd -I/APSshare/epics/synApps_6_2_1/support/calc-R3-7-4/dbd -I/APSshare/epics/synApps_6_2_1/support/camac-R2-7-4/dbd -I/APSshare/epics/synApps_6_2_1/support/caputRecorder-R1-7-3/dbd -I/APSshare/epics/synApps_6_2_1/support/dac128V-R2-10-1/dbd -I/APSshare/epics/synApps_6_2_1/support/delaygen-R1-2-2/dbd -I/APSshare/epics/synApps_6_2_1/support/dxp-R6-0/dbd -I/APSshare/epics/synApps_6_2_1/support/dxpSITORO-R1-2/dbd -I/APSshare/epics/synApps_6_2_1/support/iocStats-3-1-16/dbd -I/APSshare/epics/synApps_6_2_1/support/ether_ip-ether_ip-3-2/dbd -I/APSshare/epics/synApps_6_2_1/support/Galil-3-0-V3-6/dbd -I/APSshare/epics/synApps_6_2_1/support/ip-R2-21-1/dbd -I/APSshare/epics/synApps_6_2_1/support/ipac-2-16/dbd -I/APSshare/epics/synApps_6_2_1/support/ip330-R2-10/dbd -I/APSshare/epics/synApps_6_2_1/support/ipUnidig-R2-12/dbd -I/APSshare/epics/synApps_6_2_1/support/LabJack-master/dbd -I/APSshare/epics/synApps_6_2_1/support/love-R3-2-8/dbd -I/APSshare/epics/synApps_6_2_1/support/lua-R3-0-2/dbd -I/APSshare/epics/synApps_6_2_1/support/mca-R7-9/dbd -I/APSshare/epics/synApps_6_2_1/support/measComp-R4-0/dbd -I/APSshare/epics/synApps_6_2_1/support/modbus-R3-2/dbd -I/APSshare/epics/synApps_6_2_1/support/motor-R7-2-2/dbd -I/APSshare/epics/synApps_6_2_1/support/motorAcsMotion-R2-0-bugfix/dbd -I/APSshare/epics/synApps_6_2_1/support/optics-R2-13-5/dbd -I/APSshare/epics/synApps_6_2_1/support/quadEM-R9-4/dbd -I/APSshare/epics/synApps_6_2_1/support/scaler-4-0/dbd -I/APSshare/epics/synApps_6_2_1/support/softGlue-R2-8-3/dbd -I/APSshare/epics/synApps_6_2_1/support/softGlueZynq-R2-0-4/dbd -I/APSshare/epics/synApps_6_2_1/support/sscan-R2-11-4/dbd -I/APSshare/epics/synApps_6_2_1/support/std-R3-6-3/dbd -I/APSshare/epics/synApps_6_2_1/support/StreamDevice-2-8-16/dbd -I/APSshare/epics/synApps_6_2_1/support/vac-R1-9-1/dbd -I/APSshare/epics/synApps_6_2_1/support/vme-R2-9-4/dbd -I/APSshare/epics/synApps_6_2_1/support/xspress3-2-5/dbd -I/APSshare/epics/synApps_6_2_1/support/Yokogawa_DAS-R2-0-1/dbd -I/APSshare/epics/synApps_6_2_1/support/xxx-R6-2-1/dbd -I/APSshare/epics/synApps_6_2_1/support/areaDetector-R3-12-1/ADCore/dbd -I/APSshare/epics/synApps_6_2_1/support/seq-2-2-9/dbd -I/APSshare/epics/synApps_6_2_1/support/allenBradley-2-3/dbd -I/home/beams/KPETERSN/PET-S2/epics/synApps_6_2_1/support/motorVMC/dbd -o iocxxxLinux_registerRecordDeviceDriver.cpp ../O.Common/iocxxxLinux.dbd iocxxxLinux_registerRecordDeviceDriver /home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx
/usr/bin/g++ -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_X86_64_ -DUNIX -Dlinux -O3 -Wall -mtune=generic -m64 -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/APSshare/epics/base-7.0.4.1/include/compiler/gcc -I/APSshare/epics/base-7.0.4.1/include/os/Linux -I/APSshare/epics/base-7.0.4.1/include -I/APSshare/epics/synApps_6_2_1/support/alive-R1-3-1/include -I/APSshare/epics/synApps_6_2_1/support/asyn-R4-42/include -I/APSshare/epics/synApps_6_2_1/support/autosave-R5-10-2/include/os/Linux -I/APSshare/epics/synApps_6_2_1/support/autosave-R5-10-2/include -I/APSshare/epics/synApps_6_2_1/support/busy-R1-7-3/include -I/APSshare/epics/synApps_6_2_1/support/calc-R3-7-4/include -I/APSshare/epics/synApps_6_2_1/support/camac-R2-7-4/include -I/APSshare/epics/synApps_6_2_1/support/dxp-R6-0/include -I/APSshare/epics/synApps_6_2_1/support/dxpSITORO-R1-2/include -I/APSshare/epics/synApps_6_2_1/support/iocStats-3-1-16/include/os/Linux -I/APSshare/epics/synApps_6_2_1/support/iocStats-3-1-16/include -I/APSshare/epics/synApps_6_2_1/support/ether_ip-ether_ip-3-2/include -I/APSshare/epics/synApps_6_2_1/support/ipac-2-16/include -I/APSshare/epics/synApps_6_2_1/support/ip330-R2-10/include -I/APSshare/epics/synApps_6_2_1/support/lua-R3-0-2/include -I/APSshare/epics/synApps_6_2_1/support/mca-R7-9/include/os/Linux -I/APSshare/epics/synApps_6_2_1/support/mca-R7-9/include -I/APSshare/epics/synApps_6_2_1/support/measComp-R4-0/include -I/APSshare/epics/synApps_6_2_1/support/modbus-R3-2/include -I/APSshare/epics/synApps_6_2_1/support/motor-R7-2-2/include -I/APSshare/epics/synApps_6_2_1/support/optics-R2-13-5/include -I/APSshare/epics/synApps_6_2_1/support/quadEM-R9-4/include -I/APSshare/epics/synApps_6_2_1/support/scaler-4-0/include -I/APSshare/epics/synApps_6_2_1/support/softGlue-R2-8-3/include -I/APSshare/epics/synApps_6_2_1/support/softGlueZynq-R2-0-4/include -I/APSshare/epics/synApps_6_2_1/support/sscan-R2-11-4/include -I/APSshare/epics/synApps_6_2_1/support/std-R3-6-3/include -I/APSshare/epics/synApps_6_2_1/support/StreamDevice-2-8-16/include -I/APSshare/epics/synApps_6_2_1/support/vac-R1-9-1/include -I/APSshare/epics/synApps_6_2_1/support/vme-R2-9-4/include -I/APSshare/epics/synApps_6_2_1/support/xspress3-2-5/include -I/APSshare/epics/synApps_6_2_1/support/areaDetector-R3-12-1/include -I/APSshare/epics/synApps_6_2_1/support/areaDetector-R3-12-1/ADCore/include -I/APSshare/epics/synApps_6_2_1/support/areaDetector-R3-12-1/ADSupport/include/os/Linux -I/APSshare/epics/synApps_6_2_1/support/areaDetector-R3-12-1/ADSupport/include -I/APSshare/epics/synApps_6_2_1/support/seq-2-2-9/include -I/APSshare/epics/synApps_6_2_1/support/allenBradley-2-3/include -MM -MF iocxxxLinux_registerRecordDeviceDriver.d iocxxxLinux_registerRecordDeviceDriver.cpp
Installing created dbd file ../../../dbd/iocxxxLinux.dbd
/usr/bin/g++ -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_X86_64_ -DUNIX -Dlinux -O3 -Wall -mtune=generic -m64 -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/APSshare/epics/base-7.0.4.1/include/compiler/gcc -I/APSshare/epics/base-7.0.4.1/include/os/Linux -I/APSshare/epics/base-7.0.4.1/include -I/APSshare/epics/synApps_6_2_1/support/alive-R1-3-1/include -I/APSshare/epics/synApps_6_2_1/support/asyn-R4-42/include -I/APSshare/epics/synApps_6_2_1/support/autosave-R5-10-2/include/os/Linux -I/APSshare/epics/synApps_6_2_1/support/autosave-R5-10-2/include -I/APSshare/epics/synApps_6_2_1/support/busy-R1-7-3/include -I/APSshare/epics/synApps_6_2_1/support/calc-R3-7-4/include -I/APSshare/epics/synApps_6_2_1/support/camac-R2-7-4/include -I/APSshare/epics/synApps_6_2_1/support/dxp-R6-0/include -I/APSshare/epics/synApps_6_2_1/support/dxpSITORO-R1-2/include -I/APSshare/epics/synApps_6_2_1/support/iocStats-3-1-16/include/os/Linux -I/APSshare/epics/synApps_6_2_1/support/iocStats-3-1-16/include -I/APSshare/epics/synApps_6_2_1/support/ether_ip-ether_ip-3-2/include -I/APSshare/epics/synApps_6_2_1/support/ipac-2-16/include -I/APSshare/epics/synApps_6_2_1/support/ip330-R2-10/include -I/APSshare/epics/synApps_6_2_1/support/lua-R3-0-2/include -I/APSshare/epics/synApps_6_2_1/support/mca-R7-9/include/os/Linux -I/APSshare/epics/synApps_6_2_1/support/mca-R7-9/include -I/APSshare/epics/synApps_6_2_1/support/measComp-R4-0/include -I/APSshare/epics/synApps_6_2_1/support/modbus-R3-2/include -I/APSshare/epics/synApps_6_2_1/support/motor-R7-2-2/include -I/APSshare/epics/synApps_6_2_1/support/optics-R2-13-5/include -I/APSshare/epics/synApps_6_2_1/support/quadEM-R9-4/include -I/APSshare/epics/synApps_6_2_1/support/scaler-4-0/include -I/APSshare/epics/synApps_6_2_1/support/softGlue-R2-8-3/include -I/APSshare/epics/synApps_6_2_1/support/softGlueZynq-R2-0-4/include -I/APSshare/epics/synApps_6_2_1/support/sscan-R2-11-4/include -I/APSshare/epics/synApps_6_2_1/support/std-R3-6-3/include -I/APSshare/epics/synApps_6_2_1/support/StreamDevice-2-8-16/include -I/APSshare/epics/synApps_6_2_1/support/vac-R1-9-1/include -I/APSshare/epics/synApps_6_2_1/support/vme-R2-9-4/include -I/APSshare/epics/synApps_6_2_1/support/xspress3-2-5/include -I/APSshare/epics/synApps_6_2_1/support/areaDetector-R3-12-1/include -I/APSshare/epics/synApps_6_2_1/support/areaDetector-R3-12-1/ADCore/include -I/APSshare/epics/synApps_6_2_1/support/areaDetector-R3-12-1/ADSupport/include/os/Linux -I/APSshare/epics/synApps_6_2_1/support/areaDetector-R3-12-1/ADSupport/include -I/APSshare/epics/synApps_6_2_1/support/seq-2-2-9/include -I/APSshare/epics/synApps_6_2_1/support/allenBradley-2-3/include -c iocxxxLinux_registerRecordDeviceDriver.cpp
/usr/bin/g++ -o xxx -L/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/base-7.0.4.1/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/Galil-3-0-V3-6/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/StreamDevice-2-8-16/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/Yokogawa_DAS-R2-0-1/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/alive-R1-3-1/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/areaDetector-R3-12-1/ADCore/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/areaDetector-R3-12-1/ADSupport/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/asyn-R4-42/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/autosave-R5-10-2/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/busy-R1-7-3/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/calc-R3-7-4/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/caputRecorder-R1-7-3/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/dac128V-R2-10-1/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/delaygen-R1-2-2/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/dxp-R6-0/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/ether_ip-ether_ip-3-2/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/iocStats-3-1-16/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/ip-R2-21-1/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/ip330-R2-10/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/ipUnidig-R2-12/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/ipac-2-16/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/lua-R3-0-2/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/mca-R7-9/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/modbus-R3-2/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/motor-R7-2-2/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/optics-R2-13-5/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/quadEM-R9-4/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/scaler-4-0/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/seq-2-2-9/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/softGlue-R2-8-3/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/softGlueZynq-R2-0-4/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/sscan-R2-11-4/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/std-R3-6-3/lib/rhel8-x86_64 -L/net/s100dserv/APSshare/epics/synApps_6_2_1/support/vac-R1-9-1/lib/rhel8-x86_64 -L/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/support/motorVMC/lib/rhel8-x86_64 -L/APSshare/epics/base-7.0.4.1/lib/rhel8-x86_64 -Wl,-rpath,/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/base-7.0.4.1/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/Galil-3-0-V3-6/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/StreamDevice-2-8-16/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/Yokogawa_DAS-R2-0-1/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/alive-R1-3-1/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/areaDetector-R3-12-1/ADCore/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/areaDetector-R3-12-1/ADSupport/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/asyn-R4-42/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/autosave-R5-10-2/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/busy-R1-7-3/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/calc-R3-7-4/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/caputRecorder-R1-7-3/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/dac128V-R2-10-1/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/delaygen-R1-2-2/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/dxp-R6-0/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/ether_ip-ether_ip-3-2/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/iocStats-3-1-16/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/ip-R2-21-1/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/ip330-R2-10/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/ipUnidig-R2-12/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/ipac-2-16/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/lua-R3-0-2/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/mca-R7-9/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/modbus-R3-2/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/motor-R7-2-2/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/optics-R2-13-5/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/quadEM-R9-4/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/scaler-4-0/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/seq-2-2-9/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/softGlue-R2-8-3/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/softGlueZynq-R2-0-4/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/sscan-R2-11-4/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/std-R3-6-3/lib/rhel8-x86_64 -Wl,-rpath,/net/s100dserv/APSshare/epics/synApps_6_2_1/support/vac-R1-9-1/lib/rhel8-x86_64 -Wl,-rpath,/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/support/motorVMC/lib/rhel8-x86_64 -Wl,-rpath,/APSshare/epics/base-7.0.4.1/lib/rhel8-x86_64 -rdynamic -m64 iocxxxLinux_registerRecordDeviceDriver.o xxxMain.o -lGalilSupport -lmw100 -lsoftGlueZynq -lsoftGlue -lip330 -ldac128V -lipUnidig -lIpac -ldxp -lhandel -lvac -ldelaygen -lalive -lether_ip -ldevIocStats -lstream -lParker -lSmartMotor -lThorLabs -lsoftMotor -lmotorSimSupport -lMclennan -lMicos -lMicroMo -lNewFocus -lNewport -lOriel -lPI -lPIJena -lAcs -lacsTech80 -lAerotech -lAttocube -lFaulhaber -lIms -lKohzuMotor -lmotor -lvmc -lmodbus -llua -lip -lquadEM -lmca -loptics -lautosave -lscanProgress -lsscan -lbusy -lcalc -lscaler -lstd -lasyn -lseq -lpv -lcaputRecorder -ldbRecStd -ldbCore -lca -lCom -lNDPlugin -lADBase -lntndArrayConverter -lnt -lpvDatabase -lpvAccessIOC -lpvAccessCA -lpvAccess -lpvData -lnetCDF -lMagick++ -lcoders -lMagick -ljbig -ljp2 -lbzlib -lpng -lwebp -llcms -lttf -lwmf -lfilters -lnanohttp_stream -ltiff -lxml2 -lNeXus -lhdf5 -lhdf5_hl -lbitshuffle -lblosc -lszip -lzlib -ljpeg -lasyn -lalive -lautosave -lbusy -lcalc -ldevIocStats -lsscan -lseq -lpv -ldbRecStd -ldbCore -lca -lCom -lusb -ltirpc -lX11 -lXext
Installing created executable ../../../bin/rhel8-x86_64/xxx
make[3]: Leaving directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/xxxApp/src/O.rhel8-x86_64'
make[2]: Leaving directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/xxxApp/src'
make -C ./Db install
make[2]: Entering directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/xxxApp/Db'
make -C O.rhel8-x86_64 -f ../Makefile TOP=../../.. \
T_A=rhel8-x86_64 install
make[3]: Entering directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/xxxApp/Db/O.rhel8-x86_64'
make[3]: Nothing to be done for 'install'.
make[3]: Leaving directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/xxxApp/Db/O.rhel8-x86_64'
make[2]: Leaving directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/xxxApp/Db'
make -C ./op install
make[2]: Entering directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/xxxApp/op'
make[2]: Nothing to be done for 'install'.
make[2]: Leaving directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/xxxApp/op'
make[1]: Leaving directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/xxxApp'
make -C ./iocBoot install
make[1]: Entering directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/iocBoot'
make -C ./iocxxx install
make[2]: Entering directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/iocBoot/iocxxx'
perl -CSD /APSshare/epics/base-7.0.4.1/bin/rhel8-x86_64/convertRelease.pl -t /home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx envPaths
make[2]: Leaving directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/iocBoot/iocxxx'
make[1]: Leaving directory '/home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/ioc/xxx/iocBoot'
5.6 Confirm the libvmc is included in the IOC's binary
$ ldd bin/${EPICS_HOST_ARCH}/xxx | grep vmc
output
libvmc.so => /home/beams/USERNAME/PET-S2/epics/synApps_6_2_1/support/motorVMC/lib/rhel8-x86_64/libvmc.so (0x00007f8d283df000)
5.7 Add the VMC config to the IOC
5.7.1 Copy the example VMC config
$ cp -p ${SUPPORT_DIR}/motorVMC/iocs/vmcIOC/iocBoot/iocvmc/vmc.cmd ${IOC_DIR}/xxx/iocBoot/iocxxx/iocsh/
$ cp -p ${SUPPORT_DIR}/motorVMC/iocs/vmcIOC/iocBoot/iocvmc/vmc.substitutions ${IOC_DIR}/xxx/iocBoot/iocxxx/substitutions/
5.7.2 Modify iocsh/vmc.cmd
$ cd ${IOC_DIR}/xxx/iocBoot/iocxxx
$ gedit iocsh/vmc.cmd &
Make the following changes:
- Change the
VMC_PORT
from 31337 to a random number between 30000 and 65000 - Comment out the dbLoadRecords calls that load asyn_motor.db
- Uncomment the dbLoadTemplate call that loads vmc.substitutions
- Change
vmc.substitutions
tosubstitutions/vmc.substitutions
in the dbLoadTemplate call - Comment out the "1-second idle polling" VirtualMotorCreateController call
- Uncomment the "Extra axes, 10-second idle polling" VirtualMotorCreateController call
- Change the
R
macro of the dbLoadRecords call that loads asynRecord.db fromasyn1
toasyn_1
solution
diff --git a/iocBoot/iocxxx/iocsh/vmc.cmd b/iocBoot/iocxxx/iocsh/vmc.cmd
index 229b985..3754207 100644
--- a/iocBoot/iocxxx/iocsh/vmc.cmd
+++ b/iocBoot/iocxxx/iocsh/vmc.cmd
@@ -1,6 +1,6 @@
### Virtual Motor Controller support
-epicsEnvSet("VMC_PORT", "31337")
+epicsEnvSet("VMC_PORT", "33333")
drvAsynIPPortConfigure("VMC_ETH","127.0.0.1:$(VMC_PORT)", 0, 0, 0)
@@ -16,11 +16,11 @@ asynOctetSetInputEos("VMC_ETH",0,"\r\n")
asynOctetSetOutputEos("VMC_ETH",0,"\r")
# These motor records can get their prefix from the environment variable
-dbLoadRecords("$(MOTOR)/db/asyn_motor.db","P=$(PREFIX),M=m1,DTYP=asynMotor,PORT=VMC1,ADDR=0,DESC=X,EGU=mm,DIR=Pos,VELO=1,VBAS=.1,ACCL=.2,BDST=0,BVEL=1,BACC=.2,MRES=.0025,PREC=4,DHLM=100,DLLM=-100,INIT=")
-dbLoadRecords("$(MOTOR)/db/asyn_motor.db","P=$(PREFIX),M=m2,DTYP=asynMotor,PORT=VMC1,ADDR=1,DESC=Y,EGU=mm,DIR=Pos,VELO=1,VBAS=.1,ACCL=.2,BDST=0,BVEL=1,BACC=.2,MRES=.0025,PREC=4,DHLM=100,DLLM=-100,INIT=")
-dbLoadRecords("$(MOTOR)/db/asyn_motor.db","P=$(PREFIX),M=m3,DTYP=asynMotor,PORT=VMC1,ADDR=2,DESC=Z,EGU=mm,DIR=Pos,VELO=1,VBAS=.1,ACCL=.2,BDST=0,BVEL=1,BACC=.2,MRES=.0025,PREC=4,DHLM=100,DLLM=-100,INIT=")
+#!dbLoadRecords("$(MOTOR)/db/asyn_motor.db","P=$(PREFIX),M=m1,DTYP=asynMotor,PORT=VMC1,ADDR=0,DESC=X,EGU=mm,DIR=Pos,VELO=1,VBAS=.1,ACCL=.2,BDST=0,BVEL=1,BACC=.2,MRES=.0025,PREC=4,DHLM=100,DLLM=-100,INIT=")
+#!dbLoadRecords("$(MOTOR)/db/asyn_motor.db","P=$(PREFIX),M=m2,DTYP=asynMotor,PORT=VMC1,ADDR=1,DESC=Y,EGU=mm,DIR=Pos,VELO=1,VBAS=.1,ACCL=.2,BDST=0,BVEL=1,BACC=.2,MRES=.0025,PREC=4,DHLM=100,DLLM=-100,INIT=")
+#!dbLoadRecords("$(MOTOR)/db/asyn_motor.db","P=$(PREFIX),M=m3,DTYP=asynMotor,PORT=VMC1,ADDR=2,DESC=Z,EGU=mm,DIR=Pos,VELO=1,VBAS=.1,ACCL=.2,BDST=0,BVEL=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)")
+dbLoadTemplate("substitutions/vmc.substitutions", "P=$(PREFIX)")
# VirtualMotorController(
# portName The name of the asyn port that will be created for this driver
@@ -30,12 +30,12 @@ dbLoadRecords("$(MOTOR)/db/asyn_motor.db","P=$(PREFIX),M=m3,DTYP=asynMotor,PORT=
# idlePollPeriod The time between polls when no axis is moving
# 1-second idle polling
-VirtualMotorCreateController("VMC1", "VMC_ETH", 3, 250, 1000)
+#!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)
+VirtualMotorCreateController("VMC1", "VMC_ETH", 8, 250, 10000)
-dbLoadRecords("$(ASYN)/db/asynRecord.db","P=$(PREFIX),R=asyn1,PORT=VMC_ETH,ADDR=0,OMAX=0,IMAX=0")
+dbLoadRecords("$(ASYN)/db/asynRecord.db","P=$(PREFIX),R=asyn_1,PORT=VMC_ETH,ADDR=0,OMAX=0,IMAX=0")
5.7.3 Modify st.cmd.Linux
$ gedit st.cmd.Linux &
Make the following change:
- Add a line that sources iocsh/vmc.cmd after common.iocsh and before iocInit
solution
$ git diff iocBoot/iocxxx/st.cmd.Linux
diff --git a/iocBoot/iocxxx/st.cmd.Linux b/iocBoot/iocxxx/st.cmd.Linux
index 588dda7..b8f6949 100644
--- a/iocBoot/iocxxx/st.cmd.Linux
+++ b/iocBoot/iocxxx/st.cmd.Linux
@@ -15,6 +15,9 @@ iocxxxLinux_registerRecordDeviceDriver(pdbbase)
< override.iocsh
< common.iocsh
< iocsh/motors.iocsh
+< iocsh/vmc.cmd
#- devIocStats
dbLoadRecords("$(DEVIOCSTATS)/db/iocAdminSoft.db","IOC=$(PREFIX)")
#- PV aliases change :: into :
5.8 Launch a motor screen
Follow the instructions in step 3.4 if a motor screen isn't already open.
5.9 Run the IOC
Run the IOC in the terminal:
$ ./softioc/xxx.sh run
Scroll back until you see the error connecting to the virtual motor controller:
drvAsynIPPortConfigure("VMC_ETH","127.0.0.1:33333", 0, 0, 0)
2023/01/12 14:38:30.980 VMC_ETH -1 autoConnect could not connect: Can't connect to 127.0.0.1:33333: Connection refused
Try to move a motor
Type ctrl+c
to kill the IOC.
5.10 Start the Virtual Motor Controller
5.10.1 server.py syntax
$ ${SUPPORT_DIR}/motorVMC/python/server.py -h
output
Usage: server.py [-ph]
Options:
-p,--port=NUMBER Listen on the specified port NUMBER for incoming
connections (default: 31337)
-h,--help Print usage message and exit
5.10.2 Start servery.py in a different terminal window
Reminder: the port argument passed to the -p
option must match the value of VMC_PORT
chosen in step 5.7.2
$ xterm -e "${SUPPORT_DIR}/motorVMC/python/server.py -p 33333" &
output
Listening on port 33333
5.11 Start the IOC
Start the IOC in a screen session so the terminal remains usable.
$ ./softioc/xxx.sh start
The virtual motors should be usable now.