1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 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 2011 2012 2013 2014 2015 <2016> 2017 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Question about return ping value by using pcaspy in camonitor |
From: | lzf neu <[email protected]> |
To: | "[email protected]" <[email protected]> |
Date: | Tue, 6 Sep 2016 08:37:28 +0000 |
Hi all,
i want to display the TEST:PING value in camonitor, which is the return value by ping 127.0.0.1. i know pcaspy can implement this, but i am newer in it. below is the pcaspy program i wrote and there is an error. Could you give me some advice and thanks in advance.
#!/usr/bin/env python
import os from pcaspy import Driver, SimpleServer prefix = 'TEST:' pvdb = { 'PING' : { a, }, } class myDriver(Driver): def __init__(self): super(myDriver, self).__init__() def determine(): a=os.system("ping -c 1 -w 1 127.0.0.1") if (a==0): print "communication established !" if __name__ == '__main__': server = SimpleServer() server.createPV(prefix, pvdb) driver = myDriver() # process CA transactions while True: server.process(0.1) |