Run and run CANoe from the command line

Is it possible to start and run Vector CANoe from the command line and / or using any other external script?

+4


source to share


5 answers


This document explains how to control CANoe from C ++, C #, etc. It can be used by CANoe as a COM server utility. http://www.vector.com/portal/medien/cmc/application_notes/AN-AND-1-117_CANoe_CANalyzer_as_a_COM_Server.pdf



+1


source


CANOE just loads the .cfg config file. For jenkins, I am using Visual Basics script and using this perticular upload config file.

In doing so, it bypasses "I accept" and other windows and load the desired configuration, also using the same VB vibrate button that 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 activities to jenkins jobs; in order to close the same use of appilcation:

'ToStop CANoe_Stop.vbs
Set App = CreateObject("CANoe.Application")
App.Quit()

      

This worked for me. You can invoke the vbs command line.

+1


source


It. You should go to Help -> Content -> CANoe -> Browse.

All the necessary information will be provided on how to use the command line with CANoe and its modules.

0


source


For more advanced applications, CANoe is implemented as a COM server and can be transferred using this interface. CANoe's built-in help sections help you get started.

0


source


Yes, it is possible to launch Vector CANoe from an external script. The following VBS script code shows the various possibilities of starting CANoe and reacting to 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

      

0


source







All Articles