Exception was unhandled VB.NET

The free CAN Software API (Application Programming Interface) for Windows®

Exception was unhandled VB.NET

Postby ohbeee » Wed 22. Jun 2011, 12:30

Hello,

I have written my own application in using th PCANBASIC.VB in VB.NET.

The Problem that is that I becom an Error:
Exception was unhandled VB.NET
The value of a handle (PCAN-Channel, PCAN hardware, PCAN-Net, the PCAN-client) is invalid.
PCAN_ERROR_ILLCLIENT

What can be the problem, I debug the code but found nothing wrong.

Bye,

Bruce
ohbeee
 
Posts: 2
Joined: Wed 22. Jun 2011, 12:19

Re: Exception was unhandled VB.NET

Postby K.Wagner » Wed 22. Jun 2011, 14:45

Dear ohbeee,

first of all check that you are using the last version of the PCAN-Basic. Here you can see the current version and the changes made from version to version.

The description of this error suggests that you are not using the last release. An older version of PCAN-Basic had problems cleaning up orphaned connections. This situation is generated when the CAN_Uninitialize function is not called after working with a channel (e.g. stopping the debbuger or when a program crashes), so that at some time there are no more resources for a new connection.

If you already have the latest version, please give us more information about the error, e.g.
  • at which function call this problem occurs,
  • if the error also occur within the VB.NET sample you got within the API,
  • if the error occur after rebooting the system too,
  • sample of your code,
  • if you have any other product from PEAK.

Hope this help
Best regards,
Keneth
User avatar
K.Wagner
Software Development
Software Development
 
Posts: 134
Joined: Wed 22. Sep 2010, 13:36
Location: Darmstadt, Germany


Return to PCAN-Basic