LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN BUS reading: Interfacing USB-8473 with LABVIEW

Solved!
Go to solution

Hi all.

 

I have a USB-8473 device from National Instruments and would like to read CAN messages that are transmitted by an ECU. I am following this link for the driver setup.

 

I managed to install the drivers: NI-Industrial Communications for CANopen, NI-XNET (which I might not need.), and NI-CAN.

 

  • How would I go about writing a VI that reads the CAN messages and display them on LabVIEW?
0 Kudos
Message 1 of 19
(236 Views)

Hi kulani,

 


@Kulani93 wrote:
  • How would I go about writing a VI that reads the CAN messages and display them on LabVIEW?

Open the example finder and examine the example coming with all those CAN drivers...

 

(IMHO you don't need CANopen for ECU reading.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO
0 Kudos
Message 2 of 19
(202 Views)
Solution
Accepted by topic author Kulani93

@Kulani93 wrote:

Hi all.

 

I have a USB-8473 device from National Instruments and would like to read CAN messages that are transmitted by an ECU. I am following this link for the driver setup.

 

I managed to install the drivers: NI-Industrial Communications for CANopen, NI-XNET (which I might not need.), and NI-CAN.

 

  • How would I go about writing a VI that reads the CAN messages and display them on LabVIEW?

Well to start with you need the CAN specification from the manufacturer to know how to decode the CAN messages. 

 

But in general I used a Producer/Consumer architecture in my two can bus sniffer projects.

  1. The Producer loop receives the CAN messages and puts them in a Queue
  2. The Consumer loop decodes the CAN frames based on the Arbitration ID and the manufacturer specifications, then displays the data

Here's an example...

canaCapture.PNG

========================
=== Engineer Ambiguously ===
========================
Message 3 of 19
(191 Views)

Thank you so much, this is exactly what I was looking for. Just to see the logic and the API's that are used.

 

My only issue is that I can't find the NI-CAN Channel API's that you used in the example. I tried searching for them on the Function Block e.g. CAN Read, but I don't get any blocks.

 

I believe they should have been included when I installed the NI CAN drivers? Or please tell me how I can get them. 

 

I have the LabVIEW Base version.

 

Edited: 

 

All the software currently installed.All the software currently installed.

 

Self test was a Pass for the USB 8473Self test was a Pass for the USB 8473

0 Kudos
Message 4 of 19
(162 Views)

I see NI CAN is for the 32 Bit version of LABVIEW and I have the 64-bit version.

 

Could this be the reason I can't see the blocks?

0 Kudos
Message 5 of 19
(155 Views)

Hi Kulani,

 


@Kulani93 wrote:

I see NI CAN is for the 32 Bit version of LABVIEW and I have the 64-bit version.

 

Could this be the reason I can't see the blocks?


Yes.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO
Message 6 of 19
(152 Views)

Thank you.

 

I have installed the 32-bit version of LabVIEW. I can now see the Industrial Communication Library. I currently have the CANopen blocks.

 

I see that the blocks differ from the example @RTSLVU posted.

 

Which library is that? Where can I find it?

Industrial Communication - CANopennIndustrial Communication - CANopenn

0 Kudos
Message 7 of 19
(136 Views)

Hi Kulani,

 


@Kulani93 wrote:

I have installed the 32-bit version of LabVIEW. I can now see the Industrial Communication Library. I currently have the CANopen blocks.

 

I see that the blocks differ from the example @RTSLVU posted.

 

Which library is that? Where can I find it?


As I wrote before you usually don't need CANopen to communicate with a common ECU…

The functions in RTSLVUs image are from the (old) NI-CAN driver.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO
Message 8 of 19
(132 Views)

I now have the CAN Functions similar to the example. I just had to reinstall the NI CAN Drivers to be inclusive of LABVIEW 32 Bit.

 

Thank you.

 

NINI

0 Kudos
Message 9 of 19
(119 Views)

As you are using the old USB CAN dongle, you can't use the Industrial Communication Library
You need to use the old NI-CAN library og NI-XNET with NI-CAN compatibility.

 

 

Message 10 of 19
(118 Views)