02-07-2024 11:12 AM
I'm creating a python script to control a 2020R6 VeriStand project using the ASAM XIL API. I can get everything working except when it comes to reading the channel values. The MAPort.Read(channel) returns a "IBaseValue" object, but using the ".Value" attribute on that object gives me this error "IBaseValue object has no attribute 'Value' ". Any help would be appreciated. Thanks.
03-27-2024 11:27 AM
Try using __raw_implementation__
to get correct object.
# Read a value from the probe
raw_probeExp = maPort.Read('Probe1')
probeExp = raw_probeExp.__raw_implementation__
print(str(probeExp.Value))
I assume that XIL API assemblies are not fully compatibile with new pythonnet library. Some more information what changed: https://github.com/pythonnet/pythonnet/blob/master/CHANGELOG.md#changed-3