File: no_monitor.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 (17 lines) | stat: -rw-r--r-- 357 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from __future__ import print_function
import time
import epics 
import pvnames

p = epics.PV(pvnames.updating_pv1, auto_monitor= False)

def onChange(pvname=None,char_value=None,value=None,**kw):
    print(pvname, value, time.ctime())
p.add_callback(onChange)

t0 = time.time()
p.get()
while time.time()-t0 < 20:
    print(p.get())
    time.sleep(0.1)