Showing results for 
Search instead for 
Did you mean: 

Talking to a ECU

We are getting our first series 3 engine in about a month to start testing.   We have a current program written in LabView that we use for our current engine but the person who wrote that program has left and I have been tasked with updating it or creating a new program for the new engine.


I'm about half way through a LabView for beginners book and I don't think creating the program is going to be hard but I have a few question about talking to the ECU on the engine.


What I think I know, is I have to access files on the ECU to send and receive data. And in order to access those files I need those file names correct?


I'm guessing my best bet is to get a list of the files and what they are for from the ECU manufacturer correct?  If I'm not able to get them from the manufacturer, can I use LabView to search for the files that are there and get a list of their names?


Also, I'm under the impression that the data that is sent, is sent in the form of an A2L file over the CAN using XCP standard Protocol.  

If that is correct, do I need to tell LabView its wants to create the A2L files or does it do that itself and I just need to tell it what file to send it to? 


Thanks for any help!!!

0 Kudos
Message 1 of 5



Could you confirm which of the Automotive Protocols listed on the document below is used by the ECU?



National Instruments Support for Automotive Standards:



Message 2 of 5

EDIT:  Okay you did mention A2L sorry I missed that the first time through.  I'm still leaving my full reply but you definitely want the ECU Measurement and Calibration Toolkit.  Download an evaluation and checkout some examples.


Saying you want to talk to an ECU is like saying you want to talk to a person.  There are literally dozens of various standards, protocols, and hardware/software interfaces.  The majority of OEMs follow a couple of the standards, but more information is needed to know how to best help.


You haven't mentioned it yet but I'm going to assume you want to talk to the ECU using CAN.  Other options which are less likely are LIN, FlexRay, JTAG, Serial, UART, I2C, and SPI.  If you are using CAN you are likely using the dual wire high speed version.  Other options are low speed, and single wire.  If you are using the high speed CAN you are likely using 500K baud, but again many other options exist including CAN-FD which is relatively new.  All of these are just assumptions that you'll need to confirm.  Most of this is covered in my CAN blog Part 1.


If my assumptions are right, you'll probably want an NI XNet card, with the cheapest and easiest being the single port USB-8502.  Now that we have the hardware taken care of what about the software?


If you have a .DBC file then you just need the XNet drivers (free to download) and play around with the tutorials.  This will communicate using a signal API where the DBC will define things like engineering units so reading and writing signals are based on a name value pair.  Things like "Engine Speed" will be read as a double in RPM if they are defined in the DBC file.  My blog post Part 5 talks about Signals and how they are made up of frames discussed in Part 2.


But what if you don't have a DBC but instead have an .A2L file?  Well then you are dealing with an XCP or CCP protocol and will want to download an evaluation of the ECU Measurement and Calibration Toolkit.  This toolkit is just a software layer that could be re-written in LabVIEW that uses the same hardware.  What if you don't have a DBC, or A2L but have a CDD?  Then you'll want to look into the Automotive Diagnostic Command Set.  This is also a software wrapper around the ISO 15765 protocol and I cover this in Part 8.


People spend their whole careers on CAN itself.  It is a very large topic.  Luckily each of the toolkits (and XNet) come with installed examples showing how to get started.  Turning these examples into a full application is up to you.

Message 3 of 5

Ok this is starting to make sense.  I will read those blogs after this.

We are using a High CAN and XCP Standard Protocol.

Currently we are using USB-8473 but we are going to switch to USB-8502 for this next series.

The ECU Measurement and Calibration ToolKit......  You are saying I can write this myself (or something like it) using LabView correct?

That picture is all starting to make sense now.

I need to figure out the XCP Protocol, A2L Files.

I'll start by reading your blogs. 



0 Kudos
Message 4 of 5

@aaronb50 wrote:


The ECU Measurement and Calibration ToolKit......  You are saying I can write this myself (or something like it) using LabView correct?


You can but for the amount of effort involved, it is likely easier to just pay NI, or at least try out the free evaluation and see if it meets your needs.  Re-writing that in G is one of the things I've wanted to do but haven't got time.  I have already re-written the other toolkit (Automotive Diagnostic Command Set) is something I have done and was a great learning experience.

0 Kudos
Message 5 of 5