-
Notifications
You must be signed in to change notification settings - Fork 2
/
ioc_main.py
37 lines (26 loc) · 825 Bytes
/
ioc_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import logging
import time
# import ophyd
from pypvserver import (PypvServer, PyPV,
logger as server_logger)
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
server_logger.setLevel(logging.DEBUG)
logging.basicConfig()
server = PypvServer(prefix='test_prefix:')
logger.info('Creating PV "pv1", a floating-point type')
python_pv = PyPV('pv1', 123.0, server=server)
# full_pvname includes the server prefix
pvname = python_pv.full_pvname
logger.info('... which is %s including the server prefix', pvname)
time.sleep(0.1)
for value in range(10):
logger.info('Updating the value on the server-side to: %s', value)
python_pv.value = value
time.sleep(0.05)
logger.info('Done')
try:
while True:
time.sleep(1.0)
except KeyboardInterrupt:
print('Done')