From 1c137755cca7f0715fd032f1f2d79ea16d4a3866 Mon Sep 17 00:00:00 2001 From: MarkRivers Date: Wed, 22 Mar 2006 22:54:44 +0000 Subject: [PATCH] New file for simulation IOC --- iocBoot/iocSim/Makefile | 8 +++++++ iocBoot/iocSim/README | 34 ++++++++++++++++++++++++++++++ iocBoot/iocSim/motor.substitutions | 9 ++++++++ iocBoot/iocSim/st.cmd.Vx | 27 ++++++++++++++++++++++++ iocBoot/iocSim/st.cmd.unix | 14 ++++++++++++ iocBoot/iocSim/st.cmd.win32 | 14 ++++++++++++ 6 files changed, 106 insertions(+) create mode 100755 iocBoot/iocSim/Makefile create mode 100644 iocBoot/iocSim/README create mode 100644 iocBoot/iocSim/motor.substitutions create mode 100644 iocBoot/iocSim/st.cmd.Vx create mode 100644 iocBoot/iocSim/st.cmd.unix create mode 100755 iocBoot/iocSim/st.cmd.win32 diff --git a/iocBoot/iocSim/Makefile b/iocBoot/iocSim/Makefile new file mode 100755 index 00000000..d17b764b --- /dev/null +++ b/iocBoot/iocSim/Makefile @@ -0,0 +1,8 @@ +TOP = ../.. +include $(TOP)/configure/CONFIG +ARCH = linux-x86 +#ARCH = vxWorks-ppc604 +TARGETS = cdCommands +TARGETS += envPaths +include $(TOP)/configure/RULES.ioc + diff --git a/iocBoot/iocSim/README b/iocBoot/iocSim/README new file mode 100644 index 00000000..beda43cc --- /dev/null +++ b/iocBoot/iocSim/README @@ -0,0 +1,34 @@ +To build any examples; + +- in /configure/RELEASE: EPICS_BASE and MOTOR must be defined. + +- in /Makefile: the following two lines must be uncommented; + #DIRS := $(DIRS) $(filter-out $(DIRS), motorExApp) + #DIRS := $(DIRS) $(filter-out $(DIRS), iocBoot) + +To build this simulation example; + +- in /configure/RELEASE: ASYN must be defined. + +- in /motorExApp/Makefile: #DIRS += WithMPF must be uncommented. + +- in /motorExApp/WithMPF/Makefile: uncomment both, + #!WithMPF_LIBS += motorSimSupport + and, + #!WithMPFVx_LIBS += motorSimSupport + +- in both /motorExApp/WithMPF/WithMPFInclude.dbd, and in + /motorExApp/WithMPF/WithMPFVxInclude.dbd + uncomment, #include "motorSimSupport.dbd" + +- in /iocBoot/iocSim/Makefile set the target architecture + +Finally, cd ; gnumake clean uninstall; gnumake + +To run this simulation example on a Unix OS; +- Set the EPICS_HOST_ARCH environment variable correctly. +- Edit the st.cmd.unix file for either sun or linux. +- Start the ioc from this directory by executing the following command. + +../../bin/${EPICS_HOST_ARCH}/WithMPF st.cmd.unix + diff --git a/iocBoot/iocSim/motor.substitutions b/iocBoot/iocSim/motor.substitutions new file mode 100644 index 00000000..94b1a1ec --- /dev/null +++ b/iocBoot/iocSim/motor.substitutions @@ -0,0 +1,9 @@ +file "$(MOTOR)/db/basic_asyn_motor.db" +{ +pattern +{P, N, M, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, VBAS, ACCL, BDST, BVEL, BACC, MRES, PREC, DHLM, DLLM, INIT} +{IOC:, 1, m$(N), "asynMotor", motorSim1, 0, "motor $(N)", degrees, Pos, 1, .1, .2, 0, 1, .2, 0.01, 5, 100, -100, ""} +{IOC:, 2, m$(N), "asynMotor", motorSim1, 1, "motor $(N)", degrees, Pos, 1, .1, .2, 0, 1, .2, 0.01, 5, 100, -100, ""} +{IOC:, 3, m$(N), "asynMotor", motorSim1, 2, "motor $(N)", degrees, Pos, 1, .1, .2, 0, 1, .2, 0.01, 5, 100, -100, ""} +{IOC:, 4, m$(N), "asynMotor", motorSim1, 3, "motor $(N)", degrees, Pos, 1, .1, .2, 0, 1, .2, 0.01, 5, 100, -100, ""} +} diff --git a/iocBoot/iocSim/st.cmd.Vx b/iocBoot/iocSim/st.cmd.Vx new file mode 100644 index 00000000..55d97821 --- /dev/null +++ b/iocBoot/iocSim/st.cmd.Vx @@ -0,0 +1,27 @@ +# The is the ASYN example for communication to 4 simulated motors +# "#!" marks lines that can be uncommented. + +# The following must be added for many board support packages +#!cd "... IOC st.cmd complete directory path ... " + +< cdCommands +#!< ../nfsCommands + +cd topbin + +# If the VxWorks kernel was built using the project facility, the following must +# be added before any C++ code is loaded (see SPR #28980). +sysCplusEnable=1 + +ld < WithMPFVx.munch + +cd startup +dbLoadDatabase("$(TOP)/dbd/WithMPFVx.dbd") +WithMPF_registerRecordDeviceDriver(pdbbase) +dbLoadTemplate("motor.substitutions") + +# Create simulated motors: ( start card , start axis , low limit, high limit, home posn, # cards, # axes to setup) +motorSimCreate( 0, 0, -32000, 32000, 0, 1, 4 ) +# Setup the Asyn layer (portname, low-level driver drvet name, card, number of axes on card) +drvAsynMotorConfigure("motorSim1", "motorSim", 0, 4) +iocInit diff --git a/iocBoot/iocSim/st.cmd.unix b/iocBoot/iocSim/st.cmd.unix new file mode 100644 index 00000000..6b6cbc10 --- /dev/null +++ b/iocBoot/iocSim/st.cmd.unix @@ -0,0 +1,14 @@ +# The is the ASYN example for communication to 4 simulated motors +# "#!" marks lines that can be uncommented. + +< envPaths + +dbLoadDatabase("$(TOP)/dbd/WithMPF.dbd") +WithMPF_registerRecordDeviceDriver(pdbbase) +dbLoadTemplate("motor.substitutions") + +# Create simulated motors: ( start card , start axis , low limit, high limit, home posn, # cards, # axes to setup) +motorSimCreate( 0, 0, -32000, 32000, 0, 1, 4 ) +# Setup the Asyn layer (portname, low-level driver drvet name, card, number of axes on card) +drvAsynMotorConfigure("motorSim1", "motorSim", 0, 4) +iocInit diff --git a/iocBoot/iocSim/st.cmd.win32 b/iocBoot/iocSim/st.cmd.win32 new file mode 100755 index 00000000..7f861f0c --- /dev/null +++ b/iocBoot/iocSim/st.cmd.win32 @@ -0,0 +1,14 @@ +# The is the ASYN example for communication to 4 simulated motors +# "#!" marks lines that can be uncommented. + +< envPaths + +dbLoadDatabase("$(TOP)/dbd/WithMPFWin32.dbd") +WithMPFWin32_registerRecordDeviceDriver(pdbbase) +dbLoadTemplate("motor.substitutions") + +# Create simulated motors: ( start card , start axis , low limit, high limit, home posn, # cards, # axes to setup) +motorSimCreate( 0, 0, -32000, 32000, 0, 1, 4 ) +# Setup the Asyn layer (portname, low-level driver drvet name, card, number of axes on card) +drvAsynMotorConfigure("motorSim1", "motorSim", 0, 4) +iocInit