【发布时间】:2019-02-11 10:28:29
【问题描述】:
TestModule.Stop()
While TMExecuting
WScript.Sleep(200)
Wend
Sub TestModule_OnStop(reason)
TMExecuting = False
Select Case (reason)
Case 0
MsgBox "Test module was executed completely."
Case 1
MsgBox "Test module was stopped by the user."
Case 2
MsgBox "Test module was stopped by measurement stop"
End Select
End Sub
我尝试在测试模块完成后使用它来停止测试模块,并使用 WHILE 循环来启动第二个测试模块。但是在第一个测试模块完成后,我无法启动第二个测试模块。当我在文本文件中编写执行步骤时,我得到了它的原因。
TestModule.Start()
While (Not TMStarted)
WScript.Sleep(200)
LogFile.WriteLine "Test started"
wend
While (TMExecuting)
WScript.Sleep(500)
LogFile.write("Value of TMExecuting is:" & TMExecuting)
LogFile.WriteLine "CANoe test is running"
Wend
在第一个测试模块完成后,TMExecuting 应该是 false,这是在
中完成的Sub TestModule_Onstop(reason)
TMExecuting = False
TMStarted = False
Select Case (reason)
Case 0
MsgBox "Test module was executed completely."
Case 1
MsgBox "Test module was stopped by the user."
Case 2
MsgBox "Test module was stopped by measurement stop"
End Select
LogFile.WriteLine " CANoe test is finished"
End Sub
但它不会因为第二个测试模块没有启动而变成假。 如果有人有任何解决方案,请提供帮助。 我想使用 VBScript 在单个 Canoe 配置配置中运行多个测试模块和测试环境。
【问题讨论】:
-
你能发布完整的代码吗?我认为 OnStop 处理程序与 CANoe 的连接丢失了,但如果没有看到完整的代码,这很难说。
-
当然,我会在我开始测量和测试模块并停止它们的地方发布代码的主要内容。
标签: vbscript command-prompt canoe