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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Question about determining network connection by using different LED widget color |
From: | "Kasemir, Kay" <[email protected]> |
To: | lzf neu <[email protected]> |
Cc: | "[email protected]" <[email protected]> |
Date: | Thu, 1 Sep 2016 13:00:56 +0000 |
Hi:
On Sep 1, 2016, at 4:21 AM, lzf neu <[email protected]> wrote:
My problem is to achieve a color change display by using LED widget in css boy opi to determine whether the network communication problem occured. The CS-Studio display tools (BOY, ..) are display tools for representing the current state of PVs on EPICS IOCs.
In BOY, you add a widget, enter the PV name, done.
Same really goes for EDM, MEDM, .. all the other EPICS display tools.
Channel Access will automatically handle the network connection state.
If a PV cannot be reached, the display tool widgets will reflect that, usually via some alarm-sensitive border color.
If you want to check the network connectivity to some non-EPICS device, for example by ‘pinging’ it, and then display that information within EPICS, you should somehow provide that information in a PV.
You could try to implement an EPICS sequence on an IOC which pings the device and updates a PV.
Or look at pcaspy, then write a python tool that pings your device and reports the status as a PV.
BOY (and the currently developed display builder update) do support scripts, so in principle you could perform the pinging inside a display tool script, then directly update for example a label’s text, colored circle’s color, or a local PV (which is then
displayed by an LED widget) in a script.
But:
The scripting API is not guaranteed to stay the same through updates of the CS-Studio display tools.
With BOY, that script will execute on the UI thread. So while you’re waiting for the result of the ‘ping’ to arrive, all of CS-Studio will freeze.
(there are ways around this by creating a Runnable and submitting that as a background thread, but again details of that API will change, and if you have to ask how to do that and later how to maintain it, better avoid it).
Finally, such a functionality simply doesn’t belong into the user interface.
What if two people open the same display?
-> Now you’ll have two programs ping your device.
Since you care enough about the state of the device to show it on a display, maybe you also want to archive that information, or show it in a strip chart/data browser, or use it as an alarm. So you really want an actual PV. If that PV is updated from a
script in a UI, what happens if you close the display -> Now your device status PV no longer gets updated.
So keep the display tool as only the display, and get the information that you want to display into PVs.
-Kay
|