Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Pid Creation / Calculated pids

  1. #11
    Joe (Moderator) joecar's Avatar
    Join Date
    Apr 2003
    Posts
    28,403

    Default

    lookup()

    Syntax: lookup(x,a1,a2,b1,b2,…,c1,c2)

    Arguments:
    x: a numeric expression
    a1,a2,b1,b2,…c1,c2 is a list of pairs of values.

    Return value: The value of the second value of the pair whose first value is less than or equal to x.

    The list of value pairs must be sorted on the first value of each pair.

  2. #12
    Lifetime Member
    Join Date
    Feb 2007
    Posts
    594

    Default

    Quote Originally Posted by joecar View Post
    Hi Gelf VXR,

    What does B5101 look like...

    If it's 1-dimensional, you can create a calc pid using the lookup() function, and then a second calc pid to calculate the looked value divided by SPARKADV.

    Here is an example (ignore the part about cal_link.txt): showthread.php?t=8142&highlight=lookup

    Cheers
    Joe
    Unfortunately its a 3d map, Data = Spark, Row = RPM and Column = g/cyl

  3. #13
    Lifetime Member
    Join Date
    Feb 2007
    Posts
    594

    Default

    Quote Originally Posted by joecar View Post
    lookup()

    Syntax: lookup(x,a1,a2,b1,b2,…,c1,c2)

    Arguments:
    x: a numeric expression
    a1,a2,b1,b2,…c1,c2 is a list of pairs of values.

    Return value: The value of the second value of the pair whose first value is less than or equal to x.

    The list of value pairs must be sorted on the first value of each pair.
    My head hurts lol

  4. #14
    Lifetime Member
    Join Date
    Jul 2005
    Posts
    702

    Default

    yea but wouldn't it be nice if there was some DMA or automated lookup procedure that could look up values for ANY table?

  5. #15
    Joe (Moderator) joecar's Avatar
    Join Date
    Apr 2003
    Posts
    28,403

    Default

    x is the "lookup" index pid.

    a1,a2 -> when you lookup a1, you get back a2
    b1,b2 -> when you lookup b1, you get back b2
    c1,c2 -> when you lookup c1, you get back c2
    d1,d2
    e1,e2
    .....,....
    x1,x2
    .....,....

    a1,b1,c1,d1,e1,f1,...x1,... must be in ascending order

    lookup() compares x to each of a1,b1,c1,d1,... it stops when it finds the matching/exceeding value;


    Example:

    lookup({GM.RPM}, 1000,1, 2000,2, 3000,3, 4000,4, 5000,5, 6000,6)

    if {GM.RPM} is 3000, then lookup returns 3.
    if {GM.RPM} is 4500, then lookup returns 4 (or actually 4.5... I think it interpolates).

  6. #16
    Lifetime Member jfpilla's Avatar
    Join Date
    Apr 2003
    Posts
    666

    Default

    Are we saying that B5104, b5122 can be logged seperately from B5101? The C5 tables that correspond always log based on what condition exists.
    2003 red vert
    Mods:
    LS7 crate engine, wet sump, 24xx reluctor
    LPE 100mm MAF
    Vararam, cold air intake and bridge
    RPM Level 6/4L60e trans
    3.42 gears
    Yank SS3600
    1-7/8" AR headers
    Z06 exhaust
    470rwhp 437rwtq
    1/8th mi-1.526-60'-6.862-1/8th-@100.74mph

  7. #17
    Lifetime Member
    Join Date
    Jul 2005
    Posts
    702

    Default

    is the interpolation in the lookup function done using the same exact method that the ecu uses?

  8. #18
    Lifetime Member
    Join Date
    Feb 2007
    Posts
    594

    Default

    Quote Originally Posted by joecar View Post
    x is the "lookup" index pid.

    a1,a2 -> when you lookup a1, you get back a2
    b1,b2 -> when you lookup b1, you get back b2
    c1,c2 -> when you lookup c1, you get back c2
    d1,d2
    e1,e2
    .....,....
    x1,x2
    .....,....

    a1,b1,c1,d1,e1,f1,...x1,... must be in ascending order

    lookup() compares x to each of a1,b1,c1,d1,... it stops when it finds the matching/exceeding value;


    Example:

    lookup({GM.RPM}, 1000,1, 2000,2, 3000,3, 4000,4, 5000,5, 6000,6)

    if {GM.RPM} is 3000, then lookup returns 3.
    if {GM.RPM} is 4500, then lookup returns 4 (or actually 4.5... I think it interpolates).
    Ok, got that, can it not look up a1, a2, a3? Where a1 is the Row, a2 is the column and a3 is the the cross reference value?

  9. #19
    Joe (Moderator) joecar's Avatar
    Join Date
    Apr 2003
    Posts
    28,403

    Default

    lookup() only works with 1-D data.

  10. #20
    Lifetime Member
    Join Date
    Jul 2005
    Posts
    702

    Default

    feature request: lookup2d

Page 2 of 2 FirstFirst 12

Similar Threads

  1. How to modify calculated PIds
    By 2000ssnb in forum Tips and tricks
    Replies: 12
    Last Post: July 4th, 2008, 04:14 AM
  2. Replies: 1
    Last Post: April 27th, 2005, 01:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •