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  2016  2017  2018  2019  2020  2021  2022  2023  2024  2025  <2026 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  2025  <2026
<== Date ==> <== Thread ==>

Subject: CS-Studio rules on X/Y Plot
From: "Pearson, Matthew via Tech-talk" <tech-talk at aps.anl.gov>
To: EPICS Tech Talk <tech-talk at aps.anl.gov>
Date: Thu, 4 Jun 2026 20:58:34 +0000

Hi,

 

I’m seeing some odd behavior with an X/Y plot in CS-Studio. I have 3 rules setting these properties:

 

y_axes[0].autoscale

y_axes[0].maximum

y_axes[0].minimum

 

and 3 PVs for each of those. For example, the autoscale rule is simply:

 

try:

    pvInt0 = PVUtil.getLong(pvs[0])

 

## Script Body

    if pvInt0==0:

        widget.setPropertyValue('y_axes[0].autoscale', False)

    else:

        widget.setPropertyValue('y_axes[0].autoscale', True)

 

except (Exception, lang.Exception) as e:

    widget.setPropertyValue('y_axes[0].autoscale', True)

    if not isinstance(e, PVUtil.PVHasNoValueException):

        raise e

 

and that works fine. The pv0 is:

 

record(bo, "$(S)vAcq:ScaleAuto") {

  field(DESC, "Waveform Autoscale")

  field(PINI, "YES")

  field(VAL, "1")

  field(ZNAM, "Manual")

  field(ONAM, "Auto")

}

 

However, the script for maximum and minimum don’t always work (mostly don’t work). Here’s the one for maximum:

 

try:

    pvInt0 = PVUtil.getLong(pvs[0])

    pvInt1 = PVUtil.getLong(pvs[1])

    pv1 = PVUtil.getDouble(pvs[1])

 

## Script Body

    if pvInt0==0:

        widget.setPropertyValue('y_axes[0].maximum', pv1)

    else:

        widget.setPropertyValue('y_axes[0].maximum', 100.0)

 

except (Exception, lang.Exception) as e:

    widget.setPropertyValue('y_axes[0].maximum', 100.0)

    if not isinstance(e, PVUtil.PVHasNoValueException):

        raise e

 

with pv0 the same as before, and the maximum one (pv1) being:

 

record(ao, "$(S)vAcq:ScaleMax") {

  field(DESC, "Waveform Max Limit")

  field(PINI, "YES")

  field(VAL, "100")

  field(PREC, "3")

  field(EGU,  "kV")

}

 

If I switch $(S)vAcq:ScaleAuto to Auto (1), it works fine and the plot autoscales. If I switch to Manual (0), the scale doesn’t change. I can force it to work by forcing a monitor update (setting MDEL=-1 and processing the record) or by simply changing the value.

 

If I reload the screen after switching to Manual (0), mostly the plot ends up with a fixed Y axis from 0.0 to 10.0 (I’m not sure where the 10.0 comes from, as the "$(S)vAcq:ScaleMax is not 10.0 and the default setting in the screen XML file is 100.0).

 

Any ideas?  

 

I’m using the latest SNS CS-Studio build, as of a few days ago.

 

I know the user can edit the autoscale, max and min settings from the runtime settings window, but I want these settings autosaved and to persist between CS-Studio instances and between IOC reboots. I can work around it I think, making use of that MDEL=-1 trick, but I’d like to understand where my scripts are going wrong.

 

Cheers,

Matt

 


Navigate by Date:
Prev: Re: Motor: Experience with KOHZU ? Torsten Bögershausen via Tech-talk
Next: Re: Motor: Experience with KOHZU ? Mark Rivers via Tech-talk
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  2025  <2026
Navigate by Thread:
Prev: Re: Motor: Experience with KOHZU ? Mark Rivers via Tech-talk
Next: Some software became inaccessible Jörn Dreyer via Tech-talk
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  2025  <2026
ANJ, 05 Jun 2026 · Home · News · About · Talk · Base · Modules · Extensions ·
· Distributions · Download · Documents · Links · Licensing ·