From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communicating with SocketCAN protocol with LabVIEW on a Windows computer

I have a Talon SRX motor controller which has CAN capabilities and uses SocketCAN protocol. The Talon is typically used with the roboRIO for the FRC, but I'm using for an independent project to control a single linear actuator. I'm using a Kvaser Leaf Light v2 CAN to USB to interface the controller with LabVIEW. The issue I'm running into is that SocketCAN is a Linux-based protocol and I'm running LabVIEW on a Windows computer.

 

Currently, the Talon recognizes that a CAN signal is coming in, but cannot interpret it. So far, I've just been testing with the stock LabVIEW that Kvaser provides.

 

Any suggestions for a work around?

0 Kudos
Message 1 of 4
(2,986 Views)

Unlike what you seem to believe, is SocketCAN not a different CAN protocol on the bus but rather a special form of API to access CAN interfaces. Traditionally every CAN interface manufacturer has created its own API library to access their hardware. On Linux they are sometimes modeled around the serial port interface, on Windows they are almost always in the form of a manufacturer specific DLL.

SocketCAN was proposed by VW to the Linux kernel as an extension to the Berkeley socket interface because this allows multiple applications to access the same hardware and a single application to easily access multiple different interfaces.

That does mean that the source code accessing the SocketCAN interface will obviously look different than when trying to access a CAN interface through another API, but the principle as well as the CAN protocol used remains the same.

So you will have to understand how your current app builds up the CAN messages and sends and receives them through SocketCAN, then investigate the Kvaser API that you want to use and how you can send the same CAN messages and receive the answers with this new API.

It is highly unlikely that anyone here has both experience with SocketCAN and the Kvaser API in order to guide you through the conversion process. So you will have to investigate and understand what is being sent and received in the old application and how that can be done with the Kvaser API.

Rolf Kalbermatter
My Blog
Message 2 of 4
(2,948 Views)

Did you ever get your Talon working with LabVIEW? We are trying to do something similar here and would be happy to hear of any progress.

Thanks!

Brian

0 Kudos
Message 3 of 4
(2,690 Views)

I recommend that you create a new thread/post as older posts often do not get the same exposure and responses from the community.

0 Kudos
Message 4 of 4
(2,680 Views)