How to: Fixed channel assignment with PCAN-PCIe devices

CAN FD Interface for PCI Express Mini (PCIe)
Locked
M.Heidemann
Sales & Support
Sales & Support
Posts: 1021
Joined: Fri 20. Sep 2019, 13:31

How to: Fixed channel assignment with PCAN-PCIe devices

Post by M.Heidemann » Mon 13. Jul 2020, 15:39

HOW-TO: Setting fixed hardware handles on PCIe based hardware

Due to the nature of PCI/PCIe some systems will discard the order in which PCI/PCIe devices are recognized at the previous boot,
which can be problematic in case you use fixed hardware channels for multiple hardware of the same type, for example in PCANBasic.

To set a fixed hardware-handle to your CAN-Channels on a PCI/PCIe based PCAN Interface device, please follow these steps:

Make sure your device has an unique device ID, which you can for example set with PCAN-View via the Hardware view.

Open up the Registry-Editor:

Look for the following registry path:

Code: Select all

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\pcan_pci

Add a new registry-key of type "string" with the following syntax :

The registry entry name represents the hardware-handle

Hardware1 = HardwareHandle1,
Hardware2 = HardwareHandle2
...
etc.

0x00,controllernr=x,devicenr=0xXX

- Hardware-Type
______________________________________________________________________________________________________________
Here a list of the device-type values for the PCAN PCI/PCIe devices:
PCI and PCIexpress based cards:
  • 0x103 = PCAN-PCI Express (current version)
  • 0x113 = PCAN-PCI Express FD
  • 0x107 = PCAN-PC/104-Express (current version)
  • 0x117 = PCAN-PC/104-Express FD
  • 0x108 = PCAN-miniPCIe
  • 0x118 = PCAN-miniPCIe FD
  • 0x10A = PCAN-ExpressCard 34
  • 0x109 = PCAN-Chip PCIe
  • 0x119 = PCAN-Chip PCIe FD
  • 0x11A = PCAN-M.2

- Controller-Number (Channel)
______________________________________________________________________________________________________________
Channel number in ascending order, starting at 0, so physical channel 1 is channel-number 0, physical channel 2 is channel-number 1, etc.

- Device-number
______________________________________________________________________________________________________________
User defined device id, 0x00 - 0xff

Below an example:
Shown in this picture: valid registry-entries for a fixed hardware handle
Shown in this picture: valid registry-entries for a fixed hardware handle
RegistryEntryHardwareHandle.PNG (29.31 KiB) Viewed 21954 times

Note: The hardware handle for plug-´n-play devices starts with 16 and decrements by 1 with every CAN channel. PCAN-Basic takes this into account, meaning that PCAN_USBBUS1 = hardware16


Reboot your PC after setting the entries in the registry.

Your hardware should now be accessible via the fixed hardware-handle.


Note: With PCI based device the procedure is different, please see the following forum post regarding this:

viewtopic.php?f=120&t=998


Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

Locked