diff --git a/test/run-ethercatmc-ioc.sh b/test/run-ethercatmc-ioc.sh index 85a8778d..89fa0098 100755 --- a/test/run-ethercatmc-ioc.sh +++ b/test/run-ethercatmc-ioc.sh @@ -14,12 +14,15 @@ APPXX=ethercatmc # shellcheck disable=SC2012 TOP=$(echo $PWD/.. | sed -e "s%/test/\.\.$%%") export APPXX -EPICS_EEE_E3=classic DOLOG= +EPICS_EEE_E3=classic +EPICSTWINCATADS="" HOST="" +LOCALAMSNETID="" MOTORPORT="" +NOMAKE="" +NORUN="" REMOTEAMSNETID="" -LOCALAMSNETID="" ## functions help_and_exit() { @@ -34,6 +37,9 @@ help_and_exit() { *sim-indexer) echo >&2 $0 " $cmd" ;; + *-ads) + echo >&2 $0 " $cmd" " :48898" + ;; *-indexer) echo >&2 $0 " $cmd" " :48898" ;; @@ -216,11 +222,6 @@ if test -z "$EPICS_HOST_ARCH"; then exit 1 fi -NOMAKE="" -NORUN="" -EPICSTWINCATADS="" -DOLOG="" - # pick up some arguments PARAM="$1" while test "$PARAM" != ""; do @@ -254,19 +255,8 @@ while test "$PARAM" != ""; do esac done -# Which of the 2 commands needs to be run ? -# Only one of them: Either ADS or TCP -if test "$EPICSTWINCATADS" = y; then - ASYNPORTCONFIGUREUSE="adsAsynPortDriverConfigure" - ASYNPORTCONFIGUREDONTUSE="drvAsynIPPortConfigure" -else - ASYNPORTCONFIGUREUSE="drvAsynIPPortConfigure" - ASYNPORTCONFIGUREDONTUSE="adsAsynPortDriverConfigure" -fi - export NOMAKE export NORUN -export ASYNPORTCONFIGUREDONTUSE MOTORCFG="$1" export MOTORCFG @@ -278,8 +268,12 @@ shift # motor port is different for indexer case $MOTORCFG in + *-ads) + MOTORPORT=48898 + EPICSTWINCATADS=y + ;; *sim-indexer) ;; - *indexer) + *-indexer) MOTORPORT=48898 ;; *) @@ -287,6 +281,18 @@ case $MOTORCFG in ;; esac +# Which of the 2 commands needs to be run ? +# Only one of them: Either ADS or TCP +if test "$EPICSTWINCATADS" = y; then + ASYNPORTCONFIGUREUSE="adsAsynPortDriverConfigure" + ASYNPORTCONFIGUREDONTUSE="drvAsynIPPortConfigure" +else + ASYNPORTCONFIGUREUSE="drvAsynIPPortConfigure" + ASYNPORTCONFIGUREDONTUSE="adsAsynPortDriverConfigure" +fi +export ASYNPORTCONFIGUREUSE +export ASYNPORTCONFIGUREDONTUSE + PARAM="$1" while test "$PARAM" != ""; do case $1 in diff --git a/test/startup/st.mcu010-ads.iocsh b/test/startup/st.mcu010-ads.iocsh new file mode 100644 index 00000000..c3081e58 --- /dev/null +++ b/test/startup/st.mcu010-ads.iocsh @@ -0,0 +1,42 @@ +epicsEnvSet("MOTOR_PORT", "$(SM_MOTOR_PORT=MCU1)") + +epicsEnvSet("IPADDR", "$(SM_IPADDR=127.0.0.1)") +epicsEnvSet("IPPORT", "$(SM_IPPORT=48898)") +epicsEnvSet("AMSNETIDIOC", "LOCALAMSNETIDXX") +epicsEnvSet("ASYN_PORT", "$(SM_ASYN_PORT=MC_CPU1)") +epicsEnvSet("SYSPFX", "$(SM_SYSPFX=LabS-MCAG:MC-MCU-10:)") +epicsEnvSet("MCUPFX", "") +epicsEnvSet("PREC", "$(SM_PREC=3)") +epicsEnvSet("SM_NOAXES", "2") +epicsEnvSet("ADSPORT", "$(ECM_ADSPORT=852)") +epicsEnvSet("ECM_OPTIONS", "") + +epicsEnvSet("MOVINGPOLLPERIOD", "200") +epicsEnvSet("IDLEPOLLPERIOD", "500") +< ethercatmcController.iocsh + + +# +# Axis 1 +# +epicsEnvSet("AXISCONFIG", "") +epicsEnvSet("AXIS_NAME", "$(SM_AXIS_NAME=m1)") +epicsEnvSet("AXIS_NO", "$(SM_AXIS_NO=1)") +epicsEnvSet("DESC", "$(SM_DESC=DESC)") +epicsEnvSet("EGU", "$(SM_EGU=EGU)") +epicsEnvSet("RAWENCSTEP_ADEL", 0) +epicsEnvSet("RAWENCSTEP_MDEL", 0) +< ethercatmcAxis.iocsh +< ethercatmcAxisdebug.iocsh + +# +# Axis 2 +# +epicsEnvSet("AXISCONFIG", "") +epicsEnvSet("AXIS_NAME", "$(SM_AXIS_NAME=m2)") +epicsEnvSet("AXIS_NO", "$(SM_AXIS_NO=2)") +epicsEnvSet("RAWENCSTEP_ADEL", 0) +epicsEnvSet("RAWENCSTEP_MDEL", 0) +< ethercatmcAxis.iocsh +< ethercatmcAxisdebug.iocsh +