@@ -4,8 +4,8 @@ Creating an IOC
44Introduction
55------------
66
7- Once the module has been installed (see `installation `) we can create a
8- simple EPICS Input/Output Controller (IOC).
7+ Once the module has been installed (see `installation `) we can create a
8+ simple EPICS Input/Output Controller (IOC).
99
1010An EPICS IOC created with the help of ``pythonIoc `` and `softioc ` is
1111referred to as a "Python soft IOC". The code below illustrates a simple IOC
@@ -19,30 +19,30 @@ Each section is explained in detail below:
1919 :start-after: # Import
2020 :end-before: # Set
2121
22- The `softioc ` library is part of ``pythonIoc ``. The two submodules
23- `softioc.softioc ` and `softioc.builder ` provide the basic
22+ The `softioc ` library is part of ``pythonIoc ``. The two submodules
23+ `softioc.softioc ` and `softioc.builder ` provide the basic
2424functionality for Python soft IOCs and are the ones that are normally used.
2525
2626`cothread ` is one of the two possible libraries the IOC can use for
27- asynchronous operations.
27+ asynchronous operations.
2828(see `../how-to/use-asyncio-in-an-ioc ` for the alternative)
2929
3030
3131
3232.. literalinclude :: ../examples/example_cothread_ioc.py
33- :start-after: # Create
33+ :start-after: # Create
3434 :end-before: # Boilerplate
3535
3636PVs are normally created dynamically using `softioc.builder `. All PV
37- creation must be done before initialising the IOC. We define a lambda function for
38- `on_update ` on ``ao `` such that whenever we set ``ao ``, ``ai `` will be set to the
39- same value. The ``always_update `` flag ensures that the ``on_update `` function is always
37+ creation must be done before initialising the IOC. We define a lambda function for
38+ `on_update ` on ``ao `` such that whenever we set ``ao ``, ``ai `` will be set to the
39+ same value. The ``always_update `` flag ensures that the ``on_update `` function is always
4040triggered, which is not the default behaviour if the updated value is the same as the
4141current value.
4242
4343
4444.. literalinclude :: ../examples/example_cothread_ioc.py
45- :start-after: # Boilerplate
45+ :start-after: # Boilerplate
4646 :end-before: # Start
4747
4848
@@ -52,14 +52,14 @@ which must be called in this order. After calling
5252:func: `~softioc.builder.LoadDatabase ` it is no longer possible to create PVs.
5353
5454.. literalinclude :: ../examples/example_cothread_ioc.py
55- :start-after: # Start
55+ :start-after: # Start
5656 :end-before: # Finally
5757
5858We define a long-running operation that will increment the value of ``ai `` once per
59- second. This is run as a background thread by `cothread `.
59+ second. This is run in the background by `cothread `.
6060
6161.. literalinclude :: ../examples/example_cothread_ioc.py
62- :start-after: # Finally
62+ :start-after: # Finally
6363
6464Finally the application must refrain from exiting until the IOC is no longer
6565needed. The :func: `~softioc.softioc.interactive_ioc ` runs a Python
@@ -69,7 +69,7 @@ internals of the IOC while it's running. The alternative is to call something
6969like :func: `cothread.WaitForQuit ` or some other `cothread ` blocking
7070action.
7171
72- In this interpreter there is immediate access to methods defined in the
72+ In this interpreter there is immediate access to methods defined in the
7373`softioc.softioc ` module. For example the :func: `~softioc.softioc.dbgf ` function
7474can be run to observe the increasing value of ``AI ``::
7575
@@ -79,15 +79,15 @@ can be run to observe the increasing value of ``AI``::
7979 DBF_DOUBLE: 37
8080
8181And the :func: `~softioc.softioc.dbpf ` method allows data to be set and to observe
82- the functionality of the lambda passed to ``on_update `` . We set the value on ``AO ``
82+ the functionality of the lambda passed to ``on_update `` . We set the value on ``AO ``
8383and read the value on ``AI `` (exact values will vary based on time taken)::
8484
8585 >>> dbgf("MY-DEVICE-PREFIX:AI")
8686 DBF_DOUBLE: 15
8787 >>> dbpf("MY-DEVICE-PREFIX:AO","999")
88- DBF_DOUBLE: 999
88+ DBF_DOUBLE: 999
8989 >>> dbgf("MY-DEVICE-PREFIX:AI")
90- DBF_DOUBLE: 1010
90+ DBF_DOUBLE: 1010
9191
9292
9393Creating PVs
0 commit comments