Notices
Australia/New Zealand Forum They come from The Land Down Under.

Connect to OBD-II codes!!!

Thread Tools
 
Search this Thread
 
Rate Thread
 
Old 01-04-2004, 06:28 AM
  #1  
Kas
- Senior Menber -
Thread Starter
 
Kas's Avatar
 
Join Date: Aug 2003
Location: Melbourne,AU
Posts: 556
Likes: 0
Received 0 Likes on 0 Posts
Connect to OBD-II codes!!!

Hey Guy's

Here is a list of standard vars that you may be looking for whilst working with OBD-II interfaces. I hope it helps.

Its taken for a bunch of .c code

static int reset_chip_proc(int msg, DIALOG *d, int c);
static int options_proc(int msg, DIALOG *d, int c);
static int page_flipper_proc(int msg, DIALOG *d, int c);
static int sensor_proc(int msg, DIALOG *d, int c);
static int toggle_proc(int msg, DIALOG *d, int c);
static int toggle_all_proc(int msg, DIALOG *d, int c);
static int status_proc(int msg, DIALOG *d, int c);
static int page_number_proc(int msg, DIALOG *d, int c);
static int inst_refresh_rate_proc(int msg, DIALOG *d, int c);
static int avg_refresh_rate_proc(int msg, DIALOG *d, int c);
static int page_updn_handler_proc(int msg, DIALOG *d, int c);

// Sensor formulae:
static void throttle_position_formula(int data, char *buf); // Page 1
static void engine_rpm_formula(int data, char *buf);
static void vehicle_speed_formula(int data, char *buf);
static void engine_load_formula(int data, char *buf);
static void timing_advance_formula(int data, char *buf);
static void intake_pressure_formula(int data, char *buf);
static void air_flow_rate_formula(int data, char *buf);
static void fuel_system1_status_formula(int data, char *buf);
static void fuel_system2_status_formula(int data, char *buf);
static void short_term_fuel_trim1_formula(int data, char *buf); // Page 2
static void long_term_fuel_trim1_formula(int data, char *buf);
static void short_term_fuel_trim2_formula(int data, char *buf);
static void long_term_fuel_trim2_formula(int data, char *buf);
static void intake_air_temp_formula(int data, char *buf);
static void coolant_temp_formula(int data, char *buf);
static void fuel_pressure_formula(int data, char *buf);
static void secondary_air_status_formula(int data, char *buf);
static void pto_status_formula(int data, char *buf);
static void o2_b1_s1_formula(int data, char *buf);
static void o2_b1_s2_formula(int data, char *buf);
static void o2_b1_s3_formula(int data, char *buf);
static void o2_b1_s4_formula(int data, char *buf);
static void o2_b2_s1_formula(int data, char *buf);
static void o2_b2_s2_formula(int data, char *buf);
static void o2_b2_s3_formula(int data, char *buf);
static void o2_b2_s4_formula(int data, char *buf);
static void obd_requirements_formula(int data, char *buf);

static int device_connected = FALSE;
static int reset_hardware = TRUE;
static int num_of_sensors = 0;
static int num_of_disabled_sensors = 0;
static int sensors_on_page = 0;
static int current_page = 0;

static float inst_refresh_rate = 0; // instantaneous refresh rate
static float avg_refresh_rate = 0; // average refresh rate

volatile int refresh_time; // time between sensor updates

static SENSOR sensors[] =
{
// Page 1
{ throttle_position_formula, "Absolute Throttle Position:", "", "0111", 1 },
{ engine_rpm_formula, "Engine RPM:", "", "010C", 1 },
{ vehicle_speed_formula, "Vehicle Speed:", "", "010D", 1 },
{ engine_load_formula, "Calculated Load Value:", "", "0104", 1 },
{ timing_advance_formula, "Timing Advance:", "", "010E", 1 },
{ intake_pressure_formula, "Intake Manifold Pressure:", "", "010B", 1 },
{ air_flow_rate_formula, "Air Flow Rate (MAF sensor):", "", "0110", 1 },
{ fuel_system1_status_formula, "Fuel System 1 Status:", "", "0103", 1 },
{ fuel_system2_status_formula, "Fuel System 2 Status:", "", "0103", 1 },
// Page 2
{ short_term_fuel_trim1_formula, "Short Term Fuel Trim (Bank 1):", "", "0106", 1 },
{ long_term_fuel_trim1_formula, "Long Term Fuel Trim (Bank 1):", "", "0107", 1 },
{ short_term_fuel_trim2_formula, "Short Term Fuel Trim (Bank 2):", "", "0108", 1 },
{ long_term_fuel_trim2_formula, "Long Term Fuel Trim (Bank 2):", "", "0109", 1 },
{ intake_air_temp_formula, "Intake Air Temperature:", "", "010F", 1 },
{ coolant_temp_formula, "Coolant Temperature:", "", "0105", 1 },
{ fuel_pressure_formula, "Fuel Pressure (gauge):", "", "010A", 1 },
{ secondary_air_status_formula, "Secondary air status:", "", "0112", 1 },
{ pto_status_formula, "Power Take-Off Status:", "", "011E", 1 },
// Page 3
{ o2_b1_s1_formula, "O2 Sensor 1, Bank 1:", "", "0114", 1 },
{ o2_b1_s2_formula, "O2 Sensor 2, Bank 1:", "", "0115", 1 },
{ o2_b1_s3_formula, "O2 Sensor 3, Bank 1:", "", "0116", 1 },
{ o2_b1_s4_formula, "O2 Sensor 4, Bank 1:", "", "0117", 1 },
{ o2_b2_s1_formula, "O2 Sensor 1, Bank 2:", "", "0118", 1 },
{ o2_b2_s2_formula, "O2 Sensor 2, Bank 2:", "", "0119", 1 },
{ o2_b2_s3_formula, "O2 Sensor 3, Bank 2:", "", "011A", 1 },
{ o2_b2_s4_formula, "O2 Sensor 4, Bank 2:", "", "011B", 1 },
{ obd_requirements_formula, "OBD conforms to:", "", "011C", 1 },
{ NULL, "", "", "", 0 }
};

DIALOG sensor_dialog[] =
{
/* (proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3) */
{ d_clear_proc, 0, 0, 0, 0, 0, C_WHITE, 0, 0, 0, 0, NULL, NULL, NULL },
{ page_updn_handler_proc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL },
{ d_shadow_box_proc, 40, 20, 560, 56, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ d_rtext_proc, 50, 25, 96, 20, C_BLACK, C_TRANSP, 0, 0, 0, 0, "Port Status:", NULL, NULL },
{ status_proc, 180, 25, 300, 20, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ reset_chip_proc, 490, 28, 100, 40, C_BLACK, C_GREEN, 'r', D_EXIT, 0, 0, "&Reset Chip", NULL, NULL },
{ d_rtext_proc, 50, 51, 96, 20, C_BLACK, C_TRANSP, 0, 0, 0, 0, "Refresh rate:", NULL, NULL },
{ inst_refresh_rate_proc, 160, 51, 175, 20, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ avg_refresh_rate_proc, 335, 51, 150, 20, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ d_box_proc, 40, 87, 560, 32, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ toggle_proc, 45, 91, 45, 24, C_BLACK, C_WHITE, 0, D_EXIT, 0, 0, NULL, NULL, NULL },
{ sensor_proc, 95, 94, 504, 24, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ d_box_proc, 40, 123, 560, 32, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ toggle_proc, 45, 127, 45, 24, C_BLACK, C_WHITE, 0, D_EXIT, 1, 0, NULL, NULL, NULL },
{ sensor_proc, 95, 130, 504, 24, C_BLACK, C_LIGHT_GRAY, 0, 0, 1, 0, NULL, NULL, NULL },
{ d_box_proc, 40, 159, 560, 32, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ toggle_proc, 45, 163, 45, 24, C_BLACK, C_WHITE, 0, D_EXIT, 2, 0, NULL, NULL, NULL },
{ sensor_proc, 95, 166, 504, 24, C_BLACK, C_LIGHT_GRAY, 0, 0, 2, 0, NULL, NULL, NULL },
{ d_box_proc, 40, 195, 560, 32, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ toggle_proc, 45, 199, 45, 24, C_BLACK, C_WHITE, 0, D_EXIT, 3, 0, NULL, NULL, NULL },
{ sensor_proc, 95, 202, 504, 24, C_BLACK, C_LIGHT_GRAY, 0, 0, 3, 0, NULL, NULL, NULL },
{ d_box_proc, 40, 231, 560, 32, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ toggle_proc, 45, 235, 45, 24, C_BLACK, C_WHITE, 0, D_EXIT, 4, 0, NULL, NULL, NULL },
{ sensor_proc, 95, 238, 504, 24, C_BLACK, C_LIGHT_GRAY, 0, 0, 4, 0, NULL, NULL, NULL },
{ d_box_proc, 40, 267, 560, 32, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ toggle_proc, 45, 271, 45, 24, C_BLACK, C_WHITE, 0, D_EXIT, 5, 0, NULL, NULL, NULL },
{ sensor_proc, 95, 274, 504, 24, C_BLACK, C_LIGHT_GRAY, 0, 0, 5, 0, NULL, NULL, NULL },
{ d_box_proc, 40, 303, 560, 32, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ toggle_proc, 45, 307, 45, 24, C_BLACK, C_WHITE, 0, D_EXIT, 6, 0, NULL, NULL, NULL },
{ sensor_proc, 95, 310, 504, 24, C_BLACK, C_LIGHT_GRAY, 0, 0, 6, 0, NULL, NULL, NULL },
{ d_box_proc, 40, 339, 560, 32, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ toggle_proc, 45, 343, 45, 24, C_BLACK, C_WHITE, 0, D_EXIT, 7, 0, NULL, NULL, NULL },
{ sensor_proc, 95, 346, 504, 24, C_BLACK, C_LIGHT_GRAY, 0, 0, 7, 0, NULL, NULL, NULL },
{ d_box_proc, 40, 375, 560, 32, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ toggle_proc, 45, 379, 45, 24, C_BLACK, C_WHITE, 0, D_EXIT, 8, 0, NULL, NULL, NULL },
{ sensor_proc, 95, 382, 504, 24, C_BLACK, C_LIGHT_GRAY, 0, 0, 8, 0, NULL, NULL, NULL },
{ toggle_all_proc, 40, 420, 100, 40, C_BLACK, C_DARK_YELLOW, 'a', D_EXIT, 0, 0, "&All ON", NULL, NULL },
{ options_proc, 150, 420, 100, 40, C_BLACK, C_GREEN, 'o', D_EXIT, 0, 0, "&Options", NULL, NULL },
{ d_shadow_box_proc, 260, 420, 230, 40, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ d_button_proc, 500, 420, 100, 40, C_BLACK, C_DARK_YELLOW, 'm', D_EXIT, 0, 0, "&Main Menu", NULL, NULL },
{ d_ctext_proc, 300, 422, 38, 20, C_BLACK, C_TRANSP, 0, 0, 0, 0, "Page", NULL, NULL },
{ page_flipper_proc, 340, 425, 75, 30, C_BLACK, C_DARK_YELLOW, 'p', D_EXIT, -1, 0, "&Previous", NULL, NULL },
{ page_flipper_proc, 425, 425, 55, 30, C_BLACK, C_GREEN, 'x', D_EXIT, 1, 0, "Ne&xt", NULL, NULL },
{ page_number_proc, 300, 440, 36, 18, C_BLACK, C_LIGHT_GRAY, 0, 0, 0, 0, NULL, NULL, NULL },
{ NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL }
};
Old 01-04-2004, 06:34 AM
  #2  
Banned
 
Lock & Load's Avatar
 
Join Date: Mar 2003
Location: Gold Coast Australia
Posts: 3,535
Likes: 0
Received 2 Likes on 2 Posts
Talking

Kas

hmmmm WTF IS THAT .
Old 01-04-2004, 06:52 AM
  #3  
Kas
- Senior Menber -
Thread Starter
 
Kas's Avatar
 
Join Date: Aug 2003
Location: Melbourne,AU
Posts: 556
Likes: 0
Received 0 Likes on 0 Posts
its what you'd need to know if you were to connect to your cars OBD-II using your own software/code.
Old 01-04-2004, 12:50 PM
  #4  
Race Steward
iTrader: (1)
 
Hymee's Avatar
 
Join Date: Aug 2003
Location: Brisbane, Australia
Posts: 5,430
Likes: 0
Received 2 Likes on 2 Posts
Thanks KAS.

L&L will be able to do something with that!

The only slightly useful info there is some of the PID's and service number for SOME of the ODBII messages, as defined in J1979.

Example:-

{ engine_rpm_formula, "Engine RPM:", "", "010C", 1 }

The engine RPM can be read from Service "01" via PID "0C". But there is also specs on how the response message is to be deciphered, and how the units are to be interpreted.

The full SAE J1979 spec is 159 pages long, and costs $80 to purchase.

Be carefull about respecting peoples intellectual property when posting code. Even if it is in the public domain already, they normally have some clause about acknowledging the source.

Cheers,
Hymee.
Old 01-04-2004, 01:26 PM
  #5  
Banned
 
Lock & Load's Avatar
 
Join Date: Mar 2003
Location: Gold Coast Australia
Posts: 3,535
Likes: 0
Received 2 Likes on 2 Posts
Talking

HYMEE

Thanks for acknowledging my non skills in softwear programing , man i really admire the guys who work on these things .

My programing is still a very basic cave man type of system .

I see a good looking lady my sensor are activated , a message is sent to the brain which activates my predatory sexual instincts and the rest is history .

Taking a drive to springbrook the phothoes i took of our trip have been developed .

Being the nice guy i am i spoke to my favourite waitress in springbrook and she suggested that instead of mailing it i should drive past and deliver them .

How could i say no???

She asked about you guys i told her DAN has been posted overseas with his work for at least a couple of years ,HA.HA.HA. and you are on holidays with your family .

PS :For those of you who may go Grrrrr Lounge there is an encrypted message in my post relating to the OBDII MESSAGES.

example service wa 69---fem --rpm enter (----) exit . formula

Cheers

michael
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Shankapotamus3
Series I Trouble Shooting
28
03-14-2021 03:53 PM
fourwhls
RX-8's For Sale/Wanted
7
02-20-2019 05:16 PM
Evan Gray
Series I Trouble Shooting
4
11-24-2015 01:00 AM
archon
RX-8 Parts For Sale/Wanted
3
10-01-2015 06:08 AM
Eliseo Esquivel
RX-8 Discussion
2
09-30-2015 08:28 PM



You have already rated this thread Rating: Thread Rating: 0 votes,  average.

Quick Reply: Connect to OBD-II codes!!!



All times are GMT -5. The time now is 07:14 AM.