Take the 2-minute tour ×
Motor Vehicle Maintenance & Repair Stack Exchange is a question and answer site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles. It's 100% free, no registration required.

I want to read/write CAN messages. I have MATLAB in my laptop which has a Vehicle Network Toolbox which supports reading/writing CAN messages. I have my hardware OBD-II to UART board, FTDI and OBD-ii cable. Please tell me how to get data from OBD-ii to MATLAB(Vehicle Network Toolbox). Is it supported?

share|improve this question
    
what OBD-II to UART board are you using? –  Nick Jan 26 at 19:24
    
Sparkfun manufactured. Im able to send general PIDs which can be viewed on hyperterminal on computer. But now i want to read CAN messages which will be regularly displayed through MATLAB's vehicle Network Toolbox. I want to how to set it up –  user3098378 Jan 27 at 10:46

1 Answer 1

CAN bus is actually a fairly complex protocol, similar to USB in many ways. However, your OBD-II to FTDI adapter is probably just implementing the OBD-II part of this protocol, which is pretty simple (after all, they are converting it to a serial interface).

Use the serial communication tools built into MATLAB to do this (e.g., to communicate ASCII to a serial port like COM1).

They could convert the OBD-II messages to serial in any number of ways, but the ELM327 chip family's method is by far the most common. For this the spec is here (http://elmelectronics.com/DSheets/ELM327DS.pdf), check out the section called "OBD commands". It is a very simple interface, you request a PID and it replies with the value.

share|improve this answer
    
I've obtained all the basic data like Speed, RPM etc through general PIDs/OBD Commands. I used hyperterminal on my laptop to view the returned data. But now i want to see the CAN messages. I got to know Vehicle Network Toolbox in MATLAB can read/write CAN data. So i want to know how to interface MATLAB with UART Board to view live CAN data. –  user3098378 Jan 27 at 10:50
    
@user3098378 You need more advanced hardware to do this. The protocol is called Unified Diagnostic Services. mathworks.com/products/vehicle-network/supported/… –  Nick Jan 27 at 12:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.