Page 1 of 1

Read PnP channel id

Posted: Mon 28. Nov 2016, 18:11
by mark32
I am trying to understand the API and can initialise my CAN USB successfully when I use 0x51 and a baud rate. But how can I read the available PnP channels assuming I plug in several CAN USB devices?

Re: Read PnP channel id

Posted: Tue 29. Nov 2016, 11:40
by PEAK-Support
Simply iterate from PCAN_USBBUS1 to PCAN_USBBUS16 and try to Init the CAN Channel.
Whenever you get a CAN_ERR_OK this Channel is available.

Or, if you do not want to init the CAN Node (fir secure reasons) you use the CAN_GetValue() function with the PCAN_CHANNEL_CONDITION Parameter. When you get a PCAN_CHANNEL_AVAILABLE the unit is pluged in.

All Info about the functions are inside the Online Help (CHM-File) - maybe take a look at tit to find more info.