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: 

How to use USB CAN 8473, basic example code

Solved!
Go to solution

Hi all.,

 

I am using NI USB CAN 8473 to transmit and receive data through CAN.

I have gone through lot many pages related to this and realized that APIs will not work for USB-CAN. Can any one please tell me how to use this USB-8473.

may be an exaple program would help me. (It is not PCI it us USB, )

 

Thank you.

---------------- Be Good. Do Good. ---------------------
0 Kudos
Message 1 of 7
(6,367 Views)

What APIs are you talking about?

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 7
(6,361 Views)
Solution
Accepted by topic author suryajjj

You'll need to install NI-CAN, if you have not already done so.  That is the API you can use with an 8473.  After installing it, open Measurement & Automation Explorer, and make sure you can see the 8473 under your devices.

 

Here's a sample VI (LabVIEW 2009) that I wrote for another developer to do basic testing of CAN communication.  You enter a CAN packet as a series of hex bytes, separated by spaces, and it will send it.  It displays any CAN packets it receives in the same format.

Message 3 of 7
(6,350 Views)

When RECEIVING, the example works. However, the SEND function does not work. Probing the data, the correct information shows up at the wires into the C Write function (ncWriteNet.vi). This includes the data, length, arbitration ID, and object handle. Termination of 120 Ohms is implemented. Correct read and write function is attained using all non National Instruments products (Kvaser and TS Master). This shows that the failure is in the National Instruments SEND functionality, either hardware and/or software. I am using LabVIEW 17.0 32-bit. It seems odd that such a simple and basic function does not work. Any ideas? Thanks.

0 Kudos
Message 4 of 7
(862 Views)

Are you using the example I provided 12 years ago? I have no idea if that example still works, I haven't worked with LabVIEW in the past 5 years (although I'm still doing a lot of work with CAN, on microcontrollers). Is there any error output from the NI send/write function? Can you connect a scope to CAN H/L and see if any data is transmitted? What are you using to monitor the bus, to see that transmits are not working?

0 Kudos
Message 5 of 7
(858 Views)

Thanks for your instant response. I did not expect that with such an old post. I will work on the instrumentation you suggested. However, it may be a few days before I have results. I need to check out a scope from the tool crib. I have a short vacation starting tomorrow. Yes, I am using the 12 year old example. The error output on the probe is "{status => False, code => 0, source => ""}". Again, thanks for your help.

0 Kudos
Message 6 of 7
(853 Views)

The problem is with CAN extended addressing. The NI USB 8474 uses a custom additional code in the arbitration identifier for extended addressing. All addresses must include 0x20000000 in the address. The issue is resolved when using the correct extended addressing. See the following knowledge base article: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YHjzCAG&l=en-US

 

0 Kudos
Message 7 of 7
(797 Views)