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  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: shell command in medm
From: "Li, Yuelin" <[email protected]>
To: "Southern, Tim" <[email protected]>, "[email protected]" <[email protected]>
Date: Tue, 2 Aug 2016 13:42:37 +0000

Tim,

 

Thanks for the suggestion.

 

We tried things like that, the key concern is that we do not want people to have direct access to the function thus it does not prevent people from hitting the wrong button.  To have an extra layer seems to be more useful.

 

The current solution is not perfect but seems to do what we want. The eventual solution is to have a hard wired interlock system with certain bypass mode, but this will come later.

 

Thanks for all helped, it looks like the script is working now.

 

Yuelin

 

 

 

 

From: Southern, Tim [mailto:[email protected]]
Sent: Monday, August 01, 2016 6:14 PM
To: Li, Yuelin <[email protected]>; [email protected]
Subject: Re: shell command in medm

 

Hi Yuelin,

Why not do all the work in the medm screen itself? You could use a calc _expression_ to determine the visibility of the control widget for PV2.

Or have a text widget visibility triggered by a calc _expression_ that displays the warning on the screen itself without popup screens.

-Tim Southern

On 7/29/16 11:14 AM, Li, Yuelin wrote:

Dear all,

 

I have several questions regarding medm use. The goal is as the following: by clicking a button, before moving PV2, I need to check if PV1 is bigger than a safe value POS1. If no, a warning screen starts. If yes,  it moves PV2 to a new postion POS2.  It is not obvious that this can be done in medm, so I tried to use medm's shell command capability.

 

The script, named myScript, is as the following:

VAR1=$(caget -t PV1)
if [ $VAR1 -le $POS1 ];then
medm –x warning.adl
else
caput PV2 $POS2
fi

It is implemented in the medm as 'sh myScript'. The script works fine in shell. When implemented in a medm, it just starts another medm process but does not load up the warning.adl file regardless whether the if condition is fulfilled. Is this due to some hidden limitation in the medm shell command capability?

 

The second part of question is about Closing the warning.adl display. In that screen, I want that by pressing a button the PV2 will change to POS2, and at the same time close the medm display. Again, it obvious to me that one can do it in medm so I implemented the following shell command:

 

caput PV2 $POS2 && xdotool search –name warning.adl windowkill

 

When excuted, it will change the PV as needed and kill the screen together with the medm process started in the script above – this is why I have to start another medm process in the first place. This implementation is working fine but if one close the warning screen without killing the second medm process, all other epics screens cannot be accessed.

 

I need advice that is there an alternative way within mdem to accomplish what I described?  And why myScript does not work in medm?

 

Thanks!

 

Yuelin Li

 

 




 


References:
shell command in medm Li, Yuelin
Re: shell command in medm Southern, Tim

Navigate by Date:
Prev: PCASpy 0.6.2 Wang Xiaoqiang (PSI)
Next: Re: NDArrayPool::alloc failing Phil Atkin
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: shell command in medm Southern, Tim
Next: Can an IOC receive/process CIP data? Lane, Randy
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 03 Aug 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·