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: Question about pv value and the label display in CSS boy opi
From: "Kasemir, Kay" <[email protected]>
To: lzf neu <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Fri, 12 Aug 2016 15:09:59 +0000
Hi:

On Aug 12, 2016, at 10:16 AM, lzf neu <[email protected]> wrote:
1) My first problem is how to display a pv value that multiplied by 1E6;
Ideally, you add a calc record to the IOC to create your scaled PV.
Then you can just display the PV “as is”.

I have tried Text Update widget in CSS Boy opi and write a EmbeddedScript for the widget which is as follows:

import Package(Packages.org.csstudio.opibuilder.scriptUtil);
var pv0=PVUtil.getDouble(pvs[0]);
widget.setPropertyValue=("pv_value",pv0=pv0*1E6);

The Text Update widget displays the value of the PV.
If you have a script that also updates the value of the widget, they both fight each other.

Use a Label widget, then update its text:

var pv0=PVUtil.getDouble(pvs[0]);
widget.setPropertyValue=(“text", “The scaled value is %g” % pv0*1E6);

Ideally, though, avoid the script and just create a proper PV in the first place.

2 ) My second question:
In order to display the unit, I place a Label widget and set its Text as "Sv/h" and I hope the Text changed to "uSv/h" correspond to the pv value that multiplied by 1E6.

How is the text supposed to change? Hope is not a good strategy for this case.

You can again attach a script to the Label widget that sets the label’s “text” property based on the value of some PV.

Ideally, though, avoid the script and create a proper PV in the first place:

record(calc, “scaled_value")
{
  field(INPA, “that_original_value CP”)
  field(CALC, “A*1E6”)
  field(EGU, "uSv/h”)
}

==> Now you just add a Text Update widget, enter the “scaled_value” as a PV name, done.

-Kay


References:
Question about pv value and the label display in CSS boy opi lzf neu

Navigate by Date:
Prev: Is there any support for EPICS for IronPython (or anyone working on it)? Tillman, Dave
Next: Re: wait/dealy inside a record Andrew Johnson
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: Question about pv value and the label display in CSS boy opi lzf neu
Next: Is there any support for EPICS for IronPython (or anyone working on it)? Tillman, Dave
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, 12 Aug 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·