How to Start CANoe and Measurement During Autostart of Computer with Visual Basic Script (VBS)

Question:
How do I start CANoe and the measurement during the autostart of the computer?
Answer:

Copy the Visual Basic Script into the autostart folder: C:\Users\”user name” \AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Dim ScriptPath

ScriptPath = "C:\Users\Public\Documents\Vector\CANalyzer\Sample Configurations 11.0.42\CAN\CANMainDemo"

Set App = CreateObject("CANalyzer.Application")
Wscript.Sleep(1500)

App.Open (ScriptPath & "\CANMainDemo.cfg")
Wscript.Sleep(1000)

Set Measurement = App.Measurement
Wscript.ConnectObject Measurement, "Measurement_"

App.Measurement.Start

WScript.Sleep(2000)

Download this example for further information.

Note:
Visual basic script could be used as well to run CAPL code or call CAPL functions.


Article ID: 1064
Last updated: 2018-10-29
Revision: 6
CANalyzer/CANoe -> COM -> How to Start CANoe and Measurement During Autostart of Computer with Visual Basic Script (VBS)
https://kb.vector.com/entry/1064/