We are using a PEAK PCAN-USB adapter to exchange data with a CANopen device and are searching for an CANopen library for Java to accomblish this. The PLC4X API seems to be suitable for our project but we have to implement our application on a Windows 10 machine. Apparently it works fine with SocketCAN on linux. Is there a way to adapt PLC4X CANopen for use with above mentioned PEAK PCAN-USB adapter on Win10?
Thanks for your efforts.
I authored first version of canopen protocol within Apache PLC4X and can give you some tips on how to go forward.
Very early in the work most of canopen protocol was based on socketcan, which was most affordable way to get hardware/software interface for this protocol. However, over time I realized that socketcan adds its own flavors to frames and extracted tiny abstraction over plc4j transport api called
CANTransport
. TheCANTransport
is a middle ground between protocol logic and physical interface used for connectivity. This means that you can plug any other hardware, as long as you provide SPI for it. From protocol point of view, as long as supplied transport is compatible withCANTransport
interface, it will just work.I am not familiar with PEAK CAN interface and their programming libraries, however I expect there some sort of DLL which will let you pushing frames and receiving data. This is pretty much how socketcan adapter works. You can have a look at python adapter https://github.com/hardbyte/python-can/blob/develop/can/interfaces/pcan/basic.py and compare with PLC4X's SocketCANTransport. Basically there are three elements:
All above elements play together. In essence canopen protocol is decoupled from socketcan transport.