Enhanced GM Trouble Codes Driver revision 4 Example Function Calls for DATA ACQUISITION API v1.1


Version 4 Support for CAN network
Version 3 Adds enhanced GM trouble code requests with status for network servers, Tricom and TriCAN models
Version 2 Provides additional examples to DATA ACQUISITION API v1.1 specifications.
Copyright (C) 2001-2002 Keith Leinenbach Software as implemented for driver to model Blue Route and Tricom vehicle network routers with serial gateway by Alex Peper Car Code


www.obd-2.com/daqman.htm - DATA ACQUISITION API v1.1 manual date 04/02
www.obd-2.com/daq3.html - DATA ACQUISITION API v1.1 manual revision 3 date 11-18-04
www.obd-2.com/daq.html - DATA ACQUISITION API v1.1 manual revision 2 date 03-01-04

Drivers and Sample programs

www.obd-2.com/daq4.zip - driver dll and example program version 4 date 01-11-05
www.obd-2.com/daq3.zip - driver dll and example program version 3 date 11-16-04
www.obd-2.com/daq1.zip - driver dll and example program version 2 date 10-20-04
www.obd-2.com/daq1net.zip - driver dll and example program win.net 06/04
www.obd-2.com/daq1.zip - driver dll and example program win32 06/02
www.obd-2.com/apice.zip - driver dll and example program winCE 06/02
Note: version 1 driver not presently available.
Contents of version 4 zip file daq4.zip
"blue.h" header file for driver
"bluep.dll" driver for Win 32
"bluepnet.dll" driver with managed extensions for dot net use only.
"daq4.html" this web page
"Daqman.htm" DATA ACQUISITION API v1.1 manual
"testp.exe" Sample program for use with Win 32 driver only.

Obtaining Capabilities

int OMGetCaps(LPTSTR Capabilities)
returns text string constant in LPTSTR Capabilities
ABOUT=get|SECURITY=,get,set,|PORT_NUM=,get,set,|PORT_BAUD=,get,set,|LOGOUT=set|LOGIN_CAN=get|LOGIN_PWM=get|LOGIN_VPW=get|LOGIN_91412=get|SUP-0101-0120=get|DTC03=get|DTC07=get|CLEAR04=get| DTCGM_server_MIL=get|DTCGM_server_PENDING=get|DTCGM_server_HISTORY=get|CLEARGM_server=GET|
| is the data delimiter format and , is used as list delimeter
Provides for all data request capabilites of the driver.

"server" represents the name of a GM server. Substitute a below upper case word in place of "server" in function call. Words after the equal sign or a description, do not include in the function call.
ENGINE = Powertrain or Vehicle Control Module (PCM) or (VCM)
TRANS = Transmission Controller (TCM)
TRANSFER = Active Transfer Case
ABS28 = Anti Lock Brake System (ABS) server number 28 note: most vehciles will ues number 28
ABS29 = Anti Lock Brake System (ABS) sever number 29
TRACTION = Traction Control System (TCS)
DAMP = Real Time Damping
BODY = Body Control Module (BCM)
INSTMOD = Instrument Panel Module (IPM)
REAR = Rear Integrated Module (RIM)
SENSING = Sensing Diagnostic Module or Air Bag (SDM)
INSTCLUST = Instrument Panel Cluster (IPC)
DRIVERINFO = Driver Information Display
HEADUP = Head Up Display (HUD)
BATTERY = Battery Pack Control Module
RADIO = Radio
AMP = Amplifier
CD = Compact Disk (CD) changer
CELL = Cellular Phone
NAV = Navigation
ONSTAR = On Star
HVAC = Heating, Ventilation and Air Condition(HVAC) Control Module
CLIMATE = Climate control module
DRIVEDOOR = Driver door module
PASSDOOR = Passenger door module
MEMSEAT = Memory seat module
SEAT = Seat control module
TILT = Tilt telescope module
MIRROR = Memory mirror module
FUNCTION = Remote Function Actuator
THEFT = Vehicle Theft Deterrent (VTD)
IMMOBILE = Vehicle Immobilizer Module
Example to request enhanced trouble codes for GM engine call DTCGM_ENGINE_MIL=get|
Example to clear enhanced trouble codes in GM Radio call CLEARGM_RADIO=get|

MIL is a abbreviation for Malfunction Warning Light. These or codes that have commanded the light on.
HISTORY will report past trouble codes.
PENDING will report trouble codes that are presently failing.
Exmaple to request enhanced trouble codees for GM engine call DTCGM_ENGINE_MIL=get|
The return DataList value will contain the enhanced GM trouble code number in SAE format Pxxxx, Bxxxx, Cxxxx, or Uxxxx followed by a status description. Typical the status description will be same for all codes returned and can be a sentence with up to 320 characters. It is recommended to allocate the LPCTSTR DataList to 2048 bytes to allow for multiple trouble codes with different status descriptions

Retrieving Data

int OMGetData(LPCTSTR DataList, LPTSTR Values,OMCallback Callback=NULL)
call with one or more of the data request items listed in int OMGetCaps(LPTSTR Capabilities) in LPCTSTR DataList
returns text string in LPTSTR Values. All DataList request values or case and space sensitive. No call back is used if set to NULL

ABOUT= Rev3 11-15-04, OBD Network DAQ API Copyright 1995-2004 Alex C. Peper Car Code www.obd-2.com. Refererences: 1) Data Acquistion API Copyright 2001-2002 Keith Leinenbach One Man And A Cat Software onecatweb.com. 2) SAE. 3) ISO. 4) EPA. Not responsible for any damages|
Used to obtain driver information, call back not available

e=OMGetData(TEXT(\"SECURITY=set test|\"),Values,NULL);
Will return all data list requests with a default values, does not use car network or require password

e=OMGetData(TEXT(\"SECURITY=set xxx|\"),Values,NULL);
required to obtain vehicle network access, xxx is a assigned password, call back not available

returns curent security status

e=OMGetData( TEXT("PORT_NUM=get|"),Values,NULL );
returns current serial com port number x as set. Default is 1

e=OMGetData( TEXT("PORT_NUM=set x |"),Values,NULL );
sets serial com port number to x
e= 10 if error
Note: not called in sample program uses defualt com port 1

e=OMGetData( TEXT("PORT_BAUD=set 19200|"),Values,NULL );
e= 11 error return number TEXT("Comm Port baud"), //11
Use only 19200 baud rate for Tricom

e=OMGetData( TEXT("LOGIN_VPW=get|LOGIN_PWM=get|LOGIN_91412=get|"),Values,NULL );
requests network type, above will check all 3 until one is found
if PWM network is found will return
if none of above example is found will return
Response time minimum = 250 ms maximum = 12 sec. e=Error return numbers
TEXT("Route Box no response"), //15
No vehcile power to router, serial gateway not connected, client serial inteface not correct
TEXT("Route Box invalid response"), //16
Client serial inteface not correct, gateway checksum error.
TEXT("Network invalid response"), //17
Unsupported network message, router crc or checksum error.

e=OMGetData( TEXT("DTC03=get"),Values,NULL );
DTC03=,0000,| //Server response for no codes
DTC03=No Client Response| //no connection
DTC03=No Server Response| //Possible server response for no codes
requsets legislated mode 03 diagnostic trouble codes.
returns list of code numbers with ,delimeters,
response time 400 - 1200 ms

e=OMGetData( TEXT("DTC07=get"),Values,NULL );
DTC03=,0000,| //Server response for no codes
DTC07=No Client Response| //no connection
DTC07=No Server Response| //Possible server response for no codes
requsets legislated mode 07 pending diagnostic trouble codes.
returns list of code numbers with , delimeters
response time 400 - 1200 ms

e=OMGetData( TEXT("CLEAR04=get"),Values,NULL );
CLEAR04=No Client Response| //no connection
CLEAR04=No Server Response| //resend if low bandwidth, try with engine off
requests legislated mode 04 code clear
returns True if vehicle server acknowleged
response time 400 - 1200 ms

e=OMGetData( TEXT("DTCGM_ENGINE_MIL=get"),Values,NULL );
DTCGM_ENGINE_HISTORY=P0143,enhanced GM status report sentence,|
DTCGM_ENGINE_MIL=P0143,enhanced GM status report sentence,P0146,another sentence|
DTCGM_ENGINE_PENDING=P0143,PO146,enhanced GM status report sentence,|
Requests enhanced GM trouble code for a named server and status type
Returns enhanced GM trouble code number with a status report.

e=OMGetData( TEXT("CLEARGM_ENGINE=get"),Values,NULL );
CLEAR04=No Client Response| //no connection
CLEAR04=No Server Response| //resend if low bandwidth, try with engine off
Requests enhanced GM code clear for a named server
returns True if vehicle server acknowledged
response time 400 - 1200 ms

e=OMGetData( TEXT("LOGOUT=set|"),(LPTSTR)Values,NULL );
Logs off network if required and closes serial com port

Typical example

TCHAR Values[2048]; // string for return values
int e; // integer return error number
e=OMGetData(TEXT(\"SECURITY=set xxx|\"),Values,NULL); // enter password xxx or test for offline development
e=OMGetData( TEXT("PORT_NUM=set x |"),Values,NULL ); //set serial client com port number to x
e=OMGetData( TEXT("PORT_BAUD=set 19200|"),Values,NULL ); // set serial gateway and client baud rate
e=OMGetData( TEXT("LOGIN_VPW=get|LOGIN_PWM=get|LOGIN_91412=get|"),Values,NULL ); //check for available network
e=OMGetData( TEXT("DTC03=get"),Values,NULL ); // read legislated trouble codes
e=OMGetData( TEXT("DTCGM_ENGINE_HISTORY=get"),Values,NULL ); // read enhanced trouble codes with status for GM Powertrain Control Module
e=OMGetData( TEXT("CLEARGM_BODY=get"),Values,NULL ); // clear all trouble codes in a GM body control module
e=OMGetData( TEXT("LOGOUT=set|"),Values,NULL ); //log off vehicle network and close client serial port

Error Values and header file declaration functions

Located in header file blue.h 06/30/2002

typedef void (WINAPI * OMCallback) (LPTSTR,int); 

TCHAR *Error[19] =
	TEXT("No Errors"),	//0
	TEXT("Comm Port error 55. Port already open"),	//1
	TEXT("Comm Port open I/O"),	//2
	TEXT("Comm Port set time outs"),	//3
	TEXT("Comm Port set buffers"),	//4
	TEXT("Comm Port purge buffers"),	//5
	TEXT("Comm Port get state"),	//6
	TEXT("Comm Port close I/O"),	//7
	TEXT("Comm Port send"),	//8
	TEXT("Comm Port recv."),	//9
	TEXT("Comm Port number"),	//10
	TEXT("Comm Port baud"),	//11
	TEXT("Comm Port reserved"),	//12
	TEXT("Datalist size under 5"),	//13
	TEXT("Datalist size over 255"),	//14
	TEXT("Route Box no response"),	//15
	TEXT("Route Box invalid response"),	//16
	TEXT("Network invalid response"),	//17
	TEXT("Invalid stream size")	//18

extern "C" int __declspec(dllexport) WINAPI
OMGetCaps( LPTSTR Capabilities );

extern "C" int __declspec(dllexport) WINAPI
OMGetData( LPCTSTR DataList, LPTSTR Values, OMCallback Callback );

Contact Information

Car Code
931 Summer Leaf Drive
Saint Peters, MO. 63376
email: support@obd-2.com
email: sales@obd-2.com
Information, support, service, COD cash, credit cards
Phone: 636-734-5004 Mon-Fri. 9pm - 7am, Sat-Sun. 24 hrs. cst.
Phone: 636-447-9995 Mon-Fri. 10am - 2pm cst.
Fax: 516-977-1071
Near Near X Prize Mission Control, start of Velvet Revolver Tour and Lewis and Clark Expedition. Site of 2004 Summer Olympic Diving Trials.
Inquire about free obd-2 evaluation.


Copyright © 1995-2005 Alex C. Peper. All Rights Reserved.
Reprinted with permission from SAE J1930, J1962, J1978, J1979, J2012, J2190, J1850, J2178 © 1997-2004 Society of Automotive Engineers, Inc. license 2000-2005
California Air Resource Board
Equipment and Tool Institute
International Standards Organization
United States Code of Federal Regulations
General Motors data stream license 2001-2006