Diacom runs and ramblings (longish)

Roger Heflin rah at horizon.hit.net
Thu Apr 2 02:45:34 GMT 1998


John Hess wrote:
> 
> Hey, this one sounds interesting.  Can those of you who have analysis
> programs for the Diacom and Diacom plus expound on what you are doing or
> even submit your programs, themselves?
> 
> At 09:33 AM 4/1/98 -0600, you wrote:
> >>
> >> >If you want to analyze the data with something more commonly available,
> >> >try using Microsoft Access.  I think you can use it to pull in a text
> >> >file, but I'm not sure.
> >>
> >> YOu absoltuely can with Access, whether the file is space or comma
> delimited.
> >>
> >> Just a FYI :)
> >>
> >>
> >
> >I have been outputting the diacom stuff in DBase format, and then reading
> >it in with quickbasic to do analysis.  I prefer simple programming languages
> >over spreadsheets, it is alot simpler for complicated things.  I have mine
> >calculating various things from the data.  The DBase format is fairly easy
> >to reverse engineer.
> >
> >                                       Roger
> >
> >

Well, here is the basic code to determine what variables are in what 
columns and load the data into variables.   This basic code can be 
used to setup a program to read in a diacom file from a car with
the needed columns and load it into variables.  After you find out
what variable is in what column you can then do whatever calculations 
you want to.   If you had the diacom plus certain arrays would need
to be enlarged to handle it.  The program handles the data in whatever
order diacom outputs it in, since order does not seem to be consistant.

Code follows:

DIM record AS STRING * 16
DIM vn AS INTEGER
DIM frame AS INTEGER
DIM i AS INTEGER
DIM byteloc AS LONG
TYPE varinfo
  vname AS STRING * 16
  vtype AS STRING * 1
END TYPE
DIM onechar AS STRING * 1
DIM twochar AS STRING * 2
DIM eightchar AS STRING * 7
DIM valuec(50, 200) AS STRING * 6
DIM maxspeed AS INTEGER
DIM speedvar AS INTEGER
DIM timevar AS INTEGER
DIM rpmvar AS INTEGER
DIM airvar AS INTEGER
DIM knockvar AS INTEGER
DIM throtposvar AS INTEGER
DIM lefto2var AS INTEGER
DIM righto2var AS INTEGER
DIM advvar AS INTEGER
DIM weight AS SINGLE
DIM a AS INTEGER
DIM variable(50) AS varinfo
DIM filename AS STRING * 64
FILES "*.dbf"
PRINT "Enter the name of the file"
INPUT filename
OPEN filename FOR BINARY AS #1
OPEN "output.dat" FOR OUTPUT AS #2
GET #1, , record
vn = 1

GET #1, , record
GET #1, , record

WHILE ASC(LEFT$(record, 1)) <> 13
  i = 1
  WHILE i < 16 AND ASC(MID$(record, i, 1)) <> 0
    i = i + 1
  WEND
  variable(vn).vname = LEFT$(record, i - 1)
  variable(vn).vtype = MID$(record, 12, 1)
  IF (LEFT$(variable(vn).vname, 10) = "VHCL_SPEED") THEN
    speedvar = vn
  ELSEIF (LEFT$(variable(vn).vname, 9) = "Frame_num") THEN
    timevar = vn
  ELSEIF (LEFT$(variable(vn).vname, 10) = "ENGINE_RPM") THEN
    rpmvar = vn
  ELSEIF (LEFT$(variable(vn).vname, 8) = "SPRK_ADV") THEN
    advvar = vn
  ELSEIF (LEFT$(variable(vn).vname, 10) = "KNOCK_RETD") THEN
    knockvar = vn
  ELSEIF (LEFT$(variable(vn).vname, 8) = "AIR_FLOW") THEN
    airvar = vn
  ELSEIF (LEFT$(variable(vn).vname, 9) = "THROT_POS") THEN
    throtposvar = vn
  ELSEIF (LEFT$(variable(vn).vname, 7) = "LEFT_O2") THEN
    lefto2var = vn
  ELSEIF (LEFT$(variable(vn).vname, 8) = "RIGHT_O2") THEN
    righto2var = vn
  END IF

  vn = vn + 1
  GET #1, , record
  byteloc = LOC(1)
  GET #1, , record
WEND
vn = vn - 1
PRINT USING "## variables found"; vn
FOR i = 1 TO vn
  PRINT USING "  ## \           \ \\"; i; variable(i).vname; variable(i).vtype
NEXT i
GET #1, byteloc, twochar
FOR frame = 1 TO 200
FOR i = 1 TO vn - 1
  GET #1, , valuec(i, frame)
NEXT i
GET #1, , valuec(vn, frame)
GET #1, , onechar
NEXT frame




--



More information about the Diy_efi mailing list