CANoe multiple instances using win32com

Question:

I’m trying to create two CANoe instances using Python (win32com module).

I’m trying to create two objects and open the configurations, but it creates only one instance. How can I achieve creating two CANoe instances?

I disabled the option in the application which was to permit only one instance (I am able to open two CANoe instances manually).

application = win32com.client.DispatchEx("CANoe.Application")

application.Open(config)

application2 = win32com.client.DispatchEx("CANoe.Application")

application2.Open(config2)
Asked By: Shilpa

||

Answers:

It is possible to do this but not recommended.

You can navigate to the CAN.ini file and change the following under [System] tag. (Default value is 0)

SingleCOMClient=1

A warning is mentioned just about this line. So, use this option with CAUTION!

Restart CANoe once to bring this change to effect.

The .ini file can be found in C:ProgramDataVectorCANoe<version>CAN.ini

NOTE : Using DispatchEx will create a new instance by default.
Using Dispatch will first check if any existing CANoe instance is available and attach to that instance. If no open instance, then it will create a new one.

Answered By: Shyam

Cant find an CAN.ini file maybe something changed with CANoe Versions?

Answered By: Stephan
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.