Is it possible to start and run Vector CANoe from the Command Prompt and/or by using any other external script?
Start and run CANoe from Command Prompt
15.8k views Asked by Gustaf Gulliksson AtThere are 6 answers
Is it possible to start and run Vector CANoe from the Command Prompt
By any means, yes it is. The trivial way to do that is to open a new Command Prompt instance (Ctrl + r, enter "cmd", hit return to run it) and provide the full path to your CANoe executable file. For instance, on CANoe v.10.0, x64, that would default to: C:\Program Files\Vector CANoe 10.0\Exec64
, but on your system this might vary.
A more elegant way would be to add this path to your Windows Environment Variables Path. Now you are able to just open a Command Prompt and type the name of the executable and run it. Remember, for CANoe x64 that would be canoe64
Is it possible to start and run Vector CANoe from the Command Prompt and load a specific configuration?
Yes. Just provide the path to the configuration as argument to your call, e.g.
canoe64 "D:\Documents\SomeProject\myConfig.cfg"
Mandatory regulation popups are displayed in both scenarios.
CANOE simply loads a .cfg configuration file. For Jenkins, I am using the Visual Basic script and using this loading particular configuration file.
In this was it bypasses the "I accept" and other windows and loads the desired configuration also also using same kind of VB script you can close the application.
'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()
After that you can add the operations in Jenkins jobs; to close the same appilcation use:
'ToStop CANoe_Stop.vbs
Set App = CreateObject("CANoe.Application")
App.Quit()
This worked for me. You can call the vbs's over command prompt.
This document tells you how to control CANoe from C++, C# etc. This by making use of the CANoe as a COM Server utilities. http://www.vector.com/portal/medien/cmc/application_notes/AN-AND-1-117_CANoe_CANalyzer_as_a_COM_Server.pdf
Yes, it is possible to run Vector CANoe from an external script. The following VBS script code shows the various possibilities to start CANoe and to react on events within 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
It is. You should go in Help - > Content - > CANoe - > Overview.
There will be every single info you need on how to use the command prompt with CANoe and its modules.