diff --git a/.gitignore b/.gitignore index e2bd7fe6c..22dfcc58c 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ hugo/content/source/ *.pyc .hugo_build.lock +hugo/public diff --git a/hugo/content/manual/general_cfg/iocsh_utils.md b/hugo/content/manual/general_cfg/iocsh_utils.md index 94fb4c5e3..8476b0d55 100644 --- a/hugo/content/manual/general_cfg/iocsh_utils.md +++ b/hugo/content/manual/general_cfg/iocsh_utils.md @@ -14,7 +14,7 @@ chapter = false * record fields * ... -``` +```text ecmcEpicsEnvSetCalc -h Use "ecmcEpicsEnvSetCalc(, , )" to evaluate the expression and assign the variable. @@ -82,8 +82,6 @@ result=0 ecmcEpicsEnvSetCalc("result", "if('ecmcEL3002.cmd'='test.script') {RESULT:=1;}else{RESULT:=0;};") epicsEnvShow("result") result=0 - - ``` ### Iocsh function "ecmcEpicsEnvSetCalcTernary()" "ecmcEpicsEnvSetCalcTernary()" is used o evaluate expressions and set EPCIS environment variables to different strings. @@ -92,7 +90,7 @@ result=0 * making conditional ecmc settings * ... -``` +```text ecmcEpicsEnvSetCalcTernary -h Test iocsh function "ecmcEpicsEnvSetCalcTernary()" t @@ -134,8 +132,6 @@ result=equal ecmcEpicsEnvSetCalcTernary("result", "if('./plc_slow.cfg'='test') {RESULT:=1;}else{RESULT:=0;};","use_this_file.cfg","no_use_this_file.cfg") epicsEnvShow("result") result=no_use_this_file.cfg - - ``` ### Use return value of ecmcConfig(OrDie): @@ -158,10 +154,125 @@ The variable "ECMC_CONFIG_RETURN_VAL" then can be used to set record fields, nam Note: PDO reads need to be after "SetAppMode(1)" since cyclic value ``` ecmcConfig "ReadEcEntryIDString(${ECMC_SLAVE_NUM},"ID")" -2020/02/28 08:58:03.771 1024 ## This is the value of the EK1101 ID switch epicsEnvShow(ECMC_CONFIG_RETURN_VAL) ECMC_CONFIG_RETURN_VAL=1024 - ``` The variable "ECMC_CONFIG_RETURN_VAL" then can be used to set record fields, name or alias for instance.. + +### ecmcIf(\,\,\) +ecmcIf() set two macros depending on the value of the evaluated expression. If it evaluates to true: +1. IF_TRUE="" Allows execution of a line of code +2. IF_FALSE= "#-" Block execution of a line of code + +If expression evaluates to false: +1. IF_TRUE="#-" Block execution of a line of code +2. IF_FALSE= "" Allows execution of a line of code + +Note: These macros is the default names for the macros (but can be changed by assignment of the 2 last params in call to ecmcIf()): +1. IF_TRUE for true +2. IF_FALSE for false + +### ecmcIf +``` +ecmcEndIf(\,\) +``` + +The ecmcEndIf() command unsets the last used macros (for true and false), if different names are passed as arguments then then these macros are unset (for nested if statements). + +#### Example of of syntax +Example 1: +``` +ecmcIf("") +${IF_TRUE} # Code to execute if expression eval true +#- else +${IF_FALSE} # Code to execute if expression eval false +ecmcEndIf() +``` +Example 2: +``` +ecmcIf("$(VAL1)=$(VAL2)") +${IF_TRUE}epicsEnvSet(IS_EQUAL,"1") +#- else +${IF_FALSE}epicsEnvSet(IS_EQUAL,"0") +ecmcEndIf() +``` +Note: For nested calls to ecmcIf() and ecmcEndIf() optional macros must be used. + +### ecmcForLoop +Useful for: +* Large systems with many similar sub systems +* Configuring hardware with many PDOs (oversampling) + +``` +"ecmcForLoop(, , , , , )" to loop execution of file with a changing loop variable. + : Filename to execute in for loop. + : Macros to feed to execution of file. + : start value. + : end value. + : Step to increase each loop cycle. + +``` +Example ("ECMC_LOOP_IDX" as loop variable): + +``` +ecmcForLoop(./loopStep.cmd,"",ECMC_LOOP_IDX,1,5,1) +ecmcEpicsEnvSetCalc("TESTING",1*10) +epicsEnvShow("TESTING") +TESTING=10 +ecmcEpicsEnvSetCalc("TESTING",2*10) +epicsEnvShow("TESTING") +TESTING=20 +ecmcEpicsEnvSetCalc("TESTING",3*10) +epicsEnvShow("TESTING") +TESTING=30 +ecmcEpicsEnvSetCalc("TESTING",4*10) +epicsEnvShow("TESTING") +TESTING=40 +ecmcEpicsEnvSetCalc("TESTING",5*10) +epicsEnvShow("TESTING") +TESTING=50 +``` +where "loopStep.cmd" file looks like this (note the use of "ECMC_LOOP_IDX"): +``` +#- Commands tp execute in each loop of example ecmcForLoop.script +ecmcEpicsEnvSetCalc("TESTING",${ECMC_LOOP_IDX}*10) +epicsEnvShow("TESTING") +``` + +### ecmcFileExist +Useful for checking that configuration files really exist and then can be loaded. +``` +ecmcFileExist(, , , )" to check if a file exists. + : Filename to check. + : Exit EPICS if file not exist. Optional, defaults to 0. + : Look for files in EPICS_DB_INCLUDE_PATH dirs. Optional, defaults to 0.\n"); + : List of dirs to search for file in (separated with ':'). +result will be stored in the EPICS environment variable "ECMC_FILE_EXIST_RETURN_VAL" +``` +Example: +``` +ecmcFileExist("file_exist.cfg") +epicsEnvShow(ECMC_FILE_EXIST_RETURN_VAL) +ECMC_FILE_EXIST_RETURN_VAL=1 + +ecmcFileExist("file_not_exist.cfg",1) +Error: File "file_not_exist.cfg" does not exist. ECMC shuts down. + +ecmcFileExist("ecmcEK1100.substitutions",1,1) +epicsEnvShow(ECMC_FILE_EXIST_RETURN_VAL) +ECMC_FILE_EXIST_RETURN_VAL=1 + +ecmcFileExist("ecmcEK1100.substitutions",0,0,"/home/") +epicsEnvShow(ECMC_FILE_EXIST_RETURN_VAL) +ECMC_FILE_EXIST_RETURN_VAL=0 +``` +### Todo +Add docs for: +* ecmcConfigOrDie +* ecmcConfig +* ecmcGrepParam +* ecmcGrepRecord +* ecmcReport +* ecmcAsynPortDriverConfigure diff --git a/hugo/content/manual/general_cfg/startup/modes.md b/hugo/content/manual/general_cfg/startup/modes.md index 8aef82a53..9ae3b830d 100644 --- a/hugo/content/manual/general_cfg/startup/modes.md +++ b/hugo/content/manual/general_cfg/startup/modes.md @@ -4,7 +4,7 @@ weight = 15 chapter = false +++ -## ecmc modes +### ecmc modes ecmc can be started in different modes by setting the MODE parameter to startup.cmd (or require ecmccfg): 1. FULL 2. DAQ @@ -12,7 +12,7 @@ ecmc can be started in different modes by setting the MODE parameter to startup. A separate mode for commissioning is also available, called ENG_MODE. -### mode==FULL (default) +#### mode==FULL (default) In FULL mode all ecmc functionalities are supported, like motion, daq and plcs. @@ -25,7 +25,7 @@ $(ECMCCFG_INIT)$(SCRIPTEXEC) ${ecmccfg_DIR}startup.cmd, "IOC=$(IOC),ECMC_VER=dev $(ECMCCFG_INIT)$(SCRIPTEXEC) ${ecmccfg_DIR}startup.cmd, "IOC=$(IOC),ECMC_VER=develop" ``` -### mode==DAQ +#### mode==DAQ In DAQ mode, motion functionalities are disabled and the following commands are blocked: 1. configureAxis.cmd 2. configureVirtualAxis.cmd @@ -44,11 +44,11 @@ NOTE: The default record update rate is set to 10ms in initAlll.cmd. For DAQ app epicsEnvSet("ECMC_SAMPLE_RATE_MS",1) ``` -### mode==NO_MR +#### mode==NO_MR In this mode all features are supported, but motor record will not be created for motion axes. -### ENG_MODE +#### ENG_MODE Setting the parameter ENG_MODE=1 will result in loading of extra PVs usefull for commissioning, i.e. controller parameters for motion axes. diff --git a/hugo/content/manual/introduction.md b/hugo/content/manual/introduction.md index 50aa92795..7bceff688 100644 --- a/hugo/content/manual/introduction.md +++ b/hugo/content/manual/introduction.md @@ -12,7 +12,7 @@ During IOC-startup, the requested configuration is validated against the actuall Mismatches will result in an error, the IOC will _not_ start. {{% notice warning %}} -Blindly restarting the IOC, with only partially working EtherCAT hardware, will results in an inoperable IOC! Refer to the [troubleshooting guide](../troubleshooting) for details. +Blindly restarting the IOC, with only partially working EtherCAT hardware, will results in an inoperable IOC! If troubleshooting is needed then check out the [knowledge base](../knowledgebase) for details. {{% /notice %}} ### IOC structure diff --git a/hugo/content/manual/knowledgebase/_index.md b/hugo/content/manual/knowledgebase/_index.md index 2a5371c84..2273d475b 100644 --- a/hugo/content/manual/knowledgebase/_index.md +++ b/hugo/content/manual/knowledgebase/_index.md @@ -8,29 +8,6 @@ chapter = false {{% children %}} --- -## Overview panel -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: -* ecmc_rt thread diagnostics: - - Jitter - - Cycle time -* EtherCAT: - - Status - - Lost frames - - Slave count - - master Id - - Links to dedicated sub panels for each slave type. -* Links to all configured objects: - - motion expert panels - - PLC objects - - plugin objects - - data storage objects - -The ecmcMain.ui is started with the following syntax: -``` -caqtdm -macro "IOC=" ecmcMain.ui -``` - ## Knowledge base Due to the complexity an EtherCAT bus topology can assume, troubleshooting can be challenging. This guide should provide the basic means to diagnose simple errors and is by no means complete! @@ -42,8 +19,8 @@ See a summary, incl. some examples of what possible [here](ethercatcli). ### [motion](motion) For motion related issues, a very short troubleshooting guide is provided [here](motion). -### [drive tuning](tuning) -Tune drive control loops - ### [hardware](hardware) For hardware related issues, a very short troubleshooting guide is provided [here](hardware). + +### [tuning](tuning) +Tune drive control loops diff --git a/hugo/content/manual/knowledgebase/panel.md b/hugo/content/manual/knowledgebase/panel.md new file mode 100644 index 000000000..60d72dce4 --- /dev/null +++ b/hugo/content/manual/knowledgebase/panel.md @@ -0,0 +1,28 @@ ++++ +title = "panel" +weight = 20 +chapter = false ++++ + +### Overview panel +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: +* ecmc_rt thread diagnostics: + - Jitter + - Cycle time +* EtherCAT: + - Status + - Lost frames + - Slave count + - master Id + - Links to dedicated sub panels for each slave type. +* Links to all configured objects: + - motion expert panels + - PLC objects + - plugin objects + - data storage objects + +The ecmcMain.ui is started with the following syntax: +``` +caqtdm -macro "IOC=" ecmcMain.ui +``` diff --git a/hugo/static/css/custom.css b/hugo/static/css/custom.css index 981805ec3..4a70f4eb9 100644 --- a/hugo/static/css/custom.css +++ b/hugo/static/css/custom.css @@ -1,5 +1,5 @@ html { - font-size: 40%; /* Adjust this percentage to scale all font sizes */ + font-size: 100%; /* Adjust this percentage to scale all font sizes */ } /* Target the specific note classes */ @@ -12,38 +12,38 @@ html { /* Additional targeting, if needed */ .note p, .warning p, .tip p, .info p { - font-size: 2.2rem !important; + font-size: 0.9rem !important; } code { - font-size: 1.8rem !important; /* Adjust size as needed */ + font-size: 0.8rem !important; /* Adjust size as needed */ } /* General heading font size increases */ h1 { - font-size: 3rem !important; /* Adjust for h1 */ + font-size: 1.5rem !important; /* Adjust for h1 */ } h2 { - font-size: 3rem !important; /* Adjust for h2 */ + font-size: 1.3rem !important; /* Adjust for h2 */ } h3 { - font-size: 3rem !important; /* Adjust for h3 */ + font-size: 1.2rem !important; /* Adjust for h3 */ } h4 { - font-size: 3rem !important; /* Adjust for h4 */ + font-size: 1.1rem !important; /* Adjust for h4 */ } h5 { - font-size: 2rem !important; /* Adjust for h5 */ + font-size: 1rem !important; /* Adjust for h5 */ } h6 { - font-size: 2rem !important; /* Adjust for h6 */ + font-size: 1rem !important; /* Adjust for h6 */ } .page-title { - font-size: 4rem !important; + font-size: 1rem !important; }