Skip to content

Commit

Permalink
Add some content and adjust fontsizes
Browse files Browse the repository at this point in the history
  • Loading branch information
anderssandstrom committed Sep 28, 2024
1 parent b0b5f8b commit 1daf0e5
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 50 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ hugo/content/source/
*.pyc

.hugo_build.lock
hugo/public
127 changes: 119 additions & 8 deletions hugo/content/manual/general_cfg/iocsh_utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ chapter = false
* record fields
* ...

```
```text
ecmcEpicsEnvSetCalc -h
Use "ecmcEpicsEnvSetCalc(<envVarName>, <expression>, <format>)" to evaluate the expression and assign the variable.
Expand Down Expand Up @@ -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.
Expand All @@ -92,7 +90,7 @@ result=0
* making conditional ecmc settings
* ...

```
```text
ecmcEpicsEnvSetCalcTernary -h
Test iocsh function "ecmcEpicsEnvSetCalcTernary()" t
Expand Down Expand Up @@ -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):
Expand All @@ -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(\<expression\>,\<optional true macro\>,\<optional false macro\>)
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(\<optional true macro\>,\<optional false macro\>)
```

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("<expression>")
${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(<filename>, <macros>, <loopvar>, <from>, <to>, <step>)" to loop execution of file with a changing loop variable.
<filename> : Filename to execute in for loop.
<macros> : Macros to feed to execution of file.
<loopvar : Environment variable to use as index in for loop.
<from> : <loopvar> start value.
<to> : <loopvar> end value.
<step> : Step to increase <loopvar> 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(<filename>, <die>, <check EPICS dirs>, <dirs>)" to check if a file exists.
<filename> : Filename to check.
<die> : Exit EPICS if file not exist. Optional, defaults to 0.
<check EPICS dirs> : Look for files in EPICS_DB_INCLUDE_PATH dirs. Optional, defaults to 0.\n");
<dirs> : 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
10 changes: 5 additions & 5 deletions hugo/content/manual/general_cfg/startup/modes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ 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
3. NO_MR

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.

Expand All @@ -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
Expand All @@ -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.
2 changes: 1 addition & 1 deletion hugo/content/manual/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 3 additions & 26 deletions hugo/content/manual/knowledgebase/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<ioc_name>" 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!
Expand All @@ -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
28 changes: 28 additions & 0 deletions hugo/content/manual/knowledgebase/panel.md
Original file line number Diff line number Diff line change
@@ -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=<ioc_name>" ecmcMain.ui
```
20 changes: 10 additions & 10 deletions hugo/static/css/custom.css
Original file line number Diff line number Diff line change
@@ -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 */
Expand All @@ -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;
}

0 comments on commit 1daf0e5

Please sign in to comment.