Announcement

Collapse
No announcement yet.

Yet Another OBDII VB6 Class

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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/
    Epox EP-3VWB+ w/VIA C3 750MHz
    Crystalfontz 632 16x2 LCD
    DWW-7VGA 7" Indash VGA w/Touchscreen
    Garmin GPS 18 USB
    Terk XMD1000 XM Tuner (My VB6 Class)
    Scantool.net ElmScan ISO (My VB6 Class)
    PSK-3100 Traveller Keyboard

  • #2
    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 Blog Updated 29 January 2009!
    Car PC Status: Complete - Undergoing Software Redevelopment

    Comment


    • #3
      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 Blog Updated 29 January 2009!
      Car PC Status: Complete - Undergoing Software Redevelopment

      Comment


      • #4
        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.
        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.
        Epox EP-3VWB+ w/VIA C3 750MHz
        Crystalfontz 632 16x2 LCD
        DWW-7VGA 7" Indash VGA w/Touchscreen
        Garmin GPS 18 USB
        Terk XMD1000 XM Tuner (My VB6 Class)
        Scantool.net ElmScan ISO (My VB6 Class)
        PSK-3100 Traveller Keyboard

        Comment


        • #5
          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

          Comment


          • #6
            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.
            Epox EP-3VWB+ w/VIA C3 750MHz
            Crystalfontz 632 16x2 LCD
            DWW-7VGA 7" Indash VGA w/Touchscreen
            Garmin GPS 18 USB
            Terk XMD1000 XM Tuner (My VB6 Class)
            Scantool.net ElmScan ISO (My VB6 Class)
            PSK-3100 Traveller Keyboard

            Comment


            • #7
              I can't download the class

              can you send it me?


              thanks and regards

              Comment


              • #8
                Please try it again from the webpage, I changed the URL. When you download it, just cut off the .txt extension.
                Epox EP-3VWB+ w/VIA C3 750MHz
                Crystalfontz 632 16x2 LCD
                DWW-7VGA 7" Indash VGA w/Touchscreen
                Garmin GPS 18 USB
                Terk XMD1000 XM Tuner (My VB6 Class)
                Scantool.net ElmScan ISO (My VB6 Class)
                PSK-3100 Traveller Keyboard

                Comment


                • #9
                  thanks, now it works

                  Kind Regards

                  Comment


                  • #10
                    can I use VAG TWIN COM with it?
                    ProjectEZP.com next generation police speedtrap locator. Free database for your GPS system (includes US/Canada).

                    Comment


                    • #12
                      So anyone used it yet?
                      Current Status: For Sale

                      Specs
                      - 1.5Ghz Toshiba Laptop (available - no screen)
                      - Indash Motorized 7" VGA TS
                      - DeLorme GPS (sold)
                      - Power Inverter (sold)
                      - Pioneer HU (sold)

                      Comment


                      • #13
                        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 Blog Updated 29 January 2009!
                        Car PC Status: Complete - Undergoing Software Redevelopment

                        Comment


                        • #14
                          Any progress on this? I'm wondering if MPG calculations are possible using OBD-II.

                          Comment


                          • #15
                            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.
                            Epox EP-3VWB+ w/VIA C3 750MHz
                            Crystalfontz 632 16x2 LCD
                            DWW-7VGA 7" Indash VGA w/Touchscreen
                            Garmin GPS 18 USB
                            Terk XMD1000 XM Tuner (My VB6 Class)
                            Scantool.net ElmScan ISO (My VB6 Class)
                            PSK-3100 Traveller Keyboard

                            Comment

                            Working...
                            X