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.
|
02-16-2005, 07:31 PM
|
#1
|
|
Low Bitrate
Join Date: Feb 2005
Location: NEPA
Vehicle: 2002 Mitsubishi Eclipse
Posts: 100
|
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/
|
|
|
02-17-2005, 07:28 AM
|
#2
|
|
See me in my wet t-shirt.
Join Date: Aug 2003
Location: Warwickshire, UK
Vehicle: Ford Focus MP3
Posts: 1,909
|
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?
|
|
|
02-17-2005, 07:29 AM
|
#3
|
|
See me in my wet t-shirt.
Join Date: Aug 2003
Location: Warwickshire, UK
Vehicle: Ford Focus MP3
Posts: 1,909
|
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?
Last edited by stevieg : 02-17-2005 at 07:49 AM.
|
|
|
02-17-2005, 08:36 AM
|
#4
|
|
Low Bitrate
Join Date: Feb 2005
Location: NEPA
Vehicle: 2002 Mitsubishi Eclipse
Posts: 100
|
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. 
|
|
|
02-17-2005, 09:48 AM
|
#5
|
|
Constant Bitrate
Join Date: May 2004
Location: San Diego, CA
Vehicle: Eclipse 3G / 350Z Touring
Posts: 118
|
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
|
|
|
02-17-2005, 09:52 AM
|
#6
|
|
Low Bitrate
Join Date: Feb 2005
Location: NEPA
Vehicle: 2002 Mitsubishi Eclipse
Posts: 100
|
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.
|
|
|
03-12-2005, 11:22 AM
|
#7
|
|
Newbie
Join Date: Feb 2005
Posts: 45
|
I can't download the class
can you send it me?
thanks and regards
|
|
|
03-12-2005, 11:56 AM
|
#8
|
|
Low Bitrate
Join Date: Feb 2005
Location: NEPA
Vehicle: 2002 Mitsubishi Eclipse
Posts: 100
|
Please try it again from the webpage, I changed the URL. When you download it, just cut off the .txt extension.
|
|
|
03-12-2005, 01:08 PM
|
#9
|
|
Newbie
Join Date: Feb 2005
Posts: 45
|
thanks, now it works
Kind Regards
|
|
|
03-22-2005, 08:23 PM
|
#10
|
|
Low Bitrate
Join Date: Dec 2003
Posts: 68
|
can I use VAG TWIN COM with it?
__________________
ProjectEZP.com – next generation police speedtrap locator. Free database for your GPS system (includes US/Canada).
|
|
|
03-22-2005, 09:45 PM
|
#11
|
|
Low Bitrate
Join Date: Feb 2005
Location: NEPA
Vehicle: 2002 Mitsubishi Eclipse
Posts: 100
|
Probably not.
|
|
|
04-07-2005, 08:22 PM
|
#12
|
|
Maximum Bitrate
Join Date: Aug 2003
Location: CA
Vehicle: 2000 Nissan MAXIMA
Posts: 461
|
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
|
|
|
04-08-2005, 04:40 AM
|
#13
|
|
See me in my wet t-shirt.
Join Date: Aug 2003
Location: Warwickshire, UK
Vehicle: Ford Focus MP3
Posts: 1,909
|
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!
|
|
|
08-28-2005, 10:28 AM
|
#14
|
|
Maximum Bitrate
Join Date: Sep 2004
Posts: 505
|
Any progress on this? I'm wondering if MPG calculations are possible using OBD-II.
|
|
|
08-28-2005, 05:07 PM
|
#15
|
|
Low Bitrate
Join Date: Feb 2005
Location: NEPA
Vehicle: 2002 Mitsubishi Eclipse
Posts: 100
|
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 Variant, tSpeed As Variant, tLTFuelTrim As Variant) As Variant
''MAF is maf_air_flow sensor. To convert from what the OBD returns, value=OBDData * 0.01
''tSpeed is vehicle speed in MPH. To convert from what the OBD returns, value=OBDData * 0.621371192
''tLTFuelTrim is long-term fuel trim. To convert from what the OBD returns, value=0.7812 * (OBDData - 128)
If IsNull(tMAF) Or IsNull(tSpeed) Or IsNull(tLTFuelTrim) Then
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(tMPG, 1, True, False, False)
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.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:53 PM.
|
|