diff --git a/examples/PSI/best_practice/plcs/startup.cmd b/examples/PSI/best_practice/plcs/startup.cmd index 2f56a5815..54c59a233 100644 --- a/examples/PSI/best_practice/plcs/startup.cmd +++ b/examples/PSI/best_practice/plcs/startup.cmd @@ -14,7 +14,7 @@ ${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=10, HW_DESC=EL2819" #- ############################################################################ #- Load PLC (note the include dir (INC) and the use of ECMC_EC_SLAVE_NUM) -${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=./cfg/main.plc, INC=.:./cfg/, SAMPLE_RATE_MS=1000, PLC_MACROS='BO_S_ID=${ECMC_EC_SLAVE_NUM}'" +${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=./cfg/main.plc, INC=.:./cfg/, DESC='Toggle bits', SAMPLE_RATE_MS=1000, PLC_MACROS='BO_S_ID=${ECMC_EC_SLAVE_NUM}'" #- ############################################################################ #- Go active diff --git a/hugo/content/manual/PLC_cfg/best_practice.md b/hugo/content/manual/PLC_cfg/best_practice.md index 81074013a..7167aab3a 100644 --- a/hugo/content/manual/PLC_cfg/best_practice.md +++ b/hugo/content/manual/PLC_cfg/best_practice.md @@ -9,13 +9,14 @@ Here you can find some best practice configurations for common usecases. * Macros * MSI include, substitute * Printouts +* Description The complete examples with starup files can be found [here](https://github.com/paulscherrerinstitute/ecmccfg/tree/master/examples/PSI/best_practice) ### macros Use of macros makes the code more generic. When loading a PLC file with "loadPLCFile.cmd", custom macros can be defined in "PLC\_MACROS": ```shell -${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=./cfg/main.plc, INC=.:./cfg/, SAMPLE_RATE_MS=1000, PLC_MACROS='BO_S_ID=${ECMC_EC_SLAVE_NUM}'" +${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. @@ -66,7 +67,7 @@ Since all PLC files and PLC libs are parsed through MSI the "include" and "subst When using the include command, the file location dir of the file must be added in the INC parameter when loading the PLC: ```shell -${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=./cfg/main.plc, INC=.:./cfg/, SAMPLE_RATE_MS=1000, PLC_MACROS='BO_S_ID=${ECMC_EC_SLAVE_NUM}'" +${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}'" ``` The "INC" parameter can contain several directories separated with a ":", making it possible to include PLC files from several locations/modules. @@ -113,3 +114,15 @@ Will result in the below if setting the DBG='' (and some other macros, see above ```C println('Value: ', ec0.s10.binaryOutput01); ``` + +### Description +Always add a description when creating a PLC by setting the DESC macro when calling loadPLCFile.cmd. + +Example: +```shell +${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}'" +``` + +{{% notice info %}} +The description can maximum be 40 chars long. +{{% /notice %}} diff --git a/hugo/content/manual/general_cfg/startup/_index.md b/hugo/content/manual/general_cfg/startup/_index.md index 812c783cd..0bf8222ca 100644 --- a/hugo/content/manual/general_cfg/startup/_index.md +++ b/hugo/content/manual/general_cfg/startup/_index.md @@ -31,7 +31,7 @@ startup.cmd takes the following arguments: ECMC_CONFIG_ROOT = root directory of ${MODULE} ECMC_CONFIG_DB = database directory of ${MODULE} EthercatMC_DB = database directory of EthercatMC - ECMC_EC_MASTER_ID = EtherCAT master id in use (for use in later scripts) + ECMC_EC_MASTER_ID = EtherCAT master id in use (for use in later scripts) ECMC_EC_SAMPLE_RATE = EtherCAT bus sampling rate [Hz] (1000 default) ECMC_EC_SAMPLE_RATE_MS = EtherCAT bus sampling rate [ms] (1 default) ECMC_MODE = ecmc mode. FULL/DAQ, Defaults to FULL diff --git a/hugo/content/manual/knowledgebase/motion.md b/hugo/content/manual/knowledgebase/motion.md index e787c930b..dbd8e5370 100644 --- a/hugo/content/manual/knowledgebase/motion.md +++ b/hugo/content/manual/knowledgebase/motion.md @@ -100,5 +100,5 @@ For this however, the IOC needs to be reconfigured to _not_ link the hardware to 4. `dbgrep "*s007*"` 5. There should be two PVs ending with, `-Drv01-Cmd` and `-Drv01-Spd` 6. Set `-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! -7. After the amplifier is engaged, write a small number to `-Drv01-Spd`. Dependinf on the scaling, the number might be in the range of 1..1000. +7. After the amplifier is engaged, write a small number to `-Drv01-Spd`. Depending on the scaling, the number might be in the range of 1..1000. 8. Observe the encoder, or in case of open-loop, the device itself.