View Single Post
Old 10-28-2007, 02:00 PM   #28
oroboros_ARR
Newbie
 
Join Date: May 2007
Posts: 25
Quote: Originally Posted by Erorus View Post
PHP Code:
Function GetMPG(tIDC As VarianttSpeed As Variant) As Variant

''tIDC is injector duty cycle

''tSpeed is vehicle speed in MPHTo convert from what the OBD returnsvalue=OBDData 0.621371192

''tVFF is volume fuel flow.
    
    If 
IsNull(tIDC) Or IsNull(tSpeedThen
        GetMPG 
Null
        
Exit Function
    
End If

    
Dim tMPG As String
    Dim tVFF 
As String

    
'' Do VFF (gallons/minute)

    
tVFF tIDC 250 0.000264172051 
    
    
'' Do Speed in miles/min

    tSpeed 
tSpeed/60

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

    GetMPG 
FormatNumber(tMPG1TrueFalseFalse)

End Function 

This is with 250cc/min injectors. Would something like this work?

Last edited by oroboros_ARR; 10-28-2007 at 02:04 PM.
oroboros_ARR is offline   Reply With Quote