pycanape
pycanape copied to clipboard
Writable Measurement Typed As OTT_MEASURE
Thanks for the great library, super easy to use and got all the features I was interested in up and running pretty quickly.
The below if block is causing me trouble... My a2l has some writable measurement channels. I need to be able to write these via the Calibration class. When I comment out this if block, I’m able to get it working. On my setup for some reason writable measurements are showing as OTT_MEASURE, and not OTT_CALIBRATE like the API documentation says.
def _write_calibration_object_value(self, cov: TCalibrationObjectValue) -> None: if self.object_type != ObjectType.OTT_CALIBRATE: err_msg = "Cannot set value to a Measurement Object." raise TypeError(err_msg)
I am not sure if others have this same problem or if it is unique to the CANape V16 version I'm running. In any case, commenting out the if block is my only remedy at the moment so looking for a more permanent fix. To see if it would hurt anything to remove the if block for all users, I tried calibrating some read-only measurements channels and it still errors out albeit with a different exception so in my mind it still works as intended:
File "C:\bin\tool_lib\site-packages\pycanape\cnp_api\cnp_prototype.py", line 2631, in _get_last_error raise CANapeError(error_code, error_msg, function.__name__) pycanape.utils.CANapeError: Asap3WriteCalibrationObject failed (AEC_NOT_WRITE_ACCESS: Object has not write access)
Below is the a2l screenshot of the writable measurement that is showing up as OTT_MEASURE if helpful: