@@ -8,12 +8,12 @@ This program is free software; you can redistribute it and/or modify
8
8
it under the terms of the GNU General Public License as published by
9
9
the Free Software Foundation; either version 3 of the License, or
10
10
(at your option) any later version.
11
-
11
+
12
12
This program is distributed in the hope that it will be useful,
13
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
15
GNU General Public License for more details.
16
-
16
+
17
17
You should have received a copy of the GNU General Public License
18
18
along with this program; if not, write to the Free Software Foundation,
19
19
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@@ -23,9 +23,10 @@ by default this module is only build for RHEL7 and Epics >=R7.0.4
23
23
``` bash
24
24
make [LIBVERSION] [clean] install
25
25
```
26
- check the module loads for version ` dev ` , Epics R7.0.4.1 and ECMC version ` poslag ` , note ` MASTER_ID=1 ` which runs ECMC in master-less mode.
26
+ check the module loads for version ` dev ` , Epics ` R7+ ` and ECMC version ` dev ` , note ` MASTER_ID=-1 ` which runs ECMC in master-less mode.
27
+ Make proper adjustements to match your needs in terms of versions.
27
28
``` bash
28
- iocsh -7.0.4.1 -r " ecmccfg,dev 'ECMC_VER=posLag ,MASTER_ID=-1'"
29
+ iocsh -7 -r " ecmccfg,dev 'ECMC_VER=dev ,MASTER_ID=-1'"
29
30
```
30
31
31
32
## Purpose
@@ -54,70 +55,89 @@ The configuration framework contains the necessary files to configure an EPICS I
54
55
## Example IOC
55
56
56
57
1 . ` require ` the configuration module with optional version
57
- ``` bash
58
- require ecmccfg < VERSION>
59
- ```
58
+ ``` bash
59
+ require ecmccfg < VERSION>
60
+ ```
60
61
61
62
2 . add a coupler and slave
62
- ` ` ` bash
63
- # slave 0 {ecmcEK1100}
64
- ${SCRIPTEXEC} ${ecmccfg_DIR} addSlave.cmd, " HW_DESC=EK1100"
65
- # SLAVE_ID is automatically incremented
66
- # slave 1 {ecmcEL1018}
67
- ${SCRIPTEXEC} ${ecmccfg_DIR} addSlave.cmd, " HW_DESC=EL1018"
68
- # skip slaves 2..6
69
- # slave 7 {ecmcEL2008}, with optional SLAVE_ID
70
- ${SCRIPTEXEC} ${ecmccfg_DIR} addSlave.cmd, " HW_DESC=E2008, SLAVE_ID=7"
71
- ` ` `
63
+ ``` bash
64
+ # slave 0 {ecmcEK1100}
65
+ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT} addSlave.cmd, " HW_DESC=EK1100"
66
+ # SLAVE_ID is automatically incremented
67
+ # slave 1 {ecmcEL1018}
68
+ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT} addSlave.cmd, " HW_DESC=EL1018"
69
+ # skip slaves 2..6
70
+ # slave 7 {ecmcEL2008}, with optional SLAVE_ID
71
+ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT} addSlave.cmd, " HW_DESC=E2008, SLAVE_ID=7"
72
+ # -- ATTENTION, this only work for certain slaves, as the EPICS templates have to be migrated before
73
+ # slave 9 {ecmcEL2008}, with optional SLAVE_ID and P_SCRIPT
74
+ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT} addSlave.cmd, " HW_DESC=E2008, SLAVE_ID=7, P_SCRIPT=mXsXXX"
75
+ ```
72
76
3 . add more slaves and apply configuration to the slaves
73
- ` ` ` bash
74
- # slave 8 {ecmcEL7037}, configure slave with optional SLAVE_ID
75
- ${SCRIPTEXEC} ${ecmccfg_DIR} configureSlave.cmd, " HW_DESC=EL7037, CONFIG=-Motor-Nanotec-ST4118L1804-B, SLAVE_ID=8"
76
- # slave 9 {ecmcEL7037}, addSlave, with immediate call off applySlaveConfig
77
- # slave with global configuration
78
- ${SCRIPTEXEC} ${ecmccfg_DIR} addSlave.cmd, " HW_DESC=EL7037"
79
- ${SCRIPTEXEC} ${ecmccfg_DIR} applySlaveConfig, " CONFIG=-Motor-Nanotec-ST4118L1804-B"
80
- # slave with local configuration, in this case provided by the module `ECMC_AGIR`
81
- epicsEnvSet(" CFG_ROOT" , " ${ECMC_AGIR_DIR} /" )
82
- ${SCRIPTEXEC} ${ecmccfg_DIR} addSlave.cmd, " HW_DESC=EP7211-0034_ALL"
83
- ${SCRIPTEXEC} ${ecmccfg_DIR} applySlaveConfig.cmd, " LOCAL_CONFIG=${CFG_ROOT} AM8211_AGIR.cfg"
84
-
85
- ` ` `
77
+ ``` bash
78
+ # slave 8 {ecmcEL7037}, configure slave with optional SLAVE_ID
79
+ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT} configureSlave.cmd, " HW_DESC=EL7037, CONFIG=-Motor-Nanotec-ST4118L1804-B, SLAVE_ID=8"
80
+ # slave 9 {ecmcEL7037}, addSlave, with immediate call off applySlaveConfig
81
+ # slave with global configuration
82
+ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT} addSlave.cmd, " HW_DESC=EL7037"
83
+ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT} applySlaveConfig, " CONFIG=-Motor-Nanotec-ST4118L1804-B"
84
+ # slave with local configuration, in this case provided by the module `ECMC_AGIR`
85
+ epicsEnvSet(" CFG_ROOT" , " ${ECMC_AGIR_DIR} /" )
86
+ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT} addSlave.cmd, " HW_DESC=EP7211-0034_ALL"
87
+ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT} applySlaveConfig.cmd, " LOCAL_CONFIG=${CFG_ROOT} AM8211_AGIR.cfg"
88
+ ```
86
89
87
90
4 . apply the configuration
88
- ` ` ` bash
89
- ${SCRIPTEXEC} ${ecmccfg_DIR } applyConfig.cmd
90
- ` ` `
91
+ ``` bash
92
+ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT } applyConfig.cmd
93
+ ```
91
94
92
95
5 . additional configuration
93
- ` ` ` bash
94
- ecmcConfigOrDie " Cfg.WriteEcEntryIDString(${ECMC_EC_SLAVE_NUM_DIG_OUT} ,BO_1,1)"
95
- ` ` `
96
+
97
+ manually set ` binaryOutput01 ` to ` 1 `
98
+
99
+ ``` bash
100
+ ecmcConfigOrDie " Cfg.WriteEcEntryIDString(${ECMC_EC_SLAVE_NUM_DIG_OUT} ,binaryOutput01,1)"
101
+ ```
96
102
97
103
6 . adding a physical motor axis
98
- ` ` ` bash
99
- epicsEnvSet(" DEV" , " STEST-MYDEVICE" )
100
- ${SCRIPTEXEC} ${ecmccfg_DIR} configureAxis.cmd, " CONFIG=./cfg/axis_1"
101
- ` ` `
104
+
105
+ * classic config
106
+ ``` bash
107
+ epicsEnvSet(" DEV" , " STEST-MYDEVICE" )
108
+ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT} configureAxis.cmd, " CONFIG=./cfg/axis_1"
109
+ ```
110
+ * yaml config
111
+ ``` bash
112
+ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT} addAxisYaml.cmd, " FILE=./AM8111_CSV_minimum.yaml, ECMC_TMPDIR=/tmp/"
113
+ ```
102
114
103
115
7 . adding a virtual motor axis
104
- ` ` ` bash
105
- ${SCRIPTEXEC} ${ecmccfg_DIR} configureVirtualAxis.cmd, " CONFIG=./cfg/axis_11_virt"
106
- ` ` `
116
+ ``` bash
117
+ ${SCRIPTEXEC} ${ecmccfg_DIR} configureVirtualAxis.cmd, " CONFIG=./cfg/axis_11_virt"
118
+ ```
107
119
108
120
8 . adding synchronization
109
- ` ` ` bash
110
- ${SCRIPTEXEC} ${ecmccfg_DIR} applyAxisSynchronization.cmd, " CONFIG=./cfg/axis_1_sync"
111
- ${SCRIPTEXEC} ${ecmccfg_DIR} applyAxisSynchronization.cmd, " CONFIG=./cfg/axis_11_sync"
112
- ` ` `
121
+ ``` bash
122
+ ${SCRIPTEXEC} ${ecmccfg_DIR} applyAxisSynchronization.cmd, " CONFIG=./cfg/axis_1_sync"
123
+ ${SCRIPTEXEC} ${ecmccfg_DIR} applyAxisSynchronization.cmd, " CONFIG=./cfg/axis_11_sync"
124
+ ```
113
125
114
126
9 . loading a PLC from file
115
- ` ` ` bash
116
- ${SCRIPTEXEC} ${ecmccfg_DIR} loadPLCFile.cmd, " PLC_ID=0, FILE=./plc/homeSlit.plc, SAMPLE_RATE_MS=100"
117
- ` ` `
127
+ * classic PLC-file
128
+ ``` bash
129
+ ${SCRIPTEXEC} ${ecmccfg_DIR} loadPLCFile.cmd, " PLC_ID=0, FILE=./plc/homeSlit.plc, SAMPLE_RATE_MS=100"
130
+ ```
131
+ * pure yaml based PLC
132
+ ``` bash
133
+ ${SCRIPTEXEC} " ${ECMC_CONFIG_ROOT} loadYamlPlc.cmd" " FILE=./plc1.yaml, ECMC_TMPDIR=/tmp/"
134
+ ```
135
+ * yaml definition, with classic PLC-file, Note: ` file ` key in yaml config will overwrite anything in the ` code ` key!
136
+ ``` bash
137
+ ${SCRIPTEXEC} " ${ECMC_CONFIG_ROOT} loadYamlPlc.cmd" " FILE=./plc1File.yaml, ECMC_TMPDIR=/tmp/"
138
+ ```
118
139
119
140
10 . go active
120
- ` ` ` bash
121
- ${SCRIPTEXEC} ${ecmccfg_DIR} setAppMode.cmd
122
- ` ` `
123
-
141
+ ``` bash
142
+ ${SCRIPTEXEC} ${ecmccfg_DIR} setAppMode.cmd
143
+ ```
0 commit comments