Results 1 to 19 of 19

Thread: AND and OR Filter Statements

  1. #1
    Señor Tuner MeentSS02's Avatar
    Join Date
    Jun 2005
    Location
    Dayton, OH
    Posts
    1,132

    AND and OR Filter Statements

    Quick one:

    How long can an AND/OR string be? Can you only combine two parameters? Three? I'm wanting to only log certain cells between X and Y RPMs, but only above Z AFR. Just didn't know what the code supports...
    2008 Viper - now with HPToona - 1/4 Mile Shenanigans Here
    11.02 @ 130

  2. #2
    HP Tuners Support
    (foff667)
    Bill@HPTuners's Avatar
    Join Date
    Jun 2004
    Location
    Hailing from Parts Unknown
    Posts
    28,318
    well i just did 3 ands & it worked fine...not sure what the limit is
    It doesn't have to be perfect, it just needs to be done in two weeks...

    A wise man once said "google it"

  3. #3
    Senior Tuner
    Join Date
    Dec 2004
    Location
    Laurel, MD
    Posts
    1,020
    how about a delta function? as in 'if TPSdelta > 20% then filter out' to get rid of transitional numbers. efilive has it...

  4. #4
    Señor Tuner MeentSS02's Avatar
    Join Date
    Jun 2005
    Location
    Dayton, OH
    Posts
    1,132
    Was wondering about that myself...delta > *

    2008 Viper - now with HPToona - 1/4 Mile Shenanigans Here
    11.02 @ 130

  5. #5
    HP Tuners Owner Keith@HPTuners's Avatar
    Join Date
    Sep 2002
    Location
    Chicago, IL
    Posts
    6,397
    Delta is on the to-do list.

    You can combine any number of AND and OR statements and can use as many ()'s as you like.. you just need to keep the string under 255 characters in length.
    We got this guy Not Sure, ...

  6. #6
    Señor Tuner MeentSS02's Avatar
    Join Date
    Jun 2005
    Location
    Dayton, OH
    Posts
    1,132
    Oh...so you can do something like ([SENS.XX AND SENS.YY > Z]) or [SENS.AA] > B?

    Is that how the () are used?
    2008 Viper - now with HPToona - 1/4 Mile Shenanigans Here
    11.02 @ 130

  7. #7
    Senior Tuner S2H's Avatar
    Join Date
    Apr 2005
    Location
    Schexnayder Racing - Arnaudville LA
    Posts
    4,387
    I think they have to be individual [sens.111]>0 and [sens.11]<90 and [sens.90]>90
    -Scott -

  8. #8
    Senior Tuner S2H's Avatar
    Join Date
    Apr 2005
    Location
    Schexnayder Racing - Arnaudville LA
    Posts
    4,387
    heres one that I use..mostly a visual thing..
    for the EIO output triggers

    Enable trigger
    [SENS.120]>14.5 AND [SENS.120]<14.9

    Disable trigger
    [SENS.120]<14.5 OR [SENS.120]>14.9


    using this my EIO output is triggered when AFR reports stoich..and off when it is above or below stoich..I chose a range of .2 either way for stoich..close enough for visual
    -Scott -

  9. #9
    HP Tuners Owner Keith@HPTuners's Avatar
    Join Date
    Sep 2002
    Location
    Chicago, IL
    Posts
    6,397
    They don't have to be individual, you can do very complex functions.

    In stevens example:
    ([SENS.XX AND SENS.YY > Z]) or [SENS.AA] > B?

    For the above to pass as true, it would be analyzed like this.

    Is ([SENS.XX AND SENS.YY > Z]) true,
    or is [SENS.AA] > B true?
    If one or the other is true, then the filter will pass as true.

    For ([SENS.XX AND SENS.YY > Z]) to pass as true,
    SENS.XX must equal 1 and SENS.YY must be greater than Z.

    If the expression you build has a result of 1, it is evaludated as true. If it has a result of 0, it is evaludated as false.
    We got this guy Not Sure, ...

  10. #10
    Senior Tuner S2H's Avatar
    Join Date
    Apr 2005
    Location
    Schexnayder Racing - Arnaudville LA
    Posts
    4,387
    Quote Originally Posted by Keith@HPTuners
    They don't have to be individual, you can do very complex functions.

    In stevens example:
    ([SENS.XX AND SENS.YY > Z]) or [SENS.AA] > B?

    For the above to pass as true, it would be analyzed like this.

    Is ([SENS.XX AND SENS.YY > Z]) true,
    or is [SENS.AA] > B true?
    If one or the other is true, then the filter will pass as true.

    For ([SENS.XX AND SENS.YY > Z]) to pass as true,
    SENS.XX must equal 1 and SENS.YY must be greater than Z.

    If the expression you build has a result of 1, it is evaludated as true. If it has a result of 0, it is evaludated as false.
    so according to the part I highlighted in bold its going to not be on from that statement very often as sens.xx must be 1 for it to be true no matter what sens.yy is...
    so looking at it that way.. sens.xx has no <=> associated with it..so it neds to be seperated or it will just look for a value of [sens.xx]=1 because of nothing being assigned to it?

    can it be arranged to say.. ([sens.xx] and [sens.yy])>z
    -Scott -

  11. #11
    Advanced Tuner
    Join Date
    Nov 2002
    Location
    Posts
    477
    I don't believe you can make statements like that... It's standard boolean logic, every part of the equation evaluates to 1 or 0, true or false. when AND is used then it's inclusive... all conditions must be met, OR is exclusive, only 1 or the other has to be met/true

    so ([sens.xx]>z AND [sens.yy]>z) would only pass if both conditions are met (true and true results in true, true and false is false, false and true is false, false and false is false)

    If either condition isn't met then the overall expression returns 0/fals
    Last edited by horist; 04-04-2006 at 11:48 AM.
    Mike Horist
    00 WS6 (TA) | 04 WS6 (GTP Comp G)
    Mike \\#at&\\ horist \\&dot$\\com

    BOTH cars HP Tuners Tuned

  12. #12
    Señor Tuner MeentSS02's Avatar
    Join Date
    Jun 2005
    Location
    Dayton, OH
    Posts
    1,132
    Yeah...my above example was a typo...I meant to put [SENS.XX] > C, instead of putting the AND in there right after it. But that is good info...so basically, the only limitation is that it must fit within 255 characters. Now, does a space count as a character? I usually put spaces in so it is easier to read...
    2008 Viper - now with HPToona - 1/4 Mile Shenanigans Here
    11.02 @ 130

  13. #13
    HP Tuners Owner Keith@HPTuners's Avatar
    Join Date
    Sep 2002
    Location
    Chicago, IL
    Posts
    6,397
    Scott, ([sens.xx] and [sens.yy])>z will not work. YOu need to do sens.xx > Z and sens.yy > Z

    Steven, spaces count as characters too. You can build your functions all nice and neat in a notepad, and then strip them down to fit them in VCM Scanner.
    We got this guy Not Sure, ...

  14. #14
    Senior Tuner S2H's Avatar
    Join Date
    Apr 2005
    Location
    Schexnayder Racing - Arnaudville LA
    Posts
    4,387
    my concern is that the blank [sens.xx] will always return a 0 because most likely [sens.xx] does not equal 1
    so every [sens.xx] sould be followed by a <=>
    and thats what I meant by individually
    -Scott -

  15. #15
    Señor Tuner MeentSS02's Avatar
    Join Date
    Jun 2005
    Location
    Dayton, OH
    Posts
    1,132
    Sweet...so does:

    <=

    mean less than or equal to? >= the opposite?
    2008 Viper - now with HPToona - 1/4 Mile Shenanigans Here
    11.02 @ 130

  16. #16
    HP Tuners Owner Keith@HPTuners's Avatar
    Join Date
    Sep 2002
    Location
    Chicago, IL
    Posts
    6,397
    That is not a valid operand, per this:
    http://www.hptuners.com/help/vcm_sca...ustom_pids.htm
    We got this guy Not Sure, ...

  17. #17
    Senior Tuner S2H's Avatar
    Join Date
    Apr 2005
    Location
    Schexnayder Racing - Arnaudville LA
    Posts
    4,387
    no..but you could do...
    [sens.xx]=c or [sens.xx]>c

    and I'm not sure about this..but I think you could also go
    ([sens.xx]=c or [sens.xx]>c) and [sens.yy]<d
    -Scott -

  18. #18
    Senior Tuner S2H's Avatar
    Join Date
    Apr 2005
    Location
    Schexnayder Racing - Arnaudville LA
    Posts
    4,387
    as sson as we get delta and derivative I can make a HP calculator for real time rear wheel HP
    -Scott -

  19. #19
    Señor Tuner MeentSS02's Avatar
    Join Date
    Jun 2005
    Location
    Dayton, OH
    Posts
    1,132
    Hmmmmmm...didn't think about using an OR statement in there...but if I'd read what I wrote above, it would be blatantly obvious that that is the answer. Sometimes, I'm amazed that I remember to breathe.

    I'm not sure I want to know my RWHP either...it's probably like 200 or so

    All show, no go.
    2008 Viper - now with HPToona - 1/4 Mile Shenanigans Here
    11.02 @ 130