File: device_ao.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 (32 lines) | stat: -rw-r--r-- 473 bytes parent folder | download
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
#!/usr/bin/python

# test of simplest device

from epics.devices import ao
import sys
import time

myao = ao('Py:ao1')


if len(myao._pvs) < 10:
    print(" Not enough PVS!!")
    sys.exit()

if myao.VAL is None:
    print(" Value is None!!")
    sys.exit()


myao.write_state('tmp_aostate.txt')

time.sleep(0.5)

flines = open('tmp_aostate.txt').readlines()
if len(flines) < 10:
    print(" write_state didn't work properly")
    sys.exit()

print(" all tests passed!")