阅读资料
https://github.com/hmq2018/Python-Vector-CANoe/blob/master/CANoe/Python_CANoe.py
https://libraries.io/pypi/Python-CANoe
需要导入的python库 pip install Python-CANoe==0.1
app = CANoe.CANoe() #定义CANoe为app
app.open_simulation("test.cfg") #导入某个CANoe congif
app.start_Measurement() #启动CANoe
var_from_namespace = app.get_all_SysVar("mfl") #获取namespace下的所有系统变量
print(app.get_SysVar("mfl","vol_plus")) #获取系统变量的值
app.set_SysVar("mfl","vol_plus",1) #写入系统变量的值
app.stop_Measurement() #停止CANoe
EX:
import time, os
import CANoe
app = CANoe.CANoe()
app.open_simulation("C:\\Users\\hwu\\Downloads\\01_Geely\\03 testGeelyPrV1.10-RKE1\\testGeelyPrV1.10 - R301 - eth1\\testGeelyPrV1.10 - R3 - eth1\\GeelyPr11.0 - 20R1 new.cfg") #导入某个CANoe congif
app.start_Measurement() #启动CANoe
print(app.get_SigVal(1, 'VgmConnFr05', 'BattSocRaw', bus_type="CAN"))
time.sleep(10)文章来源:https://www.toymoban.com/news/detail-401017.html
app.close_simulation()
文章来源地址https://www.toymoban.com/news/detail-401017.html
到了这里,关于Python控制CANoe的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!