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?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
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.