APIs, concepts, guides, and more

◆ recorder_value_reader()

recorder_value_reader ( controller,
data_type )
The cheapest way to read one recorded value of the given RSIDataType from Python.

Returns a callable reader(recorder_number, record_index, data_index) for use after
RecorderRecordDataRetrieveBulk. Each RecorderRecordData*Get call crosses the SWIG
boundary once, and that crossing dominates the cost of draining a Recorder from Python:
RecorderRecordDataValueGet / RecorderRecordDataDoubleGet return a plain number (about
0.65 us per value), while RecorderRecordDataFirmwareValueGet returns a FirmwareValue
object that then needs an attribute read (about 1.3 us). A large Recorder set (many nodes,
every sample) only keeps up with the plain getters.

The Recorder copies 8 bytes from every address. Types up to 32 bits use ValueGet (the
low 32 bits) and are masked to their width and, if signed, sign-extended, so the bytes
next to a narrow value do not leak in; FLOAT reinterprets those 32 bits. DOUBLE uses
DoubleGet. 64-bit integer types use DoubleGet and reinterpret the 8 bytes, which is exact
unless the value's top 12 bits are all set (a NaN bit pattern): counters never get there.

Definition at line 225 of file _helpers.py.