Using Multiple KMotion Boards

The KMotion Driver Library allows multiple PC processes (applications), each running multiple threads of execution, to communicate with multiple KMotion boards simultaneously.  Each KMotion board is identified by a USB location identifier where it is connected.  A USB location identifier is a 32 bit integer.  USB devices are arranged in a tree structure of hubs and nodes.  Each hexadecimal digit of the USB location specifies a branch in the tree structure.  For the purposes of the KMotion Driver Library, a USB location identifier may simply be considered a unique integer that will remain the same as long as the structure of the USB tree is not altered.   Adding or removing USB devices will not change the location of a connected KMotion board.

Selecting the USB Locations menu of the KMotion Setup and Tuning application, will display a list of all currently connected KMotion boards.  The Checkmark indicates which board the application is currently communicating with.   To switch to a different board, select the USB location from the list.


When launching the KMotion Setup and Tuning application, a command line parameter may be specified to connect to a specific USB location (see below on how to setup a shortcut to connect to a specific location).  Multiple shortcuts may be setup to connect to individual boards.









The KMotion Driver Library has a function to list the USB locations of all currently connected KMotion boards. See:

int ListLocations(int *nlocations, int *list);


When making KMotion Driver Library function calls specify the USB location identifier of the desired board as the board parameter shown in the example below.  Specifying a board value of 0 may be used if there is only one board in a particular system.  This will result in a connection to the first available board.

int CKMotionDLL::WriteLineReadLine(int board, const char *s, char *response)