Hi Mark,
On 04/18/2014 09:23 AM, Poff, Mark A wrote:
> Is it possible to pass a PV value as the argument of a program call from
> a MEDM Shell Command button? It seems like that would be a useful
> capability, but I can’t find any reference to it. Somebody posted this
> question in Tech-Talk for EDM in 2004 (“EDM: Passing PV values to shell
> commands”) but it doesn’t appear that the question was ever addressed.
> Can anybody tell me whether this capability exists and if so, the syntax?
That's a great question. The answer is not directly, but you can have
the user select a PV from any widget on the display, and if you make the
shell command pass that through `caget -t` you can convert the name into
the PV's value before calling your program.
The Shell Command widget supports embedding the &P operator from the
Execute Menu command[1] which prompts the user to point to the PV to be
named before executing the command string.
Example: I create a Shell Command widget with a command set to
echo `caget -t &P`
I also put at least one other PV on the screen. When I click the button,
the cursor changes to prompt me to click on a widget that will provide
the PV name. The caget command is then executed on that PV, and the
value returned gets echoed on the terminal where I started medm.
Of course if your PV name is fixed you don't have to use the &P part at
all, you can just name it directly in the caget call:
echo `caget -t myPV`
Hope this helps,
- Andrew
[1]
http://www.aps.anl.gov/epics/EpicsDocumentation/ExtensionsManuals/MEDM/MEDM.html#ExecuteMenu
--
Advertising may be described as the science of arresting the human
intelligence long enough to get money from it. -- Stephen Leacock
- Replies:
- RE: MEDM: Passing PV Values to Shell Commands Poff, Mark A
- References:
- MEDM: Passing PV Values to Shell Commands Poff, Mark A
- Navigate by Date:
- Prev:
MEDM: Passing PV Values to Shell Commands Poff, Mark A
- Next:
RE: MEDM: Passing PV Values to Shell Commands Poff, Mark A
- 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
- Navigate by Thread:
- Prev:
MEDM: Passing PV Values to Shell Commands Poff, Mark A
- Next:
RE: MEDM: Passing PV Values to Shell Commands Poff, Mark A
- 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
|