Ok Andrew, it's working - sorry for the misunderstanding. Thanks!
Mark
-----Original Message-----
From: Andrew Johnson [mailto:[email protected]]
Sent: Friday, April 18, 2014 3:45 PM
To: Poff, Mark A; [email protected]
Subject: Re: MEDM: Passing PV Values to Shell Commands
Hi Mark,
On 04/18/2014 01:44 PM, Poff, Mark A wrote:
> For what it's worth, I'm on a Linux system. In the MEDM display's
> Shell Command 'Command' field I put the executable name - foo.exe -
> and in the 'Arguments' field I put the line you recommend, echo 'caget
> -t myPV', where myPV is the target PV name.
Ok, maybe you didn't fully understand my example - sorry, I was using 'echo' as my example of the command (your foo.exe).
You do need to know the difference between a regular single quote character ' and the back-tick character ` which is the quote to the left of the 1 digit on most US PC keyboards. The back-tick quote tells the shell that is executing your command-line "run the contents of this string as a command and substitute its output for this string in the actual command when you run that."
So for your case, you would need to put the following string into the 'Arguments' field:
`caget -t myPV`
Where the first and last characters of that are a back-tick quote, and myPV is whatever PV name you want the value of. When you click the button and MEDM runs the command, the shell will first execute the caget, then append the output from that command onto the foo.exe command-line.
If you have a local Unix/Linux expert they may be able to help you with this, which is really just a one-line shell command.
HTH,
- Andrew
--
Advertising may be described as the science of arresting the human intelligence long enough to get money from it. -- Stephen Leacock
- References:
- MEDM: Passing PV Values to Shell Commands Poff, Mark A
- Re: MEDM: Passing PV Values to Shell Commands Andrew Johnson
- RE: MEDM: Passing PV Values to Shell Commands Poff, Mark A
- Re: MEDM: Passing PV Values to Shell Commands Andrew Johnson
- Navigate by Date:
- Prev:
Re: MEDM: Passing PV Values to Shell Commands Andrew Johnson
- Next:
Warning messages in CSS John Hammonds
- 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:
Re: MEDM: Passing PV Values to Shell Commands Andrew Johnson
- Next:
Warning messages in CSS John Hammonds
- 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
|