Example #1
0
 def array_get(self, req_type=None, count=None, **keywords):
     """
     If :meth:`setMonitor` has not been called then this function simply calls
     :meth:`CaChannel.CaChannel.array_get`.  If :meth:`setMonitor` has been called then it calls
     :meth:`CaChannel.CaChannel.pend_event` with a very short timeout, and then returns the
     PV value from the last callback.
     """
     if self.callBack.monitorState != 0:
         # This should be self.poll(), but that is generating errors
         self.pend_event(.0001)
     if self.callBack.monitorState == 2:
         self.callBack.newMonitor = 0
         return self.callBack.pv_value
     else:
         return CaChannel.array_get(self, req_type, count, **keywords)
Example #2
0
    for record in db.values():
        if rtyps and record.rtyp not in rtyps:
            continue

        # issue connect requests and wait for connection
        chans = {}
        for field in record.fields:
            chan = CaChannel(record.name + '.' + field)
            chan.search()
            chans[field] = chan
        ca.pend_io(10)

        # issue read requests and wait for completion
        for chan in chans.values():
            chan.array_get(ca.dbf_type_to_DBR_CTRL(chan.field_type()))
        ca.pend_io(10)

        # compare and print
        all_consistent = True
        for field, chan in chans.items():
            # get configured value
            config_value = record.fields[field]
            # skip those with empty config values
            if config_value == '':
                continue

            # dbr is a dict containing the channel information
            dbr = chan.getValue()
            actual_value = dbr['pv_value']