The free CAN Software API (Application Programming Interface) for Windows®
-
ilves
- Posts: 8
- Joined: Thu 16. Jul 2026, 08:15
Post
by ilves » Wed 5. Aug 2026, 11:28
Hello, the problem is described in the title. I use .NET / C# with the old PEAK-XCP API examples.
I recall the following code snippet above was already working correctly to identify if I have a normal PCAN-USB or a PCAN-USB FD connected, but it stopped working without any reason.
Code: Select all
TPCANChannelInformation[] channelFeatures = new TPCANChannelInformation[1];
PCANBasic.GetValue(handle, TPCANParameter.PCAN_CHANNEL_FEATURES, channelFeatures);
return (channelFeatures[0].device_features & PCANBasic.FEATURE_FD_CAPABLE) != 0;
The call PCANBasic.GetValue does not return any error.
I also checked already with multiple PCANBasic.dll versions (v4.6 and v5.1) without difference.
What would be the correct way to achieve this?
-
K.Wagner
- Software Development

- Posts: 1093
- Joined: Wed 22. Sep 2010, 13:36
Post
by K.Wagner » Wed 5. Aug 2026, 16:19
Hello,
I think you are mixing up stuffs here. Note that you are using the method
PCANBasic.GetValue with the parameter
PCAN_CHANNEL_FEATURES. This parameter returns an unsigned integer, a flag value which has the features bit-coded. You can see this in the help:

- Features.png (21.71 KiB) Viewed 974 times
But you are passing an array of channel information, which is used with the parameter
PCAN_ATTACHED_CHANNELS:
Code: Select all
TPCANChannelInformation[] channelFeatures = new TPCANChannelInformation[1];
Note that you are probably having an memory wrong access here since the API is using a reference as an integer in this case, and it can cause an access violation. Check the sample codes for more information, for instance, the console sample for C# called 02_GetSetParameter. You will find in there a function called GetPCAN_CHANNEL_FEATURES as example.
Best regards,
Keneth
-
ilves
- Posts: 8
- Joined: Thu 16. Jul 2026, 08:15
Post
by ilves » Fri 7. Aug 2026, 11:06
Thanks, returning an int works!