Page 1 of 1

How to check if PCAN-interface is FD-capable?

Posted: Wed 5. Aug 2026, 11:28
by ilves
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?

Re: How to check if PCAN-interface is FD-capable?

Posted: Wed 5. Aug 2026, 16:19
by K.Wagner
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
Features.png (21.71 KiB) Viewed 140 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.

Re: How to check if PCAN-interface is FD-capable?

Posted: Fri 7. Aug 2026, 11:06
by ilves
Thanks, returning an int works!