cothread.dbr
index
/dls_sw/prod/common/python/cothread/1-14/cothread/dbr.py

Channel access datatype support.  Derived from definitions in the EPICS
header file db_access.h

 
Modules
       
ctypes
numpy
time

 
Functions
       
dbr_to_value(raw_dbr, datatype, count, name)
Convert a raw DBR structure into a packaged Python value.  All values
are returned as augmented types.
type_to_dbr(datatype, format=0)
Converts a datatype and format request to a dbr value, or raises an
exception if this cannot be done.
 
datatype can be either a DBF_XXXX value as returned by ca_field_type() or
data type supported by numpy
 
format can be one of
  - FORMAT_RAW: retrieve the raw format only
  - FORMAT_TIME: retrieve timestamp and alarm status data
  - FORMAT_CTRL: retrieve limit and control data
value_to_dbr(value)
Takes an ordinary Python value and converts it into a value in dbr
format suitable for sending to channel access.  Returns the target
datatype and the number of elements as well as a pointer to the raw
data.

 
Data
        DBR_CHAR = 4
DBR_DOUBLE = 6
DBR_ENUM = 3
DBR_FLOAT = 2
DBR_LONG = 5
DBR_SHORT = 1
DBR_STRING = 0
FORMAT_CTRL = 2
FORMAT_RAW = 0
FORMAT_TIME = 1
__all__ = ['DBR_STRING', 'DBR_SHORT', 'DBR_FLOAT', 'DBR_ENUM', 'DBR_CHAR', 'DBR_LONG', 'DBR_DOUBLE', 'FORMAT_RAW', 'FORMAT_TIME', 'FORMAT_CTRL', 'type_to_dbr', 'dbr_to_value', 'value_to_dbr', 'ca_extra_fields']
ca_extra_fields = ['name', 'ok', 'severity', 'status', 'raw_stamp', 'timestamp', 'units', 'upper_disp_limit', 'lower_disp_limit', 'upper_alarm_limit', 'lower_alarm_limit', 'upper_warning_limit', 'lower_warning_limit', 'upper_ctrl_limit', 'lower_ctrl_limit', 'precision', 'enums']