EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: pyEpics want postponed connecting
From: Hinko Kocevar <[email protected]>
To: [email protected]
Date: Thu, 02 Jun 2011 10:48:48 +0200
Fixing example.. still same result:

import epics
import time
import sys

def onConnectionChange(pvname=None, conn=None, chid=None):
print 'ca connection status changed: ', time.time(), pvname, conn, chid
    sys.stdout.flush()


# create channel, provide connection callback
pv1 = 'HINKS:ENV:ENV_VOLTAGE1_MONITOR'
chid1 = epics.ca.create_channel(pv1, connect=False, callback=onConnectionChange)

# create channel, provide connection callback
pv2 = 'HINKS:ENV:ENV_VOLTAGE2_MONITOR'
chid2 = epics.ca.create_channel(pv2, connect=True, callback=onConnectionChange)

time.sleep(1)
print "ca._cache:", epics.ca._cache

print 'Now waiting, watching values and connection changes:'
t0 = time.time()
while time.time()-t0 < 30:
    time.sleep(0.001)

print "Exiting .."


Output:
$ python caconnect.py
ca connection status changed: 1307004453.64 HINKS:ENV:ENV_VOLTAGE1_MONITOR True 157644296 ca connection status changed: 1307004453.64 HINKS:ENV:ENV_VOLTAGE2_MONITOR True 157644328 ca._cache: {155204176: {'HINKS:ENV:ENV_VOLTAGE2_MONITOR': {'callbacks': [<function onConnectionChange at 0x9591cdc>], 'failures': 0, 'chid': 157644328, 'conn': True, 'ts': 1307004453.635572}, 'HINKS:ENV:ENV_VOLTAGE1_MONITOR': {'callbacks': [<function onConnectionChange at 0x9591cdc>], 'failures': 0, 'chid': 157644296, 'conn': True, 'ts': 1307004453.635221}}}
Now waiting, watching values and connection changes:
Exiting ..


--
Hinko Kocevar
Technical support software engineer
Instrumentation Technologies
Velika pot 22, SI-5250 Solkan - Slovenia
T:+386 5 3352600, F:+386 5 3352601
mailto: [email protected]

http://www.i-tech.si - When your users demand stability

The information transmitted is intended solely for the addressee and may
contain confidential and/or privileged information. Any review, retention,
disclosure or other use by persons other than the intended recipient is
prohibited. If you received this in error, please notify the sender and
delete all copies.

References:
pyEpics want postponed connecting Hinko Kocevar

Navigate by Date:
Prev: pyEpics want postponed connecting Hinko Kocevar
Next: Re: caget command holds for more than 10 seconds Hinko Kocevar
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: pyEpics want postponed connecting Hinko Kocevar
Next: Re: pyEpics want postponed connecting Matt Newville
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·