> 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:
-
“Execute Script”
action, a script that launched when pressing the
button. Doesn’t receive any PVs, only the ‘widget’.
-
“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.