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  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024  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  <20232024 
<== Date ==> <== Thread ==>

Subject: Re: [EXTERNAL] Scripts in Phoebus
From: Florian Feldbauer via Tech-talk <tech-talk at aps.anl.gov>
To: "Kasemir, Kay" <kasemirk at ornl.gov>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Wed, 9 Aug 2023 17:39:01 +0200

Hey Kay,

thanks for your answer.

The script is not intended to be used often, and mainly for convenience.
The idea is to use the cursor inside the image widget to get the coordinates of noisy pixels, press a button to add those pixels to a config file.

The configuration itself is handled by another process.

Regarding the "python not found" error: The script is attached to a widget in Phoebus and throws this exception when triggered. The same OPI has other scripts that work fine.
Therefore we do not expect it to be a configuration issue. But we will check again.

Cheers,
Florian


On 8/9/23 16:49, Kasemir, Kay wrote:

> it seems we can only  add 1 PV to the script executed by an Action Button.
> Is there any way to use more then 1 PV with scripts that should be executed via an Action Button?

> Also in another setup we have a small script that checks some configuration. When this script is executed a stack trace is visible in
the console showing the error "python not found".

Utility/console simply starts /usr/bin/python (configurable) and then you can send something line by line to it. Looks like you don’t have /usr/bin/python so need to add or configure that. Either way, totally unrelated to scripts running inside the GUI.

Buttons can start scripts in two ways:

  1. “Execute Script” action, a script that launched when pressing the button. Doesn’t receive any PVs, only the ‘widget’.
  2. “Script” attached to the widget and triggered by one or more PVs. Any widget can have that, not specific to button

If you want to have a script that has one or more PVs, AND trigger that via a button press:

Have button write 1 to loc://trigger(0)

Attach script to button (or really any widget) with PV loc://trigger(0) and maybe more PVs.

In the script, check if the loc://trigger(0) input is 1, and then do your thing, and reset the PV to 0 (which is a change in the PV and will once more trigger the script, but not do anything because you checked if the input is 1)

But in general, the better solution might be to have an IOC do what you want to do. Maybe an IOC implemented in python. In any case, you’ll then have a PV that you can write from a button or caput or PyQtDm or …, and it does what you want to do instead of adding control system logic into the GUI.



 

 

-- 
Ruhr-Universität Bochum
AG der Experimentalphysik I
Dr. Florian Feldbauer
NB 2/131 / Fach 125
Universitätsstr. 150
D-44801 Bochum

Office: NB 2/134
Phone:  (+49)234 / 32-23563
Fax:    (+49)234 / 32-14170
https://paluma.ruhr-uni-bochum.de

References:
Scripts in Phoebus Florian Feldbauer via Tech-talk
Re: [EXTERNAL] Scripts in Phoebus Kasemir, Kay via Tech-talk

Navigate by Date:
Prev: Re: [EXTERNAL] Scripts in Phoebus Kasemir, Kay via Tech-talk
Next: Re: netDev "channels" record type problem Shuei YAMADA via Tech-talk
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  <20232024 
Navigate by Thread:
Prev: Re: [EXTERNAL] Scripts in Phoebus Kasemir, Kay via Tech-talk
Next: EPICS documentation community survey NICOLE Remi via Tech-talk
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  <20232024 
ANJ, 11 Aug 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·