adapnex::core::TOF
An off‐delay timer that delays the falling edge of a signal by a defined duration.
Description
Output Q becomes true immediately when input IN is true. When IN falls to false, Q remains true for the duration PT before turning off.
| Parameter | Type | Direction | Description |
|---|---|---|---|
|
|
Input |
Starts the timer delay with a falling edge and resets it with a rising edge. |
|
|
Input |
The preset time that must pass after |
|
|
Output |
Remains |
|
|
Output |
The current elapsed time, incrementing while |
Example: Cooling Fan Control
class CoolingTask : public Task {
public:
bool machine_running = false;
bool fan_on = false;
private:
TOF off_delay;
void Update() override {
// Keep fan running for 10s after machine stops running.
off_delay(machine_running, 10s, fan_on);
}
};
|
Timers maintain internal state across cycles and must be instantiated as member variables of a task rather than local variables within Update(). |
Data Members
Name |
Description |
If IN is true, the ET output is 0. As soon as IN is false, the duration in ET is incremented until the value reaches PT. It then remains equal to PT. |
|
Input that starts the timer with a falling edge and resets the timer with a rising edge. |
|
Input defining the time that must pass before Q is reset. |
|
Output that has a falling edge when the duration specified in PT has passed. Q is false, if IN is false and ET is equal to PT. Otherwise, Q is true. |
Created with MrDocs