The MP3car.com Store  

Welcome to the MP3Car.com forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Registering will also remove advertisements. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   MP3Car.com > Mp3Car Technical > Engine Management, OBD-II, Engine Diagnostics, etc.

Reply
 
Thread Tools Display Modes
Old 02-16-2005, 07:31 PM   #1
Low Bitrate
 
Erorus's Avatar
 
Join Date: Feb 2005
Location: NEPA
Vehicle: 2002 Mitsubishi Eclipse
Posts: 100
My Photos: (0)
Yet Another OBDII VB6 Class

Here's my version, folks.. it's a class so you make it an object and use its functions/subs/events to communicate with it in your application. Practically plug-and-play.

Works with the ELM323 chip found in scantool.net's OBD devices. The 323 is the ISO version, but I bet this exact code will also work with the other ELM chips (ELM320 and ELM322).

http://www.apeirokalia.com/elm323/
Erorus is offline   Reply With Quote
Sponsored Links
Old 02-17-2005, 07:28 AM   #2
See me in my wet t-shirt.
 
stevieg's Avatar
 
Join Date: Aug 2003
Location: Warwickshire, UK
Vehicle: Ford Focus MP3
Posts: 1,909
My Photos: (0)
Quote: Originally Posted by Erorus
Here's my version, folks.. it's a class so you make it an object and use its functions/subs/events to communicate with it in your application. Practically plug-and-play.

Works with the ELM323 chip found in scantool.net's OBD devices. The 323 is the ISO version, but I bet this exact code will also work with the other ELM chips (ELM320 and ELM322).

http://www.apeirokalia.com/elm323/


Thanks... Looks good.

So basically, once the inital setup is done, you fire a command to it and an event comes back with the data?
__________________
Ford Focus MP3 : www.stevieg.org/carpc
Car PC Status: COMPLETE
stevieg is offline   Reply With Quote
Old 02-17-2005, 07:29 AM   #3
See me in my wet t-shirt.
 
stevieg's Avatar
 
Join Date: Aug 2003
Location: Warwickshire, UK
Vehicle: Ford Focus MP3
Posts: 1,909
My Photos: (0)
by the way... Yet another VB6 elm class? Where are all the others???? I thought this was the first?

EDIT:
I would like to use this to finish off my MPG meter.. Do you have a sample app to give me a better idea of how to use the class?
__________________
Ford Focus MP3 : www.stevieg.org/carpc
Car PC Status: COMPLETE

Last edited by stevieg : 02-17-2005 at 07:49 AM.
stevieg is offline   Reply With Quote
Old 02-17-2005, 08:36 AM   #4
Low Bitrate
 
Erorus's Avatar
 
Join Date: Feb 2005
Location: NEPA
Vehicle: 2002 Mitsubishi Eclipse
Posts: 100
My Photos: (0)
Quote:
Thanks... Looks good.

So basically, once the inital setup is done, you fire a command to it and an event comes back with the data?

That's the idea exactly.
Quote:
by the way... Yet another VB6 elm class? Where are all the others???? I thought this was the first?

EDIT:
I would like to use this to finish off my MPG meter.. Do you have a sample app to give me a better idea of how to use the class?

Well, I see a lot of VB code on this so I tacked "Yet Another" on the subject line. The thing I like about the class is it isn't fully embedded in a form that you have to take apart to figure out how to use.

I don't have a sample app for ya, sorry. Maybe if I get bored in the next few days.
Erorus is offline   Reply With Quote
Old 02-17-2005, 09:48 AM   #5
Constant Bitrate
 
takissd's Avatar
 
Join Date: May 2004
Location: San Diego, CA
Vehicle: Eclipse 3G / 350Z Touring
Posts: 118
My Photos: (0)
great! will that work with vb.net??? if yes, how?
__________________
-VIA EPIA M10000/512MB/40GB HD
-DWW motorized 7'
-BU 303 GPS w/iGuidance/ CF
-Opus90w
-Belkin Bluetooth
-Pioneer HU

[||||||||||] 95% done
takissd is offline   Reply With Quote
Old 02-17-2005, 09:52 AM   #6
Low Bitrate
 
Erorus's Avatar
 
Join Date: Feb 2005
Location: NEPA
Vehicle: 2002 Mitsubishi Eclipse
Posts: 100
My Photos: (0)
Quote: Originally Posted by takissd
great! will that work with vb.net??? if yes, how?

No idea, I don't have VB.net. Worth a shot, tho.
Erorus is offline   Reply With Quote
Old 03-12-2005, 11:22 AM   #7
Newbie
 
Join Date: Feb 2005
Posts: 45
My Photos: (0)
I can't download the class

can you send it me?


thanks and regards
kocke is offline   Reply With Quote
Old 03-12-2005, 11:56 AM   #8
Low Bitrate
 
Erorus's Avatar
 
Join Date: Feb 2005
Location: NEPA
Vehicle: 2002 Mitsubishi Eclipse
Posts: 100
My Photos: (0)
Please try it again from the webpage, I changed the URL. When you download it, just cut off the .txt extension.
Erorus is offline   Reply With Quote
Old 03-12-2005, 01:08 PM   #9
Newbie
 
Join Date: Feb 2005
Posts: 45
My Photos: (0)
thanks, now it works

Kind Regards
kocke is offline   Reply With Quote
Old 03-22-2005, 08:23 PM   #10
Low Bitrate
 
Join Date: Dec 2003
Posts: 68
My Photos: (0)
can I use VAG TWIN COM with it?
__________________
ProjectEZP.com – next generation police speedtrap locator. Free database for your GPS system (includes US/Canada).
blaster is offline   Reply With Quote
Sponsored Links
Old 03-22-2005, 09:45 PM   #11
Low Bitrate
 
Erorus's Avatar
 
Join Date: Feb 2005
Location: NEPA
Vehicle: 2002 Mitsubishi Eclipse
Posts: 100
My Photos: (0)
Probably not.
Erorus is offline   Reply With Quote
Old 04-07-2005, 08:22 PM   #12
Maximum Bitrate
 
carabuser's Avatar
 
Join Date: Aug 2003
Location: CA
Vehicle: 2000 Nissan MAXIMA
Posts: 461
My Photos: (0)
So anyone used it yet?
__________________
2000 Maxima CarPC
Current Status: Rebuilding

Specs
- 1.5Ghz Toshiba Laptop
- Indash Motorized 7" VGA TS
- DeLorme GPS
- Power Inverter
- Pioneer HU
carabuser is offline   Reply With Quote
Old 04-08-2005, 04:40 AM   #13
See me in my wet t-shirt.
 
stevieg's Avatar
 
Join Date: Aug 2003
Location: Warwickshire, UK
Vehicle: Ford Focus MP3
Posts: 1,909
My Photos: (0)
Quote: Originally Posted by carabuser
So anyone used it yet?


Yes!!!

I'm using it! It works - My app isn't finished yet, but it's a re-hash of this:

http://www.mp3car.com/vbulletin/showthread.php?t=32692

The OBDII stuff is working very well. I've successfully had it running for hours on end pulling out the data. My MPG calculations seem to be a bit iffy though - I am having trouble finding a comprehensive list of all the basic formulas for temp, mass air flow etc for when I'm converting from the output long to it's 'real' value! I found one a long time ago when I first started on this, before your VB6 class, but can't find it now, so having a little trouble double checking everything.

I haven't tested standby/resume properly yet - my only try resulted in failure but I was thinking about polling for the standby system call and disconnecting, then on resume reconnecting if it causes any issues - my main thing is getting the instant MPG quick and reliable.

But yes... It works!
__________________
Ford Focus MP3 : www.stevieg.org/carpc
Car PC Status: COMPLETE
stevieg is offline   Reply With Quote
Old 08-28-2005, 10:28 AM   #14
Maximum Bitrate
knubile's CarPC Specs
 
knubile's Avatar
 
Join Date: Sep 2004
Posts: 505
My Photos: (0)
Any progress on this? I'm wondering if MPG calculations are possible using OBD-II.
knubile is offline   Reply With Quote
Old 08-28-2005, 05:07 PM   #15
Low Bitrate
 
Erorus's Avatar
 
Join Date: Feb 2005
Location: NEPA
Vehicle: 2002 Mitsubishi Eclipse
Posts: 100
My Photos: (0)
Quote: Originally Posted by knubile
Any progress on this? I'm wondering if MPG calculations are possible using OBD-II.

PHP Code:
Function GetMPG(tMAF As VarianttSpeed As VarianttLTFuelTrim As Variant) As Variant

''MAF is maf_air_flow sensorTo convert from what the OBD returnsvalue=OBDData 0.01
''tSpeed is vehicle speed in MPHTo convert from what the OBD returnsvalue=OBDData 0.621371192
''tLTFuelTrim is long-term fuel trimTo convert from what the OBD returnsvalue=0.7812 * (OBDData 128)
    
    If 
IsNull(tMAF) Or IsNull(tSpeed) Or IsNull(tLTFuelTrimThen
        GetMPG 
Null
        
Exit Function
    
End If

    
Dim tMPG As String

    
'' Do MAF over an hour
    tMAF 
tMAF 60
    tMAF 
tMAF 60

    
'' Turn into KG/litre equivalent
    tMAF 
tMAF 1000

    
'' Get petrol flow based on 14.7:1
    tMAF 
tMAF 14.7

    
'' convert litres to gallons
    tMAF 
tMAF 0.219969157

    
'' convert long term fuel trim to percentage
        tLTFuelTrim 
= (tLTFuelTrim 100) + 1

    
'' Calculate MPG
    tMPG 
= (tSpeed tMAF) * tLTFuelTrim

    GetMPG 
FormatNumber(tMPG1TrueFalseFalse)
End Function 

The problem I have with this is the air flow sensor is very optimistic, and you probably run richer than this formula indicates. It says I average around 60-90MPG when cruising on the hwy and up to 200+ MPG when coasting. However, it does change when you have the pedal down, etc. I forget where I stole this code from.
Erorus is offline   Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Able to get voltage from OBDII? aoLhaTer Engine Management, OBD-II, Engine Diagnostics, etc. 10 07-18-2007 09:26 PM
FS: OBDII diagnostic interface deskcom Classified Archive 0 12-09-2004 11:24 PM
@ Leddy OBDII gyro NeoCar Media Center 4 12-08-2004 06:43 PM
Pick my Programing class for me! Sonicxtacy02 Off Topic 14 11-23-2004 08:59 PM
1994 Saab 900 & OBDII Shark General Hardware Discussion 2 11-03-2003 08:58 AM


All times are GMT -5. The time now is 03:53 PM.


Sponsored Links
The MP3car.com Store

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Copyright © 1999 - 2008 Mp3Car.com Inc.
Ad Management by RedTyger
Message Board Statistics