How Do I Identify the CAN Interface When I Have Four Komodo Can Duo Interfaces Connected to the Hub?

Abstract of hub data
Question from the Customer:

I am using a Windows computer to communicate to four Komodo CAN Duo Interfaces through a USB hub. I am running eight separate targets. How do I know which Komodo interface is handling which target? My problem – the Windows device manager associates a different port number for each Komodo channel each time I plug in a new device. How can I identify which Komodo channel is transferring data?

Response from Technical Support:
Thanks for your question! The latest Komodo CAN Duo Interface that is attached at with the host machine is allocated with USB port 0, and the original device is allocated the next port.

  1. Komodo channel A is connected to the host machine and is allocated port number 0.
  2. Komodo channel B is next connected to the host machine, and is allocated port number 0. Komodo A is then allocated port 1.

 

Get the Unique ID of the Komodo Interface

To have a consistent handle for each Komodo device, we recommend using Komodo Software API. Our API is compatible with Windows, Linux and MAC operating systems, and supports multiple programming languages. In addition, functional program examples are included, which you can use as is or modify for your specific requirements. There are two API commands for locating a device, km_find_devices and km_find_devices_ext.
 

Use API to Find Assigned Ports

For your requirements, to determine the ports to which the Komodo interfaces have been assigned, we recommend using the command km_find_devices_ext: it returns the unique ID of the Komodo interface and its allocated port number. With that information, you can then modify your code to select the handle of the specific target based on the unique ID of the channel Komodo interfaces. The other command, km_find_devices, only identifies the allocated port number. Here are the details of command km_find_devices_ext:

Find Devices (km_find_devices_ext)
  int km_find_devices_ext (int num_ports,

u16 *ports,
int num_ids,
u32 *unique_ids);

Function

Get a list of ports and corresponding unique IDs, through which Komodo devices can be accessed.

Arguments

num_ports               maximum number of ports to return
ports        array into which the port numbers are returned
num_ids                   maximum number of unique IDs to return
unique_ids               array into which the unique IDs are returned

Return Value

This function returns the number of ports found, regardless of the array size.

Specific Error Codes

None.

For more information, please refer the API Documentation section of the Komodo CAN interface User Manual.

Additional resources that you may find helpful include the following:

Here are some articles about using API with the Komodo Interface:

We hope this answers your question. If you have other questions about our CAN interfaces or other Total Phase products, feel free to contact us at sales@totalphase.com . You can also request a demo that is specific for your application.

Request a Demo