是否可以通过命令提示符或使用其他外部脚本启动和运行Vector CANoe?
' Creates and returns a reference to CANoe Application.
Set App = CreateObject("CANoe.Application")
Set Measurement = App.Measurement
Set Logging = App.Configuration.OnlineSetup.LoggingCollection(1)
Dim TestFunction, IsRunning
Wscript.ConnectObject Measurement, "Measurement_"
For Count = 1 To 5
Logging.FullName = "C:\CANWIN" & Count & ".ASC"
StartMeasurement()
MsgBox "Press [Ok] to start the next
Measurement...", vbSystemModal
Measurement.Stop
Next
MsgBox "Logging script done..."
While IsRunning
On Error Resume Next
TestFunction.Call(CDbl(Second(Time)))
Wscript.Sleep 1000
Wend
Wscript.DisconnectObject Measurement
Set Measurement = Nothing
Set App = Nothing
Sub Measurement_OnInit()
Set TestFunction =
App.CAPL.GetFunction("TestFunction")
End Sub
Sub Measurement_OnStart()
IsRunning = True
End Sub
Sub Measurement_OnStop()
IsRunning = False
End Sub
Sub StartMeasurement()
IsRunning = False
Measurement.Start
Count = 0
While Not IsRunning
Wscript.Sleep 100
Count = Count + 1
If Count = 10 Then
MsgBox "Failed to start measurement!"
Wscript.Quit
End If
Wend
End Sub
'ToStart CANoe_Start.vbs
Set App = CreateObject("CANoe.Application")
dim fso: set fso = CreateObject("Scripting.FileSystemObject")
dim CANoe_config
CANoe_config = fso.BuildPath(fso.GetAbsolutePathName("."), "<target.cfg>")
App.Measurement.Start()
之后你可以在Jenkins作业中添加操作;要关闭相同的应用程序,请使用:
'ToStop CANoe_Stop.vbs
Set App = CreateObject("CANoe.Application")
App.Quit()
这对我很有帮助。你可以通过命令提示符调用vbs脚本。
没错。你应该进入帮助 -> 内容 -> CANoe -> 概述。
那里将提供关于如何使用命令提示符与CANoe及其模块的所有信息。
对于更高级的应用,CANoe被实现为COM服务器,可以使用该接口进行通信。CANoe内置的帮助章节将帮助您入门。
C:\Program Files\Vector CANoe 10.0\Exec64
,但在您的系统上可能会有所不同。canoe64
。canoe64 "D:\Documents\SomeProject\myConfig.cfg"
在这两种情况下,都会显示强制性的规定弹窗。