From 4bb8e6a9597363c7b48c6973a2c6c7e1c595e1ea Mon Sep 17 00:00:00 2001
From: anderssandstrom
Possible reasons:
This procedure is for experts only. You run the risk of destroying expansive devices! Limit switches are not obeyed! YOU HAVE BEEN WARNED!
For this however, the IOC needs to be reconfigured to not link the hardware to an axis!
dbgrep "*s007*"
-Drv01-Cmd
and -Drv01-Spd
-Drv01-Cmd
to 1
and check the amplifier did enable, if you don’t know how to check for an enabled amplifier, you should not use this command!-Drv01-Spd
. Depending on the scaling, the number might be in the range of 1..1000.Sometimes two limit switches are needed, but only one can be linked in the yaml configuration. A use case could be if two axes have overlapping ranges and a switch is used to prevent them from colliding.
In order to configurethis a PLC needs to be added where the two limits switches are combined with a “and” (for normally closed switches) into one bit by the use of the simulation entries (ec
Example (use ec0.s2.ZERO.31 as combined limit switch):
# Master 0
+# Drive slave 3 (can be any slave)
+# Bit 31
+# Switch 1: ec0.s5.binaryInput01
+# Switch 2: ec0.s5.binaryInput02
+ec0.s3.ZERO:=ec_wrt_bit(ec0.s3.ZERO,ec0.s5.binaryInput01 and ec0.s5.binaryInput02,31);
+
Then use as forward or backward bit in yaml:
input:
+ limit:
+ forward: ec0.s2.ZERO.31 # In PLC "ec0.s5.binaryInput01 and ec0.s5.binaryInput02"
+ backward: ....
+
For an overview of an ecmc system, the ecmcMain.ui panel is a good starting point. The ecmcMain.ui covers most parts of an ecmc system:
The panel is started with the following syntax:
caqtdm -macro "IOC=<ioc_name>" ecmcMain.ui
There are normally several control loops in an ecmc motion system:
The position loop control parameters can be accessed and tuned by PVs. Normally, a pure P controller is enough (ki and kp set to 0) but sometimes the I and D part can be needed.
Backlash
Tuning systems with backlash can be difficult. Sometimes a small D-part helps to reduce spikes in the centralized ecmc position loop controller output.
These control loops need to be tuned in the drive.
For EL70x1, see EL70x1 Tuning For other drives, consult the dedicated manual.
This is the respective plc file
ax${AXIS_NO}.enc.actpos:=(ax{{ var.ty1 }}.enc.actpos+ax{{ var.ty2 }}.enc.actpos)/2;
Note the mixed use to MACROs ${AXIS_NO}
and local variables {{ var.ty1 }}
to boost flexibility.
This will affect the motorRecord only, thus ECMC internally is still moving in the wrong direction. You have been warned!
The following sequences are available:
ECMC_SEQ_HOME_NOT_VALID = 0,
+ecmccfg > manual > motion > homing
The following sequences are available:
ECMC_SEQ_HOME_NOT_VALID = 0,
ECMC_SEQ_HOME_LOW_LIM = 1,
ECMC_SEQ_HOME_HIGH_LIM = 2,
ECMC_SEQ_HOME_LOW_LIM_HOME = 3,
@@ -24,7 +24,7 @@
ECMC_SEQ_HOME_HIGH_LIM_SINGLE_TURN_ABS = 22,
ECMC_SEQ_HOME_SET_POS_2 = 25,
ECMC_SEQ_HOME_TRIGG_EXTERN = 26,
-
Not a valid homing sequence, can be used if encoder is absolute.
Some additional parameters need to be defined for this homing sequence should work (Example for el5101 ):
epicsEnvSet("ECMC_EC_ENC_LATCHPOS", "ec0.s3.encoderLatchPostion01") # Ethercat entry for latch position (only valid for home seq 11,12)
+
Additionally, for homing of absolute encoder with ONE overflow in the range, please check here
Not a valid homing sequence, can be used if encoder is absolute.
Some additional parameters need to be defined for this homing sequence should work (Example for el5101 ):
epicsEnvSet("ECMC_EC_ENC_LATCHPOS", "ec0.s3.encoderLatchPostion01") # Ethercat entry for latch position (only valid for home seq 11,12)
epicsEnvSet("ECMC_EC_ENC_LATCH_CONTROL", "ec0.s3.encoderControl01.0") # Ethercat entry for latch control (only valid for home seq 11,12)
epicsEnvSet("ECMC_EC_ENC_LATCH_STATUS", "ec0.s3.encoderStatus01.0") # Ethercat entry for latch status (only valid for home seq 11,12)
epicsEnvSet("ECMC_HOME_LATCH_COUNT_OFFSET","2") # Number of latch/over/under-flow for home (home seq 11,12,21,22)
@@ -86,5 +86,49 @@
In this example also the drive modes is automatically handled by ecmc.setting polarity of home sensor
For some of the sequences it could be useful to change the polarity of the home sensor. That can be done with the following command:
"Cfg.SetAxisMonHomeSwitchPolarity(int axisIndex, int polarity)";
# polarity==0 is NC (default)
# polarity==1 is NO
+
Homing of absolute encoder with ONE overflow in the range
ALWAYS adjust the absolute encoder so that no overflows occur within the motion range if possible.
+However, for some situations it might be hard to adjust the encoder and then a special homing needs to be performed. No dedicated homing seq exists for this in ecmc but it can be handled in plc code (needs ecmc 9.6.2).
Example:
/*
+ PLC code to home an axis with an absolute encoder which has ONE overflow in the range
+ If actual encoder value is higher than ${THRESHOLD} it will be referenced to current actual position - ${RANGE}.
+
+ NOTE: Make sure the default axis encoder scaling offset is made correct for the lower part of the raw values.
+
+ macros:
+ AX_ID : ID of axis
+ ENC_ID : ID of encoder (starts from 1)
+ THRESHOLD : Threshold to identify overflow (in EGU)
+ RANGE : The total range of the encoder both multi turn and single turn (in EGU)
+ DBG : Printout debug messages set to empty (DBG='')
+*/
+
+if(${SELF}.firstscan) {
+ var plc:=${SELF_ID};
+ ${DBG=#}println('PLC ',plc,' Initiating homing seq for abs. encoder with overflow');
+};
+
+if(mc_get_enc_ready(${AX_ID=1},${ENC_ID=1}) and not(static.encoderHomed)) {
+ ${DBG=#}println('Checking if homing encoder is needed');
+
+ /* Set the new position if needed */
+ if(mc_get_act_pos(${AX_ID=1},${ENC_ID=1}) > ${THRESHOLD=0}) {
+ ${DBG=#}println('Homing encoder to: ', mc_get_act_pos(${AX_ID=1},${ENC_ID=1})-${RANGE=0});
+ mc_set_act_pos(${AX_ID=1},${ENC_ID=1},mc_get_act_pos(${AX_ID=1},${ENC_ID=1})-${RANGE=0});
+ } else {
+ ${DBG=#}println('Homing not needed!');
+ };
+
+ static.encoderHomed${AX_ID=1}_${ENC_ID=1}:=1;
+}
+
+/* Do not allow power on axis if encoder is not homed*/
+if(not(static.encoderHomed${AX_ID=1}_${ENC_ID=1})) {
+ ${DBG=#}println('Waiting for encoder ready and homing...')
+ mc_power(${AX_ID=1},0);
+};
+
The code is accessible in file here. The file is installed with ecmccfg and can be loaded from in ecmccfg_DIR.
${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=${ecmccfg_DIR}home_abs_enc_overflow.plc_inc, SAMPLE_RATE_MS=1000, PLC_MACROS='DBG='"
+
The file can also be included in another plc file.
Example: main.plc
# macros here or in PLC_MACROS in call to loadPLCFile.cmd:
+substitute(AX_ID=1,ENC_ID=1,RANGE=360,THRESHOLD=240)
+include "home_abs_enc_overflow.plc_inc"
+
Load the file with include dir:
${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=./cfg/main.plc, INC=${ecmccfg_DIR}, SAMPLE_RATE_MS=1000, PLC_MACROS='DBG='"
Here you can find some best practice configurations for common use cases.
The complete examples with startup files can be found here
Use of macros makes the code more generic. When loading a PLC file with “loadPLCFile.cmd”, custom macros can be defined in “PLC_MACROS”:
Here you can find some best practice configurations for common use cases.
The complete examples with startup files can be found here
Use of macros makes the code more generic. When loading a PLC file with “loadPLCFile.cmd”, custom macros can be defined in “PLC_MACROS”:
${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=./cfg/main.plc, INC=.:./cfg/, DESC='Test', SAMPLE_RATE_MS=1000, PLC_MACROS='BO_S_ID=${ECMC_EC_SLAVE_NUM}'"
NOTE: ECMC_EC_SLAVE_NUM expands to the ID of the last added slave.
In addition to the custom macros, a few macros, that are often needed, are predefined:
A common use case is that some initiation is needed, could be triggering of a custom homing sequence:
if(${SELF}.firstscan) {
var plc:=${SELF_ID};
${DBG=#}println('PLC ',plc,' is starting up');
@@ -42,5 +42,5 @@
The resulting code will toggle two different outputs, the state of the last output will be printed.
NOTE: Macros cannot be used in the filename when including a file. Instead the dir should be defined in the INC param when loading the PLC, see above.
Adding a DBG macro can be use full to be able to turn on/off printouts. Typically during commissioning it can be use full to have many printouts but later when system goes into production, it could be a good idea to turn (some) printouts off.
Example of a printout that can be turned on/off (default off)
${DBG=#}println('Value: ', ${M}.s${BO_S_ID}.binaryOutput${BO_CH});
Will result in the below if setting the DBG='' (and some other macros, see above):
println('Value: ', ec0.s10.binaryOutput01);
Always add a description when creating a PLC by setting the DESC macro when calling loadPLCFile.cmd.
Example:
${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=./cfg/main.plc, INC=.:./cfg/, DESC='Toggle some bits', SAMPLE_RATE_MS=1000, PLC_MACROS='BO_S_ID=${ECMC_EC_SLAVE_NUM}'"
-
The description can maximum be 40 chars long.
The description can maximum be 40 chars long.
In ecmccfg/plc_lib some code snippets are accessible. These are installed in ecmccfg module and can be accesses in ${ecmccfg_DIR}.
Sofar, the following code is accessible:
iocsh
call
${SCRIPTEXEC} "${ECMC_CONFIG_ROOT}loadYamlPlc.cmd" "FILE=./plc1File.yaml, ECMC_TMPDIR=/tmp/"
Validates requested oversampling factor
Checks if requested oversampling factor is valid otherwise exits EPICS/ECMC
Anders Sandstroem
Validates the resulting sampling time for oversampling slaves.
Checks if the resulting sampling time for oversampling slaves is higher or equal to the minimum time.
Anders Sandstroem
Validates current settings
Checks if requested run current and standby current is less than max current and larger than 0.
Anders Sandstroem
Validates requested voltage
Ensure requested nominal voltage is less than max voltage and larger than 0
Anders Sandstroem
Add general PVs
Script for adding general and master diagnostics EPICS PVs
Niko Kivel, Anders Sandstroem
Script for general diagnostics
Script for setting default diagnostics
Niko Kivel, Anders Sandstroem
Initialization script
Script for setting up the basic EPICS environment.
Niko Kivel, Anders Sandstroem
Init main script
Script for setting up the basic EPICS environment.
Niko Kivel, Anders Sandstroem
init axis environment
Script for setting up the basic AXIS environment.
Niko Kivel, Anders Sandstroem
Issue a warning
Generic verification script for expressions
Anders Sandstroem
Generic verification script
Generic verification script for expressions
Anders Sandstroem
Script for adding axis related EPICS PVs.
Adds motorRecord to the IOC.
Anders Sandstroem
This script is typically called by \b addAxis.cmd
Script for configuring a physical axis.
Configures a physical axis in ECMC, based on previously set environment variables.
Anders Sandstroem
This script is typically called by \b addAxis.cmd, often via \b ecmc_axis-records.cmd
Script for adding axis diagnostic EPICS PVs.
Adds diagnostic PVs to the IOC.
Anders Sandstroem
Script for loading motor record related databases
Script for loading motor record related databases and creating motor record axis object
Anders Sandstroem
This script is typically called by \b ecmc_axis.cmd, often via \b ecmc_axis-records.cmd
Script for configuring axis synchronization
Configures ECMC for axis synchronization, based on previously set environment variables.
Anders Sandstroem
This script is typically called by \b applyAxisSynchronization.cmd
Script for adding encoder related EPICS PVs.
Script for adding an encoder to a previously created axis.
Anders Sandstroem
This script is typically called by \b addAxis.cmd
Script for adding an extra encoder
Configures a encoder object in ECMC, based on previously set environment variables.
Anders Sandstroem
This script is typically called by \b addEncoder.cmd
Script for adding axis related EPICS PVs.
Adds motorRecord to the IOC.
Anders Sandstroem
This script is typically called by \b addVirtualAxis.cmd
Script for configuring a virtual axis.
Configures a virtual axis in ECMC, based on previously set environment variables.
Anders Sandstroem
This script is typically called by \b addVirtualAxis.cmd, often via \b ecmc_virt_axis-records.cmd
Script for defining ${ECMC_PREFIX}
Gathers relevant information about MasterID, SlaveID, … to create naming convention compliant PREFIX
Niko Kivel
Script for defining ${ECMC_P}
Gathers relevant information about MasterID, SlaveID, … to create naming convention compliant PREFIX
Niko Kivel
Script for defining ${ECMC_P}
Gathers relevant information about MasterID, SlaveID, … to create naming convention compliant PREFIX
Niko Kivel
Script for adding axis EPICS PVs.
Adds an motion axis.
Niko Kivel
Script for adding dataStorage.
Adds dataStorage buffer.
Anders Sandstroem
DS_SIZE Size of data buffer.
DS_ID (optional), default 0, buffer ID
DS_TYPE (optional), default 0, 0: Normal Buffer, 1: Ring Buffer, 2: FIFO Buffer
SAMPLE_RATE_MS (optional), default 1
DS_DEBUG (optional), default 0, 0: No debug printouts, 1: Debug printouts
DESC (optional) Description of PLC
Example calls:
${SCRIPTEXEC} ${ecmccfg_DIR}addDataStorage.cmd "DS_ID=1, DS_SIZE=1000, SAMPLE_RATE_MS=100"
Script for adding an EtherCAT domain.
Adds an EtherCAt domain.
Anders Sandström
EXE_RATE (optional) Execution rate [cycles] defaults 0 (same EC_RATE)
EXE_OFFSET (optional) Execution offset cycles [cycles] defaults 0
ALLOW_OFFLINE (optional) Allow domain to be offline defaults 0
All EtherCAT entries generated after this command will be assigned
Script for adding a ethercat data item.
The ethercat data item allows for accessing alreday configured ethercat domain data in a flexible
Anders Sandström
Script for adding asyn SDO object (access to SDO:s in realtime)
Add SDO for async access during realtime operation
Anders Sandström
Script for adding an extra encoder to an axis.
Adds an encoder to the last configured axis.
Niko Kivel
CONFIG configuration file, i.e. ./cfg/axis_1_enc_2.enc
DEV (optional) device name, i.e. MOTOR1
CLEAR_VARS_CMD (optional) Set to “empty” for not clear env vars (if vars needed for later use).
CFG_MACROS (optional) Substitution macros for config file
Example call:
${SCRIPTEXEC} ${ecmccfg_DIR}addEncoder.cmd, "CONFIG=./cfg/linear_1_enc_3.enc"
Script for claiming a particular master.
Claims an EtherCAT master.
Niko Kivel
MASTER_ID (optional) master ID as shown by ethercat master
.
Example calls:
${SCRIPTEXEC} ${ecmccfg_DIR}addMaster.cmd
${SCRIPTEXEC} ${ecmccfg_DIR}addMaster.cmd, "MASTER_ID=3"
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL1018, SLAVE_ID=1, P_SCRIPT=mXsXXX"
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL3204, DEFAULT_SUBS=false, DEFAULT_SLAVE_PVS=true"
Script for adding a KL slave to the EtherCAT bus configuration of KL type.
Adds the respective hardware to the bus configuration, adds specific and default PV to the EPICS database. For some/most slaves also a default
Anders Sandstrom
HW_DESC Hardware descriptor, i.e. KL2032
SLAVE_ID EtherCAT bus position of the BK1250 (or similar terminal)
SLAVE_ID_KL KL-Bus index in two digit hex starting at zero for the first slave after BK1250 (or similar terminal)
SUBST_FILE (optional) substitution file
Example calls:
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL1018, SLAVE_ID=1, SLAVE_ID_KL=0A"
Script for adding axis EPICS PVs.
Adds an virtual axis with PVs.
Niko Kivel
Script for applying axis synchronization
Adds synchronization parameters to an axis provided by CONFIG.
Niko Kivel
CONFIG configuration file, i.e. ./cfg/linear_1.sax
CLEAR_VARS_CMD (optional) Set to “empty” for not clear env vars (if needed vars for later use).
Example call:
${SCRIPTEXEC} ${ecmccfg_DIR}applyAxisSynchronization.cmd, "CONFIG=./cfg/linear_1.sax"
Script for applying bus configuration.
Applies the EtherCAT configuration and caluclates data offsets in the process image.
Niko Kivel
Example call:
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cfg
Script for applying a specific slave configuration after the slave had been added manually.
Apply configurations to a slave.
Niko Kivel
Example call:
call applySlaveConfig with CONFIG
${SCRIPTEXEC} ${ecmccfg_DIR}applySlaveConfig.cmd, "CONFIG=-Motor-Nanotec-ST4118L1804-B"
call applySlaveConfig with LOCAL_CONFIG
${SCRIPTEXEC} ${ecmccfg_DIR}applySlaveConfig.cmd, "LOCAL_CONFIG=./myFancyServoConfig.cfg"
Script for applying dc config to slave
Apply dc configurations to a slave.
Anders Sandstroem
Script for applying substitution file
Applies substitution from ${SUBST_FILE} with ${P_SCRIPT}
Niko Kivel
SUBST_FILE (optional) substitution file
ECMC_P PV prefix
P_SCRIPT (optional) naming convention prefix script
NELM (optional) Used for oversampling cards. Defaults to 1
Example calls:
${SCRIPTEXEC} "${ECMC_CONFIG_ROOT}applySubstitutions.cmd" "SUBST_FILE=${SUBST_FILE=ecmc${ECMC_EC_HWTYPE}.substitutions},ECMC_P=${ECMC_P}"
Script for applying a template
Applies template from ${TEMPLATE_FILE} with ${P_SCRIPT}, PARAMS can be passed
Niko Kivel
TEMPLATE_FILE template file
ECMC_P PV prefix
PARAMS (optional) additional parameters
Example calls:
${SCRIPTEXEC} "${ECMC_CONFIG_ROOT}applyTemplate.cmd" "TEMPLATE_FILE=ecmcEcSlave.template,ECMC_P=${ECMC_P}"
Script for adding an axis with configuration.
Adds an axis to the configuration and applies parameters provided by CONFIG.
Niko Kivel
CONFIG configuration file, i.e. ./cfg/linear_1.pax
DEV (optional) device name, i.e. MOTOR1
CLEAR_VARS_CMD (optional) Set to “empty” for not clear env vars (if vars needed for later use).
CFG_MACROS (optional) Substitution macros for config file
Example call:
${SCRIPTEXEC} ${ecmccfg_DIR}configureAxis.cmd, "CONFIG=./cfg/linear_1.pax"
Script for adding a slave with dedicated slave configuration to the EtherCAT bus configuration.
Adds the respective hardware to the bus configuration, adds specific and default PV to the EPICS database. Applies a specific slave configuration.
Niko Kivel
HW_DESC Hardware descriptor, i.e. EL7037
CONFIG configuration file, i.e. -Motor-Nanotec-ST4118L1804-B
The CONFIG together with the HW_DESC form the full filename which by definition is ecmc${HW_DESC}${CONFIG}.cmd, i.e.: ecmcEL7037-Motor-Nanotec-ST4118L1804-B.cmd
SLAVE_ID (optional) bus position
CFG_MACROS (optional) Substitution macros for config file
NELM (optional) Used for oversampling cards. Defaults to 1
Example calls:
${SCRIPTEXEC} ${ecmccfg_DIR}configureSlave.cmd, "HW_DESC=EL7037, CONFIG=-Motor-Nanotec-ST4118L1804-B"
${SCRIPTEXEC} ${ecmccfg_DIR}configureSlave.cmd, "HW_DESC=EL7037, CONFIG=-Motor-Nanotec-ST4118L1804-B, SLAVE_ID=8"
Script for adding a virtual axis with configuration.
Adds a virtual axis to the configuration and applies parameters provided by CONFIG.
Niko Kivel
CONFIG configuration file, i.e. ./cfg/linear_11.vax
DEV (optional) device name, i.e. GAP
CLEAR_VARS_CMD (optional) Set to “empty” for not clear env vars (if needed vars for later use).
Example call:
${SCRIPTEXEC} ${ecmccfg_DIR}configureVirtualAxis.cmd, "CONFIG=./cfg/linear_11.vax"
Script for finalizing. Executed just before iocInit (atInit)
Script for finalizing. Executed just before iocInit (atInit).
Anders Sandström
Script for loading Axis from yaml file via jinja2
adds an Axis, based on a yaml config file
Niko Kivel, Anders Sandström
FILE the yaml-file containing the PLC definition
DEV the device name (optional, defaults to ${IOC}
Example calls:
${SCRIPTEXEC} "./loadYamlAxis.cmd" "FILE=./axis1.yaml"
${SCRIPTEXEC} "./loadYamlAxis.cmd" "FILE=./axis1.yaml, DEV=foobar"
Script for adding Encoder from yaml file via jinja2
adds an encoder to an axis, based on a yaml config file
Anders Sandström
FILE the yaml-file containing the PLC definition
DEV the device name (optional, defaults to ${IOC}
Example calls:
${SCRIPTEXEC} "./loadYamlEnc.cmd" "FILE=./enc.yaml"
${SCRIPTEXEC} "./loadYamlEnc.cmd" "FILE=./enc.yaml, DEV=foobar"
Script for loading PLC from yaml file via jinja2
adds a PLC, line by line, from a yaml-file, parsed by jinja2
Niko Kivel, Anders Sandström
FILE the yaml-file containing the PLC definition
Example calls:
${SCRIPTEXEC} "./loadYamlPlc.cmd" "FILE=./plc1.yaml"
Script for adding a PLC from file.
Adds a PLC defined in FILE. Also adds PLC specific EPICS PVs, i.e. for enable/disable.
Niko Kivel
FILE PLC definition file, i.e. ./plc/homeSlit.plc
AX_ID (optional) Ax number, default 0
PLC_MACROS (optional) Substitution macros for PLC code
TMP_PATH (optional) directory to dump the temporary plc file after macro substitution
PRINT_PLC_FILE (optional) 1/0, printout msi parsed plc file (default enable(1)).
SUBST_FILE (optional) custom substitution file otherwise ecmccfg default will be loaded
Example call:
${SCRIPTEXEC} ${ecmccfg_DIR}loadAxisPLCFile.cmd, "AX_ID=1, FILE=./plc/homeSlit.plc"
Script for adding a PLC from file.
Adds a PLC defined in FILE. Also adds PLC specific EPICS PVs, i.e. for enable/disable.
Niko Kivel, Anders Sandström
FILE PLC definition file, i.e. ./plc/homeSlit.plc
PLC_ID (optional) PLC number, default 0, or to next free PLC, the actual PLC Id is stored in ECMC_PLC_ID and can be used after this command
SAMPLE_RATE_MS (optional) excecution rate, default 1000/EC_RATE
PLC_MACROS (optional) Substitution macros for PLC code. The macros “SELF_ID”,“SELF”,M_ID, and M are reserved:
TMP_PATH (optional) directory to dump the temporary plc file after macro substitution
PRINT_PLC_FILE (optional) 1/0, printout msi parsed plc file (default enable(1)).
SUBST_FILE (optional) custom substitution file otherwise ecmccfg default will be loaded
INC (optional) List of directories for include files to pass to MSI (if several paths thendivide with ‘:').
DESC (optional) Description of PLC
Example call:
${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "PLC_ID=0, FILE=./plc/homeSlit.plc, SAMPLE_RATE_MS=100"
Script for loading a PLC from lib from file.
Adds a PLC defined in FILE. Also adds PLC specific EPICS PVs, i.e. for enable/disable.
Anders Sandström
FILE PLC definition file, i.e. ./plc/homeSlit.plc
PLC_ID (optional) PLC number, default last loaded PLC
PLC_MACROS (optional) Substitution macros for PLC code. The macros “SELF_ID”,“SELF”,M_ID, and M are reserved:
INC (optional) List of directories for include files to pass to MSI (if several paths thendivide with ‘:').
TMP_PATH (optional) directory to dump the temporary plc file after macro substitution
PRINT_PLC_FILE (optional) 1/0, printout msi parsed plc file (default enable(1)).
Example call:
${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCLib.cmd, "PLC_ID=0, FILE=./plc/homeSlit.plc, SAMPLE_RATE_MS=100"
Script for loading a ecmc plugin from file.
Loads a ecmc-plugin from file.
Anders Sandström
FILE Filename of plugin shared lib (./ecmcPlugin_Advanced.so)
PLUGIN_ID Id of plugin to load
CONFIG (optional) Configuration string sent to plugin at construct
REPORT (optional) Printout information of loaded plugin if set to “1”
Example call:
${SCRIPTEXEC} ${ecmccfg_DIR}loadPlugin.cmd, "PLUGIN_ID=0,FILE=./ecmcPlugin_Advanced.so,CONFIG='PLUGIN CONFIGS GO HERE '
Script for adding multiple axes based on subst and template file
Configure multiple axes by using subst file
Anders Sandström
${SCRIPTEXEC} ${ecmccfg_DIR}loadSubstAxes.cmd, "FILE=./ax.subs"
Script for loading complete ecmc cfg based on subst files and templates
Loads complete ecmc cfg based on subst files and templates
Anders Sandström
${SCRIPTEXEC} ${ecmccfg_DIR}loadSubstConfig.cmd, "FILE=./cfg.subs"
Script for adding multiple hw based on subst and template file
Loads hw cfg based on subst files and templates
Anders Sandström
${SCRIPTEXEC} ${ecmccfg_DIR}loadSubstHw.cmd, "FILE=./hw.subs"
Restores record update rate to what was defined in startup.cmd
Restores record update rate to what was defined in startup.cmd
Anders Sandström
Script for switching to operational mode.
Validates configuration, starts realtime thread and checks EtherCAT slaves are in OP.
Niko Kivel
Script for enabling default diagnostics.
Set some default values to diagostics
Niko Kivel
Script for changing record update rate
Update record processing rate, all records created after this command will be updated in the specified rate.
Anders Sandström
** script for slave verification and optional reset**
will verify the slave identity and reset by writing to 0x1011, optionally read firmwre version from 0x100a
Niko Kivel
Macros