使用Python调用CANalyzer发送报文。目前CANalyzer已经能够运行,可以监听报文,但在发送报文时遇到问题。
from RunAll import *
app = CanoeSync()
total = 0
suc_total = 0
fail_total = 0
app.Start()
while not msvcrt.kbhit():
EngineSpeed = app.get_SigVal(channel_num=1, msg_name="CemBodyFr103", sig_name="ShortDropWinDrvrDoor", bus_type="CAN")
print(EngineSpeed)
app.set_SigVal(channel_num=1, msg_name="CemBodyFr103", sig_name="ShortDropWinDrvrDoor", bus_type="CAN", setValue=2.0)
def Set_SigVal(self, chanel_num, msg_name, sig_name, bus_type, setValue):
if (self.application != None):
result = self.application.GetBus(bus_type).GetSignal(chanel_num, msg_name, sig_name)
result.Value = setValue
else:
raise RuntimeError("CANoe is not Open, unable to set signal value")
————————————————
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/KCSDN_1212/article/details/120435210
write打印:System 01-0083 SetSignal was called for signal 'Signal:CAN1/CAN_LEFT/CemBodyFr103/ShortDropWinDrvrDoor', but no signal driver is available.