How to compare values?

Discussion in 'Mapping Questions & Discussion' started by takabuschik, Mar 3, 2016.

  1. takabuschik

    aa takabuschik

    Messages:
    663
    Positive Ratings:
    316
    I want to compare a value from a math_counter to 0. When it gets bigger than 0, it should trigger a logic_relay, and when it becomes equal to 0, it should trigger a different logic relay.
    Basically:
    Problem is, I have no idea how to do that. Any ideas?
     
  2. Exactol

    aa Exactol Certified Hammer Hacker

    Messages:
    399
    Positive Ratings:
    463
    Maybe logic_compare?
     
    • Thanks Thanks x 1
    • Agree Agree x 1
  3. Requiesta

    Requiesta L1: Registered

    Messages:
    26
    Positive Ratings:
    12
    Run the outvalue into a logic_case perhaps?
     
  4. The Asylum

    aa The Asylum

    Messages:
    1,658
    Positive Ratings:
    439
    This is basically what logic_compare is for
     
    • Thanks Thanks x 1
  5. takabuschik

    aa takabuschik

    Messages:
    663
    Positive Ratings:
    316
    Well, this certainly helps, but the problem is the vdc documentation about what's a logic_compare is very confusing, to say the least.
    Right now the math_counter has the following output logic:
    Code:
     OutValue,  logic_compare,  Compare 
    .
    Then, the logic_compare has the output logic:
    Code:
     OnEqualTo,  relay_0,  Trigger 
    and
    Code:
     OnGreaterThan,  relay_1,  Trigger 
    . But how do you cause it to compare?
     
  6. Dr. Orange

    Dr. Orange L6: Sharp Member

    Messages:
    368
    Positive Ratings:
    278
    The Compare input will compare two already given values. You'll probably want to use SetValueCompare to both give the math_counter's value AND compare it at the same time.
     
    • Thanks Thanks x 1