Good evening!
We are perceiving a strange behaviour with get_with_metadata method in pyepics here.
We have a motor record PV with defined PREC and EGU fields. We have a script that goes:
my_pv = epics.PV("MGN:B:PB01:CS7:m4")
my_dict = my_pv.get_with_metadata(use_monitor=True)
First weird behaviour: between the many values returned in my_dict, the "precision" key is associated with "None" value and the same goes for "unit" key:
{'pvname': 'MGN:B:PB01:CS7:m4', 'value': 3.56963, 'char_value': '3.56963', 'status': 0, 'ftype': 20, 'chid': 28543096, 'host': '
10.10.10.38:46317', 'count': 1, 'access': 'read/write', 'write_access': True, 'read_access': True, 'severity': 0, 'timestamp': 1663352086.023605,
'posixseconds': 1663352086.0, 'nanoseconds': 23605915, 'precision': None, 'units': None, 'enum_strs': None, 'upper_disp_limit': None, 'lower_disp_limit': None, 'upper_alarm_limit': None, 'lower_alarm_limit': None, 'lower_warning_limit': None, 'upper_warning_limit':
None, 'upper_ctrl_limit': None, 'lower_ctrl_limit': None, 'nelm': 1, 'type': 'time_double', 'typefull': 'time_double'}
Second weird behaviour: when executed several times, dictionaries with different number of keys are returned. Changing use_monitor=False limited the dictionary size to
{'status': 0, 'severity': 0, 'timestamp': 1663353141.426072, 'posixseconds': 1663353141.0, 'nanoseconds': 426072330, 'value': 3.56963}
and the number of keys does not vary, but now we dont have precision and unit, which would be useful. Are we doing something wrong? Where does get_with_metadata gets its information from? Shouldnt "unit" come from EGU field?
I couldnt find answers for that in the documentation. Thanks for any help
🙂