Read PnP channel id

The free CAN Software API (Application Programming Interface) for Windows®
Post Reply
mark32
Posts: 4
Joined: Mon 28. Nov 2016, 17:39

Read PnP channel id

Post by mark32 » Mon 28. Nov 2016, 18:11

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?

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Read PnP channel id

Post by PEAK-Support » Tue 29. Nov 2016, 11:40

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.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Post Reply