CAN Decoder Program
PURPOSE -
The CAN Decoder program is for use with Norm's
CAN-View product on a Toyota Prius.
Once you capture CAN data from CAN-View's serial port you need a way to decode it.
HOW IT WORKS - This program converts a binary file of RAW CAN data to a CSV
text file that can be loaded into a spreadsheet program such as Excel. It searches
for recognizable CAN data packets and decodes particular data bytes within those packets.
Decoding it based on information provided by
Attila's spreadsheet
and Norm's web page.
Graphs can then be created in Excel to examine certain parameters from the captured CAN data.
The program converts data into more useful units when those are known (ie: it converts SOC from
a 1/2% count into a decimal percentage)
USAGE - The program has no user interface (hey - you get what you pay for).
It simply looks for a file called test_raw.bin in the folder where the program is running,
reads the binary data from that file and creates a file called test_raw.csv in the same folder.
Each time you want to run it with a different data file you must put the data file into the folder
with the executable, rename it test_raw.bin and then run the program. (Not very convenient, but
not that hard either)
The following options may be specified on the command line if the program is started from a .bat
file or from DOS command prompt. If you want to see all the CAN packets in hex, for example, use the -d
switch and redirect the stderr output to a file (ie: "CAN_decoder -d 2> decode.log")
Here are the command line options:
- -US specifies US units (converts temps to F, speeds to MPH) (default is metric)
- -v specifies verbose output (annotates which bytes are decoded/skipped in the binary data)
- -d gives you a dump of all CAN packet contents in hex (to stderr)
- -D gives you the raw decimal values of all CAN packet fields as they are decoded (to stderr)
- input_file - optional, if not provided it will use "test_raw.bin"
- output_file - optional, if not provided it will use the inputfile name with .csv suffix
COLLECTING DATA - Click here
to learn how to collect the CAN data from CAN-View into a
binary data file suitable for using as input to this program.
DOWNLOAD (updated May 17, 2006)
CSV FILE -
The columns in the CSV file contain the following items (this may change as new versions are released)
You can download a sample file produced by the program taken from actually
driving the Prius.
- Time
- Elapsed time (seconds)
- Voltage
- HV Battery Voltage (volts)
- SOC %
- State Of Charge of the HV Battery Note: resolution 0.5%
- Amps
- Current to/from the HV Battery (amps)
Note: +values=charging, -values=discharging, resolution 0.1 amps
- Max Charge Current
- Charge limit for HV Battery (amps)
- Max Discharge Current
- Discharge limit for HV Battery (amps)
- Min Battery Temp C
- Temp of the coolest battery module (°C or °F)
- Max Battery Temp C
- Temp of the warmest battery module (°C or °F)
- Speed (km/h)
- Vehicle speed (km/h or mph) (high resolution, unsigned)
- Speedometer
- Speedometer reading (km/h or mph)
- Speed Related
- Speed related value (from 0x244 bytes 4-5) (units unknown)
- FL Wheel
- Front Left Wheel Speed (km/h or mph, resolution 0.01)
- FR Wheel
- Front Right Wheel Speed (km/h or mph, resolution 0.01)
- RL Wheel
- Rear Left Wheel Speed (km/h or mph, resolution 0.01)
- RR Wheel
- Rear Right Wheel Speed (km/h or mph, resolution 0.01)
- ICE RPM
- RPM of ICE
- ICE Temp C
- Temperature (°C or °F)
- Coolant Temp C
- Temperature °(C or °F)
- Side Accel
- Sideways accelerometer (Yaw rate sensor?) (range -512..+512)
Note: 0=neutral, +values=right pointing force(left turn), -values=left pointing force(right turn)
- Side Accel2
- Sideways accelerometer data unknown (range -512..+512) (from 0x22 bytes 2-3)
- Fwd Accel?
- Forward? accelerometer (range -512..+512)
Note: 0=neutral, +values=acceleration, -values=deceleration
- Fwd Accel2
- Forward? accelerometer data unknown (range -512..+512) (from 0x23 bytes 2-3)
- Steering
- Steering wheel position (range -500..+500 approx)
Note: 0=neutral, +values=left turn, -values=right turn
- Gas Pedal
- Gas pedal position (range 0..200)
- Brake Pedal
- Brake pedal position (range 0..127)
- Brake Pressed
- Brake pedal pressed (range 0..1)
Note: 0=not pressed, 1=pressed
- Shifter
- P=-2, R=-1, N=0, D=1, B=2
- EV Mode
- Values are: "N" (normal), "EV", "Cancel", "Denied"
- Fuel Inj
- Fuel Injection (units unknown)
- Fuel Flow
- Fuel Flow (units unknown)
- VVTi
- Valve or Ignition? Timing (units unknown)
- Gas Gauge
- Gas Gauge (range 0..40)
- Cruise Control
- Off=0, On=1
- Lights
- Off=0, Parking=1, Headlights=2, High Beams=3
Acronyms
- CAN
- Controller Area Network
- CSV
- Comma Separated Values
- EV
- Electric Vehicle
- HV
- High Voltage
- ICE
- Internal Combustion Engine
- km/h
- kilometers per hour
- RPM
- Revolutions per Minute
- SOC
- State of Charge
- VVTi
- Variable Valve Timing intelligent
CAN Decoder / 06-04-23 / mggm.net /
webmaster@mggm.net