是否可以从命令提示符和/或使用任何其他外部脚本启动和运行 Vector CANoe?
我想在 CAPL(具体来说是 Visa32.dll、visa.h 或 sicl.h)中集成一个头文件 .h 或 .dll 文件来控制万用表 34461A。如何在 CANoe 中包含 .h 文件或 .dll 文件?我创建了一个名为万用表的 ECU 模块。谢谢,
使用 dispatch aswin32com.client.Dispatch工作正常,但从attribute error:DispatchWithEvents 调用产生win32com.client.WithEvents,问题存在,直到Temp\gen_py文件夹被删除
我可以删除一Temp\gen_py开始的文件夹import win32com.client
path=r"C:\Users\omc\AppData\Local\Temp\gen_py"
rmtree(path, ignore_errors=True)
while os.path.exists(path):
pass
Run Code Online (Sandbox Code Playgroud)
对于我的测试中的第一次迭代工作正常,但对于相同代码的第二次迭代会产生 attribute error:
from shutil import rmtree
path=r"C:\Users\omc\AppData\Local\Temp\gen_py"
rmtree(path, ignore_errors=True)
while os.path.exists(path):
pass
import win32com.client
class CanoeTestModuleEvents(object):
"""Handler for CANoe TestModule events"""
def OnStart(self):
print("< Test Module started >")
bTestModuleRunning = True
def OnStop(self,Reason) :
print("< Test Module stopped >")
bTestModuleRunning = False
if Reason == 0:
print("Test module was executed completely")
else:
if Reason== 1: …Run Code Online (Sandbox Code Playgroud) 使用 CAPL 和 CANoe 通过 CAN 上的 ISO-TP 传输大量数据。是否有例程可以处理嵌入在 CAPL 中的数据分段,还是我需要编写自己的解释?
我对 CAPL 语言还很陌生。因此,我在将数据写入 .txt 文件时遇到问题。这是我写的代码:
\n\n includes\n{\n\n}\n\nvariables\n{\n message Generate_Num Gen;\n message Logger Logs;\n msTimer tim_100ms;\n msTimer tim_500ms;\n int time_over; // 500 ms flag.\n dword handle=0;\n float val=0;\n long index=0;\n int val_arr[512];\n}\n\non start \n{\n time_over=0; \n setWritePath("C:\\\\Users\\\\T\xc3\xbcrker\\\\Desktop\\\\soft_pro");\n handle= openFileWrite("Log.txt",1);\n Gen.Num_Data=1;\n}\n\non envVar Logger_Sw\n{ \n\n if(@this)\n {\n setTimer(tim_500ms,500);\n setTimer(tim_100ms,100);\n }\n else\n {\n cancelTimer(tim_500ms);\n cancelTimer(tim_100ms);\n }\n\n}\n\non envVar Save_txt\n{ \n if(@Save_txt==1)\n {\n int i;\n float val_n;\n for(i=0;i<elcount(val_arr);i++)\n {\n val_n=val_arr[i];\n writeProfileFloat("1","1",val_n,"Log.txt");\n }\n } \n}\n\non timer tim_100ms\n{\n output(Gen);\n Gen.Num_Data++; \n setTimer(tim_100ms,100);\n}\n\non message Generate_Num\n{\n if(time_over==1)\n {\n val=this.Num_Data;\n val_arr[index]=val; …Run Code Online (Sandbox Code Playgroud) 我是 CANoe 和 CAPL 语言的新手。但是我想问你:我怎样才能在ECU的网络上用CAPL发送消息。例如:我想发送一个十六进制数(这是一个 ECU 的问题),然后我想看到这个问题的回答。
我不知道我是否很清楚,但如果您有任何答案,我将不胜感激。