<?xml version="1.0" encoding="utf-8"?>
<!--
RealDash OBD2 communication description file.
Requires RealDash version 1.5.8 or newer
-->
<OBD2>
  <init>
    <!-- after first init command is sent, RealDash reads whatever data comes from serial during next 1500ms.
         This is done to purge the serial buffers. -->
    <!-- do not remove 'atl0', 'ate0', or 'ats0' commands. Those settings are assumed when parsing the
         reply from adapter. -->
    <command send="atd"></command>
    <command send="atz"></command>
    <command send="atat1"></command>
    <command send="atst62"></command>
    <command send="atsp0"></command>
    <command send="ate0"></command>
    <command send="atl0"></command>
    <command send="ats0"></command>
    <command send="ath1"></command>
    <command send="atdpn"></command>
    <command send="0100"></command>
    <command send="0120"></command>
  </init>

  <!-- 'send' command to send to OBD2 adapter -->
  <!-- 'targetId' links value to RealDash input, see realdash.net/manuals/targetid.php for a complete list -->
  <!-- OR -->
  <!-- 'name' links value to RealDash input, if name is unknown to RealDash, input appears in 'ECU Specific' input category -->
  <!-- 'skipCount' number of skips in rotation for that value. Higher the value less frequently its read -->
  <!-- 'units' optional info only for automatic unit conversion system. "C","F","km/h","mph","bar","psi","bit".
       If units="bit", RealDash always checks the lowest bit as of value on or off. Therefore the bitshift to the right on
       conversion, for example conversion="(V>>1)" will read second bit on incoming value -->
  <!-- 'header' sets OBD2 header for this command. The full AT command to set the header must be included.
       Note that header is not reset automatically on next command, so usually when header is in use it has to be set to all commands.
       If all commands use same header, its best to be placed in 'init' section.
       Examples:
       header="ATSH685AF1"
       header="ATSHDA10F1" -->
  <!-- 'conversion' if omitted, value is read 'as-is'. Otherwise variables 'B0', 'B1', 'B2', 'B3', 'V' and 'ID#' can be used within
       conversion formula, for example:
       conversion="V/10" - result is incoming value / 10
       conversion="B0+15*(B1-43)" - result is 'first byte + 15 * (second byte - 43)
       conversion="V+ID200-74.3" - result is incoming value + 'Body Electronics->Gear' - 74.3 -->
  <!-- From RealDash version 1.6.6, 'conversionABC' is an option to 'conversion' and uses A,B,C,...AA,AB,AC,...,etc format to distinquish the veriables on the reply.
       This makes it easier to convert the Equation from other apps.
       Example: conversion="B0+15*(B1-43)" and conversionABC="A+15*(B-43)" are the same -->

  <rotation>
    <command send="0101" skipCount="100" name="DTC Byte 1" conversion="B0"></command> <!-- number of DTCs -->
    <command send="0101" skipCount="100" name="DTC Byte 2" conversion="B1"></command>
    <command send="0101" skipCount="100" name="DTC Byte 3" conversion="B2"></command>
    <command send="0101" skipCount="100" name="DTC Byte 4" conversion="B3"></command>
    <command send="0103" skipCount="3" name="OBD2: Fuel System Status Text" conversion="B0" enum="0:Off,1:Open Loop,2:Normal,4:Fuel Cut/Load,8:System Failure,16:Feedback Failure,#:error"></command>
    <command send="0103" skipCount="3" name="OBD2: Fuel System" conversion="B0"></command>  
    <command send="0104" skipCount="3" targetId="100" conversion="0.85*(B0/255)^0.5"></command> <!-- engine load -->
    <command send="0105" skipCount="19" targetId="14" units="C" conversion="V-40"></command> <!-- clt -->
    <command send="0106" skipCount="3" targetId="17" conversion="B0/1.28-100"></command> <!-- short trim bank 1 -->
    <command send="0107" skipCount="200" targetId="102" conversion="B0/1.28-100"></command> <!-- long trim bank 1 -->
    <command send="0108" skipCount="3" targetId="18" conversion="V/1.28-100"></command> <!-- short trim bank 2 -->
    <command send="0109" skipCount="200" targetId="104" conversion="V/1.28-100"></command> <!-- long trim bank 2 -->	
    <command send="010a" skipCount="10" targetId="105" conversion="V*3"></command> <!-- fuel pressure -->
    <command send="010b" skipCount="1" targetId="31" conversion="V"></command> <!-- map -->
    <command send="010c" skipCount="0" targetId="37" conversion="V/4"></command> <!-- rpm -->
    <command send="010d" skipCount="0" targetId="81" conversion="B0*1.05" units="km/h"></command> <!-- speed -->
    <command send="010e" skipCount="3" targetId="38" conversion="64-B0/2"></command> <!-- spark adv -->
    <command send="010f" skipCount="7" targetId="27" units="C" conversion="V-40"></command> <!-- iat -->
    <command send="0111" skipCount="3" targetId="42" conversion="(B0/2.55)+5.0"></command> <!-- tps -->
    <command send="0114" skipCount="3" targetId="0" conversion="B0/200"></command> <!-- o2 1-8 --> 
    <command send="0114" skipCount="7" name="OBD2: O2 Voltage 1" conversion="B0/200"></command> <!-- o2 volt -->
    <command send="0115" skipCount="3" targetId="1" conversion="B0/200"></command> <!-- o2 1-8 --> 
    <command send="0115" skipCount="7" name="OBD2: O2 Voltage 2" conversion="B0/200"></command> <!-- o2 volt -->
    <command send="011c" skipCount="1000" name="OBD standards this vehicle conforms to"></command> <!--  -->
    <command send="011f" skipCount="4" targetId="33"></command> <!-- engine runtime -->
    <command send="0121" skipCount="200" name="OBD2: Distance traveled with malfunction indicator lamp on" conversion="256*B0+B1"></command>
    <command send="012e" skipCount="10" name="OBD2: Evaporative Purge" conversion="2.55*B0"></command>
	<command send="012f" skipCount="300" name="OBD2: Fuel Level" conversion="V/2.55"></command> <!-- fuel level -->
    <command send="0130" skipCount="20" name="OBD2: Warm-ups since codes cleared" conversion="B0"></command>
    <command send="0131" skipCount="100" name="OBD2: Distance traveled since codes cleared" conversion="256*B0+B1"></command>
    <command send="0133" skipCount="100" targetId="11"></command> <!-- baro -->
    <command send="013c" skipCount="19" name="OBD2: Catalyst Temperature: Bank 1, Sensor 1" conversion="(256*B0+B1)/10-40"></command> <!-- cat temp -->
    <command send="0142" skipCount="7" name="OBD2: Control Module Voltage" conversion="(256*B0+B1)/1000"></command> 
    <command send="0143" skipCount="7" name="OBD2: Absolute Load Value" conversion="(256*B0+B1)/2.55"></command>
    <command send="0145" skipCount="7" name="OBD2: Relative Throttle Position" conversion="B0/2.55"></command>
    <command send="0146" skipCount="200" targetId="119" units="C" conversion="V-40"></command> <!-- ambient air temp -->
             
    <command send="atrv" skipCount="7" targetId="12"></command> <!-- voltage -->   
    <command send="015c" skipCount="19" targetId="152" units="C" conversion="V-40"></command> <!-- engine oil temp -->
  </rotation>
</OBD2>
