Can anyone recommend a good CAN to USB adapter? I need to interface a PC to an industrial control system that uses CAN.
I have two primary requirements: robust hardware (this will running in a system 24/7), and a good C# API with good documentation and example code (e.g. not a poor translation from Chinese).
The PEAK adapters, also resold by Grid Connect. Available in "regular" and opto-isolated flavors. Includes a handy bus monitor app (with logging and message injection) as well as libraries for Windows and Linux.
I haven't used the Linux drivers but have done several monitoring and control apps with the supplied Windows DLLs. Work fine, no complaints.
My oldest PEAK CAN-USB is at least six years old and is an earlier hardware rev than what's available now, but the current generation DLLs (and monitor app) speak to the older hardware just fine. My original DLLs don't recognize the new hardware, of course, but recompiling against the new DLLs brought the apps up to the current h/w rev. All of which is a long way of saying that PEAK seems to "get it" for supportability.
The Kvaser and Peak adapters suggested by other posters are only as good as USB and I have NEVER seen a 24/7 reliable PC-USB interface. I have seen customers swap from USB to RS232 or Ethernet on more than one occasion. If you need high reliability you should think very carefully about using USB. (My experience with this was mainly with Windows2k and XP operating systems - Linux or Windows 7 may be better.)
I've used the PEAK adapters under Linux and they work great. We actually had fewer problems under Linux than we did under Windows. The DLL as used by VB had a few minor quirks (I don't remember what they were, but they were pretty trivial and easy to work-around).
The Linux driver just plain worked. It provided two APIs, a "binary" API using ioctl() calls and an API that used newline-delimited hex-ASCII strings and read()/write() calls on a character device. The latter made it dead simple to write applications in Python, and the throughput on a CAN bus isn't high enough to make the hex-ASCII->binary conversion a problem. Using the hex-ASCII API, you could even capture data using nothing but a "cat" command from a shell prompt.
Agreed. The Linux drivers were always promptly updated whenever the kernel maintainers pulled the rug out from under the old ones.
--
Grant Edwards grant.b.edwards Yow! I'm having an
at emotional outburst!!
Essentially the entire automotive industry in Germany uses CAN interfaces and tools by Vector Informatik (vector.com). Elsewhere they use Kvaser, Peak, Mentor Graphics (the name no longer has much of a relation to the field of business..), you name it.
I thought you wanted C# support? I suspect it is probably /possible/ to use C# on a Mac, but I can't imagine anyone doing so. C# is almost exclusively Windows-only, and even MS Visual Studio only (mono has never caught up or caught on).
I'd expect the potential market for CAN interfaces on Macs is tiny - and a small slice of a small market is not likely to be a priority. There is plenty of support for CAN interfaces in Linux - some done by the manufacturers (Grant mentioned PEAK's support), and some done by users or other developers and built into the kernel.
But if I had to connect a Mac to a CAN bus, I'd look at things like a RS-232 to CAN interface (I expect Macs to support at least some USB to RS-232 cables), or an Ethernet to CAN interface.
I haven't used any of their CAN products, but I do own and use their Beagle USB and I2C/SPI protocol analyzers and Aardvark I2C/SPI host adapters. So far I've been very happy with their products.
They have API and library for Mac OSX, too.
BTW, I have no affiliation with Total Phase - just a customer.
If you wish to avoid copying a chain of dodgy DLLs into your system directo ry and ?PInvoke?ing them from your C# program - then the following is worth considering:
formatting link
Uses the CANUSB hardware. As for Library API documentation.. source code?
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.