Read the current channel assignment using the CANoe COM Api

910 views Asked by At

We are using the COM API of CANoe together with Python comtypes automize CANoe in a complex test environment. At some point the CANoe channel assignment was not stable and we asked ourselves if it might be possible to read the CANoe channel assignment automatically, so that we can check if our test environment is stable.

The complete COM Object Hierarchy of CANoe is visible in the CANoe online help, but I'm completely lost, which functions needs to called to reproduce the table found underneath in the screenshot.

Below is a sample of the dialogue on my local PC, as I'm not allowed to show the real assignment in this question. Everythin is gray, as I don't have real hardware on my local PC installed and also no license.

Dialogue of CANoe channel assignment

1

There are 1 answers

1
xcreature On BEST ANSWER

You can use Application.Networks to get every channel, then use xlGetApplConfig function in the XL Driver Library to get the channel assignment of CANoe project. Here is the Manual of the XL Driver Library.

Below is the definition of the xlGetApplConfig function. Use "CANoe" as the input of appName.

XLstatus xlGetApplConfig( 
  char        *appName  
  unsigned int   appChannel, 
  unsigned int   *pHwType,  
  unsigned int   *pHwIndex, 
  unsigned int   *pHwChannel, 
  unsigned int  busType)