-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Writable Measurement Typed As OTT_MEASURE #8
Comments
Hi, if the object is writable, then it is a calibration object and your a2l is incorrect. |
CANape has the option to make measurements read/write per the a2l screenshot. I don't have the capability to change them due to the auto-generation process merging a2l's from other sources outside of my control. Of course I could manually intervene to change them to calibrations every time it get re-generated I'd prefer not to have to do so! |
Yep I saw the same thing. Let me try it on a newer version of CANape first and see if it resolves. If not I can patch it myself if you're not interested in my proposed change of removing the if block |
Sounds good, if newer versions still behave like this, we could replace that |
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:
The text was updated successfully, but these errors were encountered: