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