Reusing USB-to-CAN V2 Compact without reconnecting
CompletedHello,
I'm using USB-to-CAN V2 Compact VCI4 to create a Windows application. However, the sample code has a flaw that I can't seem to get around in my project. If I connect the device, then start the application, I connect without issue. If I launch the application a second time, I get the message
Error: Initializing socket failed : A device attached to the system is not functioning.
I figure the issue is related to the device not being freed after the application ends. In my application, the `FinalizeApp()` function is called on exit to attempt to reset it, but this doesn't help, neither does calling it from a button.
I also tried disposing of the `mCanSched` object after calling `Reset()`, since this object is never disposed and it is the one that fails to initialize in the sample project, but this doesn't solve the issue.
Thanks in advance for any help.
Edit + Resolution: I tried the demo and my own project again after a weekend and can no longer reproduce the problem. For now, we're going with the hypothesis that my USB hub and the CAN interface weren't getting along.
-
Official comment
Dear Daniel,
Unfortunately I could not reproduce the problem.
Could you please register in the online support tool on our webpage
https://support.hms-networks.com/hc/en-us
create a support request there and let me know the ticket number?
(in the online support tool we can send to you a programming example)
(Here only jpeg, gif and png attachments up to 2MB are possible)
Best regards
Andreas -
Hello Andreas,
Thanks for getting back to me so quickly.
The ticket number is #446798.
Thanks.
0
Please sign in to leave a comment.
Comments
2 comments