A configuration framework for ECMC Motion Control Module for EPICS.
The configuration framework contains the necessary files to configure an EPICS IOC for EtherCAT based motion control and DAQ.
require
the configuration module with optional versionrequire ecmccfg <VERSION>
# slave 0 {ecmcEK1100}
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}addSlave.cmd, "HW_DESC=EK1100"
# SLAVE_ID is automatically incremented
# slave 1 {ecmcEL1018}
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}addSlave.cmd, "HW_DESC=EL1018"
# skip slaves 2..6
# slave 7 {ecmcEL2008}, with optional SLAVE_ID
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}addSlave.cmd, "HW_DESC=E2008, SLAVE_ID=7"
#-- ATTENTION, this only work for certain slaves, as the EPICS templates have to be migrated before
# slave 9 {ecmcEL2008}, with optional SLAVE_ID and P_SCRIPT
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}addSlave.cmd, "HW_DESC=E2008, SLAVE_ID=7, P_SCRIPT=mXsXXX"
# slave 8 {ecmcEL7037}, configure slave with optional SLAVE_ID
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}configureSlave.cmd, "HW_DESC=EL7037, CONFIG=-Motor-Nanotec-ST4118L1804-B, SLAVE_ID=8"
# slave 9 {ecmcEL7037}, addSlave, with immediate call off applySlaveConfig
# slave with global configuration
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}addSlave.cmd, "HW_DESC=EL7037"
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}applySlaveConfig, "CONFIG=-Motor-Nanotec-ST4118L1804-B"
# slave with local configuration, in this case provided by the module `ECMC_AGIR`
epicsEnvSet("CFG_ROOT", "${ECMC_AGIR_DIR}/")
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}addSlave.cmd, "HW_DESC=EP7211-0034_ALL"
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}applySlaveConfig.cmd, "LOCAL_CONFIG=${CFG_ROOT}AM8211_AGIR.cfg"
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}applyConfig.cmd
manually set binaryOutput01
to 1
ecmcConfigOrDie "Cfg.WriteEcEntryIDString(${ECMC_EC_SLAVE_NUM_DIG_OUT},binaryOutput01,1)"
epicsEnvSet("DEV", "STEST-MYDEVICE")
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}configureAxis.cmd, "CONFIG=./cfg/axis_1"
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}addAxisYaml.cmd, "FILE=./AM8111_CSV_minimum.yaml, ECMC_TMPDIR=/tmp/"
${SCRIPTEXEC} ${ecmccfg_DIR}configureVirtualAxis.cmd, "CONFIG=./cfg/axis_11_virt"
${SCRIPTEXEC} ${ecmccfg_DIR}applyAxisSynchronization.cmd, "CONFIG=./cfg/axis_1_sync"
${SCRIPTEXEC} ${ecmccfg_DIR}applyAxisSynchronization.cmd, "CONFIG=./cfg/axis_11_sync"
${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "PLC_ID=0, FILE=./plc/homeSlit.plc, SAMPLE_RATE_MS=100"
${SCRIPTEXEC} "${ECMC_CONFIG_ROOT}loadYamlPlc.cmd" "FILE=./plc1.yaml, ECMC_TMPDIR=/tmp/"
file
key in yaml config will overwrite anything in the code
key!${SCRIPTEXEC} "${ECMC_CONFIG_ROOT}loadYamlPlc.cmd" "FILE=./plc1File.yaml, ECMC_TMPDIR=/tmp/"
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd