Start and run CANoe from Command Prompt
Asked Answered
H

6

6

Is it possible to start and run Vector CANoe from the Command Prompt and/or by using any other external script?

Horsey answered 8/12, 2014 at 13:9 Comment(0)
D
2

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

Delude answered 17/9, 2015 at 20:30 Comment(0)
P
2

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.

Pustulant answered 18/4, 2018 at 13:53 Comment(0)
I
2

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
Injector answered 8/8, 2019 at 13:43 Comment(0)
K
0

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.

Kaliningrad answered 8/12, 2014 at 20:25 Comment(1)
I should add that FDX is also a good choice. You can make an Ethernet application that remotely controls some parts of the configuration.Kaliningrad
S
0

For more advanced applications, CANoe is implemented as a COM-server and can be communicated with using that interface. CANoe's built-in help chapters will help you getting started.

Sprung answered 30/3, 2015 at 16:4 Comment(0)
N
0

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.

Nancynandor answered 19/12, 2019 at 10:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.