Start and run CANoe from Command Prompt

断了今生、忘了曾经 提交于 2019-12-01 19:23:48

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

CANOE simply loads a .cfg configuration file. For jenkins, I am using the Visual Basics script and using this loading perticular configration file.

In this was it bypasses the "I accept" and other windows and loads the desired configuration also also using same kind of VB scirpt 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.

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.

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.

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!