Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Going to Labview USB-8502 from Canalyzer

Solved!
Go to solution

Hi,

 

I am fairly new to the CAN interface. Our product uses CAN to communicate between processor boards and we use Canalyzer to view that information, set and read values, etc. It works great for this.

 

However, I need to automate some board testing and using Canalyzer is a very manual process. I am looking at the USB-8502 but finding very limited information. I just would like to know the following from some of the seasoned CAN people out there...

 

Is the USB-8502 a capable device for interfacing with CANbus?

Will it work with Labview 2013? I believe it uses MAX but is there other added software involved?

Will I be to access the information that I do in Canalyzer? (I realize that I need to build the Vi's)

 

Sorry if the questions are so general, but this is fairly new to me. Before I buy and start learning, I want to make sure I have the right hardware.

 

Thanks!

 

0 Kudos
Message 1 of 25
(7,019 Views)

First lets answer the questions as they are asked:

 


@Korpz wrote:

 

Is the USB-8502 a capable device for interfacing with CANbus?

Will it work with Labview 2013? I believe it uses MAX but is there other added software involved? 


Yes the USB-8502 interfaces with the most common CAN bus you'll see which is high speed dual wire CAN.  Here is Part 1 of my blog post talking about the different hardware options for CAN and how they are wired.

 

XNet 2017 supports LabVIEW 2014 and newer, and XNet 2016 supports LabVIEW 2013 and newer.  Unfortunately the 8502 is a new piece of hardware and support for it was added in 2017.  So this means the oldest version you can use this hardware with (ignoring compatibility mode because it is old and shouldn't be used) is LabVIEW 2014, sorry.  If you install LabVIEW 2013, and XNet 2017 you will have your hardware show up in MAX and you will be able to use the bus monitor software built into it, but it is very lacking and not a CANalyzer replacement.  It is intended to test out the hardware at the most basic level before writing software for it.  But the API will not be available on the palette in LabVIEW 2013.

 


@Korpz wrote:

 

Will I be to access the information that I do in Canalyzer? (I realize that I need to build the Vi's) 


Yes but there are caviots.  Are you a software developer?  Because LabVIEW is a programming language and trying to replicate some of the features of CANalyzer could take an experienced software developer some time.  There are plenty of toolkits made to help assist in making the software development process easier but at the end of the day throwing down a few block and having it work is not going to cut it when you need to troubleshoot and issue and don't understand how it worked in the first place.

 

Before taking on any LabVIEW challenge like this I hightly suggest taking some LabVIEW training (free if possible)  Here is a wall of resources.

 

 

NI Learning Center

NI Getting Started

-Hardware Basics

-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)

-LabVEW Basics

-DAQ Application Tutorials

-cRIO Developer's Guide 

Learn NI Training Resource Videos

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required

 

After that I highly recommend reading up on what CAN even is, and how it works.  I have a 9 Part blog series starting here.  Other than talking about the hardware it talks about the low level frames, how to use the XNet API, converting frames into signals (the engineering units you likely care about in CANalyzer), several advanced XNet techniques, logging (particularly into a file CANalyzer can playback and anaylze), and a few protocols.

 

Is all of this necessary for you task?  Probably not but if you can absorb all of this you shouldn't have too much difficulty.  You haven't said what your requirements are and XNet makes some things pretty easy.  If you just need to read or write signals, and don't have database changes you can import it, and use the XNet Read/Write functions.  There are shipping examples showing the basics.

0 Kudos
Message 2 of 25
(6,992 Views)

Thank you very much for the great information. I really appreciate it. I will definitely read your blog.

 

I am a Manufacturing Engineer. I have been using Labview for years in my field so I have quite a bit of experience with it in high and low volume manufacturing. I code in other languages too but I like Labview for the ease of use and nice GUI's. I am very familiar with MAX and like you said, only really used for testing hardware. I am new to CAN and only have been working with it for the last 5 months and I have to say there is A LOT to learn.

 

I am not sure upgrading at this time is an option. I am guessing I would have to go with legacy hardware and software at this point. I could go down the route of XNet 2016 but it doesn't look like there is a USB option. Am I correct?

 

Thanks for all the help,

Ryan

 

 

0 Kudos
Message 3 of 25
(6,982 Views)

For older USB CAN there are basically two options, both of which are pretty poor when compared to the modern USB XNet card you referenced.  

 

The cheap-o USB CAN option NI has had for years is the NI-8473.  It's something like $500, is a single high speed CAN device over USB.  It has no hardware re transmit feature, the buffer is quite small, and the API can be hard to work with since frame to signal conversion needs to happen on the software level.  Signal API conversion software can be found in Part 5 of my CAN Blog which uses XNet drivers but doesn't require XNet hardware.  This cheap little USB devices uses the NI-CAN API and you may find yourself doing lots of things in software, that XNet cards can do in hardware eating up precious resources, or causing data to be written with a decent amount of jitter.  Support for this card and NI-CAN in general has been on the decline for years and NI has been trying to get developers to move to the newer XNet hardware.  Both APIs are mentioned in Part 2.

 

Option 2 is something like a single slot cDAQ-9171 chassis, combined with a single slot XNet card like the NI-9862.  This is more expensive, but a bit more flexible.  You could repurpose that single slot chassis to use any cDAQ card for AIO/DIO LIN, or anything else.  The chassis come in 4 and 8 slot USB and ethernet options too, and with the right cards can have up to 2 CAN ports per slot with something like the NI-9860.

 

Beyond that there are non-NI options that just need drivers for reading and writing frames.  You will basically have a similar experience to the NI-CAN hardware and need to do most things in software with no hardware retransmit options.  I've provided drivers for Kvaser, Intrepid, and Vector drivers in Part 4 of my CAN blog.  These types of hardware won't have support for some of NI's extra CAN toolkits like Automotive Diagnostic Command Set, or ECU Measurement and Calibration.  But at the end of the day these are just sofware layers that can be re-written if necessary as I did for the ISO-15765 diagnostic command set in Part 8 of you guessed it...my CAN Blog.

 

Oh and sorry I didn't realize you had LabVIEW experience.  I read your first post with the idea that you had little if any programming experience which would make this task a very huge one.

0 Kudos
Message 4 of 25
(6,974 Views)
Solution
Accepted by topic author Korpz

Thank you again for all the information.......and sorry for the late response. You gave me a ton of great information and I appreciate that greatly. 

 

It looks like I will have to see if I can get an upgrade of Labview in the budget. In my opinion, it's either Professional or go home because App builder is a must.

 

It's looking like a $5,000+ investment. I believe the way to go is upgrading and using the USB-DAQ. I may have a few more questions along the way once I upgrade but I am definitely going to invest the time in your blog,

 

Take care,

Ryan

 

 

 

0 Kudos
Message 5 of 25
(6,962 Views)

Hi Hooovah,

 

It has been a while since this thread. I finally got a chance to read through your entire blog....very informative. It is great to see someone that offers such help to others trying to learn a new interface.

 

As we discussed early. I have access to Vector Canalyzer and the USB dongle. I read about how you said that the Vector Labview package is garbage. You cleaned up a Vector package but that is for 2015 and beyond. I have 2013 so I can't try it out with my current hardware.

 

Here is my question. We use CAN on our product. I have the DBC file for our product. Would it be best just to upgrade Labview and purchase the latest NI USB CAN device rather than using the Vector hardware with your VI package? My goal is simple. I need to simply the test process. I need to create Pass/Fail testing through CAN. Canalyzer is nice, but I need to create something for a production environment.

 

Canalyzer is twice the cost of the NI hardware. I believe the way to go is with the NI hardware. I think that having the DBC file makes everything much easier. I cannot say for sure, because my Labview version is old. 😞

 

Thanks for the advice,

Ryan

 

 

 

0 Kudos
Message 6 of 25
(6,640 Views)

Well the good news is I do have my package code back saved to 2012.  It isn't in package form, and as a result it is a manual process to install it.  You don't just double click a package and have VIPM take over.  That being said I think palettes and demos should all work. 

 

So first install all the normal OpenG packages through VIPM.  Things like Arrays, Strings, File I/O.  Then install XNet version 16 from here. (this is the newest version that supports LabVIEW 2013).  Then download my code here.  Then extract that zip to your LabVIEW install folder which will likely either be one of the following for you:

 

C:\Program Files (x86)\National Instruments\LabVIEW 2013

C:\Program Files\National Instruments\LabVIEW 2013

 

Then restart LabVIEW.  Now you should have a Hooovahh palette on your block diagram.  If you don't you still can open the Vector example at:

 

C:\Program Files (x86)\National Instruments\LabVIEW 2013\user.lib\_Hooovahh\CAN Drivers\Vector CAN Drivers\CAN\Example CAN Read Write_Driver.vi

 

This is a basic example for reading and writing frames with Vector hardware.

 

Now in addition to that it sounds like you need some frame to signal conversion so you can throw in a DBC and read/write those signals.  On the palette there should be a Basic Frame Signal Conversion Example, but again if the palettes don't work just open the following VI:

 

C:\Program Files (x86)\National Instruments\LabVIEW 2013\user.lib\_Hooovahh\CAN Frame Signal Conversion\Basic Frame Signal Conversion Example_Conversion.vi

 

This VI shows how to open a DBC, and take some signals with values, and turn them into frames.  This could then be written using the Vector example.  This conversion example also goes the other direction and can take a frame read from hardware, and turn them into the signals.

 

But you have to ask yourself, is all of this work worth it, or if it is a better idea to just buy NI XNet hardware?  The XNet stuff just works so well with LabVIEW, and all others have various toolkits that work okay but don't have the same features.  If you can afford new XNet hardware, you should probably go with that.  They have a decent 2 port USB XNet device, but support for it was only just added in XNet version 17, which only supports back to LabVIEW 2014.  The XNet API allows for importing DBCs, and doing reading/writing in a pretty straight forward way.  You can try out my software, and see how it goes.  If it meets your needs, great go with it.  If it seems like too much work look into XNet, and possibly upgrading your LabVIEW.

0 Kudos
Message 7 of 25
(6,631 Views)

Hi Hooovahh,

 

The other day I gave it a try. I appreciate the detailed instructions as I easily was able to install it and get the OpenG packages and your package installed. The only thing that doesn't work are a couple of the examples VI's. It looks like they are looking for a couple VI's that are called out in the XNET library. I have 2013 so it doesn't look like I will be able to resolve that. The stand alone VI's seem to be ok though from what I messed with.

 

I did however also download Labview 2017. I have yet to start the evaluation which gives me 7 days. I think I can extend it to 45 days though. I also installed the XNET package as well. I figure I can see what 2017 has to offer too. 

 

I am going to mess around with both but I believe the end result is going to be to use 2017 with the NI USB-8502 hardware. That seems to be the easiest and cleanest way to go. I just need to justify the $$$ at work which I should be able to do here soon. I am still in the process of learning CAN as there is so much to it. Your blog helps a bunch.

 

Thanks much!

Ryan

 

0 Kudos
Message 8 of 25
(6,584 Views)

Yeah sorry you just missed the cut off.  XNet version 17, which added support for the newest hardware, only supports LabVIEW version 2014 and newer.  So you could install XNet support for 2013, but it won't support your hardware because it needs to be an older version.  Obviously upgrading to 2017 would add to the cost of the project.  But getting more support from NI, and access to self-paced online training adds some value that maybe would help convince your boss.  There are of course other cool new features in 2014, 2015, 2016, and 2017 that could take advantage of but those are harder to sell to management.  

0 Kudos
Message 9 of 25
(6,572 Views)

I believe I will be able to justify this. There is not much of a choice when going toward volume manufacturing of product. I need to write diagnostics/tests that are simple and foolproof. Canalyzer is great for development, but when you have test technicians determining pass/fail, it just won't work.

 

In my past ventures, almost everything I have dealt with has been serial. With Labview it is easy......write, read, parse.....etc. CAN is totally new to me. Your blog helps a ton at comparing the two. While I know how to use Canalyzer on a limited basis to read what I need to know, I am still trying to grasp it all. I just need to wrap my head around how to write the proper VI's to open the DBC file and read want I need. I eventually need to also write, but one thing at a time.

 

I may have some questions a long the way........I see there are quite a few of examples available from NI.

 

 

Thanks,

Ryan

 

 

 

0 Kudos
Message 10 of 25
(6,564 Views)