adapnex::core::TON
An on‐delay timer that delays the rising edge of a signal by a defined duration.
Description
Output Q becomes true only after input IN has been true continuously for the duration PT. If IN goes false before PT elapses, the timer resets.
| Parameter | Type | Direction | Description |
|---|---|---|---|
|
|
Input |
Starts the timer with a rising edge and resets it with a falling edge. |
|
|
Input |
The preset time that must pass before the output is set. |
|
|
Output |
Becomes |
|
|
Output |
The current elapsed time, incrementing up to |
Example: Motor Start Delay
class MotorTask : public Task {
public:
bool start_button = false;
bool motor_on = false;
private:
TON delay_timer;
void Update() override {
// If start_button is held for 2s, the motor turns on.
delay_timer(start_button, 2s, motor_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 false, the ET output is 0. As soon as IN is true, the duration in ET is incremented until the value reaches PT. It then remains equal to PT. |
|
Input that starts the timer with a rising edge and resets the timer with a falling edge. |
|
Input defining the time that must pass before Q is set. |
|
Output that has a rising edge when the duration specified in PT has passed. Q is true, if IN is true and ET is equal to PT. Otherwise, Q is false. |
Created with MrDocs