LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing UDS protocol using sbRIO 9627

Hi All,

 

Is it possible to implement UDS protocol using CAN on sbRIO 9627? If yes then can I get example? I'm using LabVIEW 2016.

 

Thanks,

Shrinivas

0 Kudos
Message 1 of 8
(1,253 Views)

Yes it is possible UDS, and the ISO15765 layer is just a software layer on top of standard CAN with raw frame control.  NI suggests doing this with the Automotive Diagnostic Command Set (ADCS).  I had issues with this in the past, and wanted to use it with non-NI hardware but in LabVIEW.  So I re-wrote the ADCS in purge G.  Here is a blog post I made about how it works, the state machine it goes through, and some example code which demonstrates how it works on Vector, KVaser, and Intrepid hardware.  It obviously isn't a drop in solution for you, but you can look at the code, and understand how it write and reads data to perform the communication.

0 Kudos
Message 2 of 8
(1,234 Views)

Thanks a lot Hooovahh...I'll check..

0 Kudos
Message 3 of 8
(1,216 Views)

I gone through your blog (Part 1) where you mentioned the hardware. It doesn't list sbRIO 9627.  

0 Kudos
Message 4 of 8
(1,190 Views)

@kshrini wrote:

I gone through your blog (Part 1) where you mentioned the hardware. It doesn't list sbRIO 9627.  


Of course not. That is a very specific hardware. Also it depends a lot how you want to interface the library to the actual CAN hardware.

 

Brian's library has a number of hardware interface drivers underneath to support different CAN hardware dongles. But the Vector, KVaser, and Intrepid are AFAIK all USB dongle based interfaces (well Vector also has PCI, PC-104 and similar offerings but they can be connected even less to the sbRIO). The sbRIO-9627 is however an ARM based NI Linux RT system, so even if these manufcturers would provide Linux drivers for their hardware, they would need to be compiled for the ARM EABI that the NI Linux RT system uses which I'm pretty sure they won't support.

 

This will leave you with using the NI-XNET for the on board sbRIO-9627 CAN port. However it is not clear to me how that is exactly supported to be honest. The NI-XNET readme file is kind of unclear about this:

 

CompactRIO—CompactRIO 20.0 (or later) and LabVIEW 2017 (or later) are required for the following targets:
  • Single-Board RIO: sbRIO-9627, sbRIO-9607

But it is not clear if this applies also to the onboard CAN port or only to C series CAN modules connected to the board.

 

You would have to verify with NI technical support about that.

Rolf Kalbermatter
My Blog
Message 5 of 8
(1,176 Views)

Thanks Rolf. I can't have an exhaustive list of all CAN hardware that is supported in LabVIEW by all manufacturers.  New ones are made all the time and those manufacturers will give their own drivers for talking to it.  I was just trying to list the common ones, with XNet supported devices being my favorite because of their good integration in LabVIEW and multiple session types.

 

If you do ever get to where you can read and write raw frames, that's when you should take a look at the source code to the ISO15765 code I posted.  It is written in pure LabVIEW, and because of that it can work with any hardware, as long as you replace the pieces inside with the reading and writing of raw frames with the appropriate API.  Of course if you are using NI hardware then there might be support in NI's official toolkit that supports UDS which is the Automotive Diagnostic Command Set.  If you have confidence it will work you can download it as a trial.

0 Kudos
Message 6 of 8
(1,169 Views)

Hi Rolf,

 

Thanks for reply. As far as my knowledge if concerned, the NI-XNET supports C series CAN modules.

 

Shrinivas

0 Kudos
Message 7 of 8
(1,158 Views)

@kshrini wrote:

Hi Rolf,

 

Thanks for reply. As far as my knowledge if concerned, the NI-XNET supports C series CAN modules.


Yes it does, but connecting C series modules to an sbRIO is not straightforward. However most sbRIOs also have one or sometimes two onboard CAN interfaces if enabled in the CLIP one installs in an FPGA project and I have no idea if NI-XNET would support such an onboard CAN port too.

 

Actually it does not support them. You need NI- Embedded CAN for RIO for these ports. This is a separate API that is similar to the NI-XNET frame API. It only supports configuring the port and reading and writing raw frames. As such it would most likely work with Brians library if one develops a separate NI-Embedded CAN driver for it.

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 8
(1,142 Views)