ecmccfg

A configuration framework for ECMC Motion Control Module for EPICS.

Purpose

The configuration framework contains the necessary files to configure an EPICS IOC for EtherCAT based motion control and DAQ.


Topics


provided common user commands

  • addAxis.cmd
  • addDataStorage.cmd
  • addMaster.cmd
  • addSlave.cmd
  • addSlaveKL.cmd
  • addVirtualAxis.cmd
  • applyAxisSynchronization.cmd
  • applyConfig.cmd
  • applySlaveConfig.cmd
  • configureAxis.cmd
  • configureSlave.cmd
  • configureVirtualAxis.cmd
  • loadPLCFile.cmd
  • loadPlugin.cmd
  • setAppMode.cmd
  • setDiagnostics.cmd

Example IOC

  1. require the configuration module with optional version
require ecmccfg <VERSION>
  1. add a coupler and slave
# 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"
  1. add more slaves and apply configuration to the slaves
# 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"
  1. apply the configuration
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}applyConfig.cmd
  1. additional configuration

manually set binaryOutput01 to 1

ecmcConfigOrDie "Cfg.WriteEcEntryIDString(${ECMC_EC_SLAVE_NUM_DIG_OUT},binaryOutput01,1)"
  1. adding a physical motor axis
  • classic config
epicsEnvSet("DEV",      "STEST-MYDEVICE")
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}configureAxis.cmd,  "CONFIG=./cfg/axis_1"
  • yaml config
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}addAxisYaml.cmd, "FILE=./AM8111_CSV_minimum.yaml, ECMC_TMPDIR=/tmp/"
  1. adding a virtual motor axis
${SCRIPTEXEC} ${ecmccfg_DIR}configureVirtualAxis.cmd,     "CONFIG=./cfg/axis_11_virt"
  1. adding synchronization
${SCRIPTEXEC} ${ecmccfg_DIR}applyAxisSynchronization.cmd, "CONFIG=./cfg/axis_1_sync"
${SCRIPTEXEC} ${ecmccfg_DIR}applyAxisSynchronization.cmd, "CONFIG=./cfg/axis_11_sync"
  1. loading a PLC from file
  • classic PLC-file
${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "PLC_ID=0, FILE=./plc/homeSlit.plc, SAMPLE_RATE_MS=100"
  • pure yaml based PLC
${SCRIPTEXEC} "${ECMC_CONFIG_ROOT}loadYamlPlc.cmd" "FILE=./plc1.yaml, ECMC_TMPDIR=/tmp/"
  • yaml definition, with classic PLC-file, Note: file key in yaml config will overwrite anything in the code key!
${SCRIPTEXEC} "${ECMC_CONFIG_ROOT}loadYamlPlc.cmd" "FILE=./plc1File.yaml, ECMC_TMPDIR=/tmp/"
  1. go active
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd