Skip to content

Instantly share code, notes, and snippets.

@xiaoqiangwang
Created April 26, 2017 18:39
Show Gist options
  • Save xiaoqiangwang/874d7d87c60a6ab68c0f303460828885 to your computer and use it in GitHub Desktop.
Save xiaoqiangwang/874d7d87c60a6ab68c0f303460828885 to your computer and use it in GitHub Desktop.
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