Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PV status low, high, lolo, hihi always set to 0 #11

Closed
GoogleCodeExporter opened this issue Mar 14, 2015 · 4 comments
Closed

PV status low, high, lolo, hihi always set to 0 #11

GoogleCodeExporter opened this issue Mar 14, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

I am not able to set some value to the low, high, lolo, hihi status variables. 
In the example alarm_severity.py in the pcaspy-0.4.1/example directory the 
variables are set to not equal zero:

$ python alarm_severity.py

in another console cainfo does not show me any alarm values:

$ cainfo MTEST:RAND

MTEST:RAND
    State:            connected
    Host:             10.0.2.15:5064
    Access:           read, write
    Native data type: DBF_DOUBLE
    Request type:     DBR_DOUBLE
    Element count:    1

I also tried with pyepics on the ipython console:

In [1]: import epics
In [2]: pv=epics.PV('MTEST:RAND')
In [3]: print pv.info                                            
== MTEST:RAND  (native_double) ==
   value      = 0
   char_value = '0'
   count      = 1
   nelm       = 1
   type       = double
   units      = 
   precision  = 3
   host       = 10.0.2.15:5064
   access     = read/write
   status     = 17
   severity   = 3
   timestamp  = 1412767230.217 (2014-10-08 04:20:30.21738)
   upper_ctrl_limit    = 0.0
   lower_ctrl_limit    = 0.0
   upper_disp_limit    = 0.0
   lower_disp_limit    = 0.0
   upper_alarm_limit   = 0.0
   lower_alarm_limit   = 0.0
   upper_warning_limit = 0.0
   lower_warning_limit = 0.0
   PV is internally monitored, with 0 user-defined callbacks:
=============================

Tested with epics
base-3.14.12.3 and
base-3.14.12.4 and
base-3.15.0.2

swig2.0
Python 2.7.5+
ubuntu 13.10

Original issue reported on code.google.com by wernwa@gmail.com on 8 Oct 2014 at 2:07

@GoogleCodeExporter
Copy link
Author

The first issue is a problem of alarm_severity.py. In myDriver.write method, it 
did not handle the write request of PV 'RAND'. I have committed a fix in the 
repository. Please check.

The second issue is more subtle. The low,high,lolo,hihi fields are currently 
only used to configure how to set alarm/severity status.  When reporting the 
various limits, the lolim, hilim fields are used instead. This creates the 
confusion. I would propose to use the following correspondence:
  upper_ctrl_limit and upper_disp_limit -> hilim
  lower_ctrl_limi and lower_disp_limit -> lolim
  upper_alarm_limit -> hihi
  lower_alarm_limit -> lolo
  upper_warn_limit -> high
  lower_warn_limit -> low

So an equivalent of the ao record of 
record(ao, "ao")
{
    field (LOLO, "-10")
    field (LLSV, "MAJOR")
    field (LOW,  "-5")
    field (LSV,  "MINOR")
    field (HIGH, "5")
    field (HSV,  "MINOR")
    field (HIHI, "10")
    field (HHSV, "MAJOR")
    field (LOPR, "-10")
    field (HOPR, "10")
    field (DRVL, "-10")
    field (DRVH,  "10")
}

could be configured as 
{
  'lolim': -10, 'hilim': 10,
  'lolo': -10, 'low':-5,
  'hihi': 10, 'high': 5
}


Original comment by xiaoqian...@gmail.com on 8 Oct 2014 at 7:30

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

The above changes have been done in 0.5.1.b1. 

sudo pip install hg+http://code.google.com/p/pcaspy

I will release it if you confirm the fix.

Original comment by xiaoqian...@gmail.com on 9 Oct 2014 at 7:44

@GoogleCodeExporter
Copy link
Author

hallo xiaoqian

With the new version the fields low,high,lolo,hihi are now displayed with 
pyepics:

In [3]: pv=epics.PV('MTEST:RAND')
In [4]: print pv.info
...
   upper_alarm_limit   = 10.0
   lower_alarm_limit   = -10.0
   upper_warning_limit = 5.0
   lower_warning_limit = -5.0
...

So i can confirm the changes! 

Yes, i was little bit confused by the amount of fields. Thanks for making it 
more clear.

Original comment by wernwa@gmail.com on 9 Oct 2014 at 9:03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant