Compare Input » History » Version 2
Adam Klama, 05/06/2025 02:33 PM
| 1 | 1 | Adam Klama | # Compare Input |
|---|---|---|---|
| 2 | |||
| 3 | The Compare Input block evaluates a selectable signal against a defined condition using flexible comparison logic. It can be used to monitor system states, trigger events, or activate logic transitions based on real-time signal values. |
||
| 4 | |||
| 5 | 1. Input Source |
||
| 6 | The user can select any available system signal as the input to the comparison block. This could include analog or digital measurements such as temperature, pressure, or speed. |
||
| 7 | |||
| 8 | 2. Comparison Modes |
||
| 9 | The mode determines how the input signal is compared to a user-defined threshold (Value). Supported modes: |
||
| 10 | |||
| 11 | Equal: |
||
| 12 | |||
| 13 | Output is triggered only when the input signal is exactly equal to Value. |
||
| 14 | |||
| 15 | Deviation is forcibly set to zero in this mode — no tolerance or hysteresis applies. |
||
| 16 | |||
| 17 | Best suited for discrete signal matching or edge conditions. |
||
| 18 | |||
| 19 | Window Compare: |
||
| 20 | |||
| 21 | Output is true when the input lies within the range Value ± Deviation. |
||
| 22 | |||
| 23 | Output is false when the signal is outside this range. |
||
| 24 | |||
| 25 | Useful for checking whether a signal is inside a safe or valid range. |
||
| 26 | |||
| 27 | LessThan / GreaterThan (with hysteresis): |
||
| 28 | These modes compare the signal relative to a threshold and apply hysteresis to prevent toggling due to small signal oscillations: |
||
| 29 | |||
| 30 | LessThan: |
||
| 31 | |||
| 32 | Output switches on when signal < Value - Deviation |
||
| 33 | |||
| 34 | Output switches off when signal > Value + Deviation |
||
| 35 | |||
| 36 | GreaterThan: |
||
| 37 | |||
| 38 | Output switches on when signal > Value + Deviation |
||
| 39 | |||
| 40 | Output switches off when signal < Value - Deviation |
||
| 41 | |||
| 42 | 3. Value |
||
| 43 | The central reference value used in all comparison calculations. |
||
| 44 | |||
| 45 | 4. Deviation |
||
| 46 | Defines the hysteresis band around the Value. |
||
| 47 | |||
| 48 | Used in Window, LessThan, and GreaterThan modes. |
||
| 49 | |||
| 50 | Helps prevent output instability due to signal noise or fluctuations near the threshold. |
||
| 51 | |||
| 52 | Not used in Equal mode (forced to 0). |
||
| 53 | |||
| 54 | 5. Filter Enable |
||
| 55 | This flag controls how the input signal is processed and how timing logic (Delay and Cooldown) behaves: |
||
| 56 | |||
| 57 | Filter Disabled: |
||
| 58 | |||
| 59 | The Compare Input works in level-based mode. |
||
| 60 | |||
| 61 | The output reacts immediately to threshold crossings. |
||
| 62 | |||
| 63 | Delay and Cooldown are ignored. |
||
| 64 | |||
| 65 | Filter Enabled: |
||
| 66 | |||
| 67 | The Compare Input switches to event-based behavior. |
||
| 68 | |||
| 69 | Triggers are detected on rising/falling transitions of the condition. |
||
| 70 | |||
| 71 | Delay and Cooldown become active and fully evaluated: |
||
| 72 | |||
| 73 | Ensures stable detection and prevents false triggering from transient conditions. |
||
| 74 | |||
| 75 | 6. Delay |
||
| 76 | Applies only when Filter is Enabled. |
||
| 77 | |||
| 78 | The condition must remain continuously valid for the full Delay time before the output is activated. |
||
| 79 | |||
| 80 | Used to suppress short-term glitches or noise. |
||
| 81 | |||
| 82 | 7. Cooldown |
||
| 83 | Also applies only when Filter is Enabled. |
||
| 84 | |||
| 85 | Defines the minimum time that must pass after the end of the previous trigger before a new trigger can be accepted. |
||
| 86 | |||
| 87 | This ensures stability by preventing immediate retriggering after condition resets. |
||
| 88 | |||
| 89 | Example Configuration |
||
| 90 | Input: Coolant Temperature |
||
| 91 | |||
| 92 | Mode: LessThan |
||
| 93 | |||
| 94 | Value: 80 |
||
| 95 | |||
| 96 | Deviation: 3 |
||
| 97 | |||
| 98 | Filter Enable: Enabled |
||
| 99 | |||
| 100 | Delay: 50 ms |
||
| 101 | |||
| 102 | Cooldown: 200 ms |
||
| 103 | |||
| 104 | Behavior: |
||
| 105 | |||
| 106 | Output activates when the signal drops below 77°C and stays there for at least 50 ms. |
||
| 107 | |||
| 108 | Once the condition ends (temperature rises above 83°C), the system waits 200 ms before allowing the next trigger. |