Skip to content

Commit 9c5f288

Browse files
committed
completed ioc_changes2
1 parent 4b9e185 commit 9c5f288

File tree

1 file changed

+15
-38
lines changed

1 file changed

+15
-38
lines changed

docs/tutorials/ioc_changes2.md

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ For this exercise we will work locally inside the `ioc-adsimdetector`
3232
developer container. Following tutorials will show how to fork repositories
3333
and push changes back to GitHub
3434

35-
For this exercise we will be using an example IOC Instance to test our changes.
36-
Instead of working with a beamline repository, we will use the example ioc instance
37-
inside `ioc-adsimdetector`. It is a good idea for Generic IOC authors to
38-
include an example IOC Instance in their repository for testing changes in
39-
isolation.
35+
For this exercise we will be using an example IOC Instance to test our changes. Instead of working with a beamline repository, we will use the example ioc instance inside `ioc-adsimdetector`. It is a good idea for Generic IOC authors to include an example IOC Instance in their repository for testing changes in isolation. Obviously, this is easy for a simulation IOC, for IOCs that normally connect to real hardware this would require an additional simulator of some kind.
4036

4137
## Preparation
4238

@@ -49,19 +45,16 @@ cd ioc-adsimdetector
4945
./build
5046
code .
5147
# Choose "Reopen in Container"
48+
# Or ctrl+shift+p and choose "Remote-Containers: Reopen in Container"
5249
```
5350

5451
Note that if you do not see the prompt to reopen in container, you can open
5552
the `Remote` menu with `Ctrl+Alt+O` and select `Reopen in Container`.
5653

5754
The `build` script does two things.
5855

59-
- it fetches the git submodule called `ibek-support`. This submodule is shared
60-
between all the EPICS IOC container images and contains the support YAML files
61-
that tell `ibek` how to build support modules inside the container
62-
environment and how to use them at runtime.
63-
- it builds the Generic IOC container image developer target locally using
64-
podman or docker.
56+
- it fetches the git submodule called `ibek-support`. This submodule is shared between all the Generic IOC container images and contains the support YAML files that tell `ibek` how to build support modules inside the container environment and how to use them at runtime.
57+
- it builds the Generic IOC container image developer target locally using podman or docker.
6558

6659
## Verify the Example IOC Instance is working
6760

@@ -71,31 +64,15 @@ that need to be done before you can run an IOC instance inside of it.
7164
- Build the IOC binary
7265
- Select an IOC instance definition to run
7366

74-
The folder `ioc` inside of the `ioc-adsimdetector` is where the IOC source code
75-
resided. However our containers always make a symlink to this folder at
76-
`/epics/ioc`. This is so that it is always in the same place and can easily be
77-
found by ibek (and the developer!). Therefore you can build the binary with the
67+
The folder `ioc` inside of the `ioc-adsimdetector` is where the IOC source code resided. However our containers always make a symlink to this folder at `/epics/ioc`. This is so that it is always in the same place and can easily be found by ibek (and the developer!). Therefore you can build the IOC binary with the
7868
following command:
7969

8070
```console
8171
cd /epics/ioc
8272
make
8373
```
8474

85-
:::{note}
86-
Note that we are required to build the IOC.
87-
This is even though the container you are using already had the IOC
88-
source code built by its Dockerfile (`ioc-adsimdetector/Dockerfile`
89-
contains the same command).
90-
91-
For a detailed explanation of why this is the case see {any}`ioc-source`
92-
:::
93-
94-
The IOC instance definition is a YAML file that tells `ibek` what the runtime
95-
assets (ie. EPICS DB and startup script) should look like. Previous tutorials
96-
selected the IOC instance definition from a beamline repository. In this case
97-
we will use the example IOC instance that comes with `ioc-adsimdetector`. The
98-
following command will select the example IOC instance:
75+
The IOC instance definition is a YAML file that tells `ibek` what the runtime assets (ie. EPICS DB and startup script) should look like. Previous tutorials selected the IOC instance definition from a beamline repository. In this case we will use the example IOC instance that comes with `ioc-adsimdetector`. The following command will select the example IOC instance:
9976

10077
```console
10178
ibek dev instance /workspaces/ioc-adsimdetector/ioc_examples/bl01t-ea-test-02
@@ -128,15 +105,15 @@ pip install c2dataviewer
128105
Run the `c2dv` tool and connect it to our IOCs PVA output:
129106

130107
```console
131-
c2dv --pv BL01T-EA-TST-03:PVA:OUTPUT &
108+
c2dv --pv BL01T-EA-TST-02:PVA:OUTPUT &
132109
```
133110

134111
Back inside the developer container, you can now start the detector and
135112
the PVA plugin, by opening a new terminal and running the following:
136113

137114
```console
138-
caput BL01T-EA-TST-03:PVA:EnableCallbacks 1
139-
caput BL01T-EA-TST-03:CAM:Acquire 1
115+
caput BL01T-EA-TST-02:PVA:EnableCallbacks 1
116+
caput BL01T-EA-TST-02:DET:Acquire 1
140117
```
141118

142119
You should see the moving image in the `c2dv` window. We now have a working
@@ -154,8 +131,8 @@ YAML file. We will change the startup script that it generates so that the
154131
simulation detector is automatically started when the IOC starts.
155132

156133
To make this change we just need to have the startup script set the values
157-
of the records `BL01T-EA-TST-03:CAM:Acquire` and
158-
`BL01T-EA-TST-03:PVA:EnableCallbacks` to 1.
134+
of the records `BL01T-EA-TST-02:DET:Acquire` and
135+
`BL01T-EA-TST-02:PVA:EnableCallbacks` to 1.
159136

160137
To make this change, open the file
161138
`ibek-support/ADSimDetector/ADSimDetector.ibek.support.yaml`
@@ -183,9 +160,9 @@ If you now go to the terminal where you ran your IOC, you can stop it with
183160
following output at the end of the startup log:
184161

185162
```console
186-
dbpf BL01T-EA-TST-03:CAM:Acquire 1
163+
dbpf BL01T-EA-TST-02:DET:Acquire 1
187164
DBF_STRING: "Acquire"
188-
dbpf BL01T-EA-TST-03:PVA:EnableCallbacks 1
165+
dbpf BL01T-EA-TST-02:PVA:EnableCallbacks 1
189166
DBF_STRING: "Enable"
190167
epics>
191168
```
@@ -218,11 +195,11 @@ Add the following to
218195

219196
```yaml
220197
- type: epics.dbpf
221-
pv: BL01T-EA-TST-03:CAM:Acquire
198+
pv: BL01T-EA-TST-02:DET:Acquire
222199
value: "1"
223200
224201
- type: epics.dbpf
225-
pv: BL01T-EA-TST-03:PVA:EnableCallbacks
202+
pv: BL01T-EA-TST-02:PVA:EnableCallbacks
226203
value: "1"
227204
```
228205

0 commit comments

Comments
 (0)