Created
April 26, 2017 18:39
-
-
Save xiaoqiangwang/874d7d87c60a6ab68c0f303460828885 to your computer and use it in GitHub Desktop.
An script to monitor PVs from script https://gist.github.com/gtortone/514302df79439bc59a9c905c48e8543f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from CaChannel import CaChannel | |
names = [] | |
for i in range(1, 17): | |
for s in ('F', 'B'): | |
for j in range(1, 4): | |
names.append('S%d%s:TEMP:TEMP%02d' % (i, s, j)) | |
names.append('S%d%s:RH' % (i, s)) | |
# create the PVs | |
chans = [] | |
for name in names: | |
chan = CaChannel(name) | |
chan.search() | |
chans.append(chan) | |
chans[0].pend_io(10) | |
def eventCB(epics_args, user_args): | |
print('%s %s' % (user_args[0].name(), epics_args['pv_value'])) | |
# monitor | |
for chan in chans: | |
chan.add_masked_array_event(None, None, None, eventCB, chan) | |
chans[0].flush_io() | |
# wait for ever | |
import time | |
while True: | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment