I've found that if a PCAN USB device is physically disconnected after my VB application initializes it, that subsequent calls to retrieve the device condition return a value of PCAN_CHANNEL_OCCUPIED. Calls to read the bit rate return a value of 0x11c (250k).
Because of this I can't determine if the device is connected or not.
Is there a work around for this?
Peak Driver: PCAN_USB 4.0.15.15857
Physically disconnected PCAN USB condition = Occupied
Re: Physically disconnected PCAN USB condition = Occupied
Hello,
This is normal. The parameter PCAN_CHANEL_CONDITION is used to know if a channel is avilable to connect or not. Since you have already connected it, then it is OCCUPPIED. You will receive that status because that channel is reserved for your application. If you plug in the device again, then your program will continue to work normally.
kkregger wrote:I've found that if a PCAN USB device is physically disconnected after my VB application initializes it, that subsequent calls to retrieve the device condition return a value of PCAN_CHANNEL_OCCUPIED
This is normal. The parameter PCAN_CHANEL_CONDITION is used to know if a channel is avilable to connect or not. Since you have already connected it, then it is OCCUPPIED. You will receive that status because that channel is reserved for your application. If you plug in the device again, then your program will continue to work normally.
In order to know if the channel is still active, then use the function CAN_GetStatus. This function returns PCAN_ERROR_ILLHW if the device is not physically connected.kkregger wrote:Because of this I can't determine if the device is connected or not.
Is there a work around for this?
Best regards,
Keneth
Keneth