File: putwait.py

package info (click to toggle)
python-pyepics 3.4.1%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,080 kB
  • sloc: python: 11,184; makefile: 106; javascript: 104; sh: 1
file content (37 lines) | stat: -rw-r--r-- 738 bytes parent folder | download | duplicates (2)
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
"""This script tests using EPICS CA and Python threads together

Based on code from  Friedrich Schotte, NIH, modified by Matt Newville
20-Apr-2010
"""

import time
import epics
import sys
import pvnames 

write = sys.stdout.write
flush = sys.stdout.flush

write('initial put: \n')
epics.caput(pvnames.motor1, -2.0)
epics.caput(pvnames.motor2, 33.0)

write('sleep...')
time.sleep(2.0)
flush()

write('now put with wait: \n')
flush()

epics.caput(pvnames.motor2, -20.0, wait=True)
write('done with move 1\n')
flush()

epics.caput(pvnames.motor2, 20.0, wait=True)
write('done with move 2\n')

epics.caput(pvnames.motor2, -20.0, wait=True)
write('done with move 3\n')

epics.caput(pvnames.motor2, 20.0, wait=True)
write('done with move 4\n')