adapnex::core::TP
A pulse timer that generates a pulse with a defined pulse duration.
Description
As soon as input IN becomes true, output Q becomes true and remains so for the full duration PT, irrespective of the state of IN.
| Parameter | Type | Direction | Description |
|---|---|---|---|
|
|
Input |
The rising edge triggers the start of the pulse. |
|
|
Input |
The duration of the generated pulse. |
|
|
Output |
Becomes |
|
|
Output |
The current elapsed time, incrementing while |
Common Use Case
Triggering a specific mechanism such as a glue gun shot or ejector that requires a guaranteed active time.
Example: Ejector Trigger
class EjectorTask : public Task {
public:
bool sensor_trigger = false;
bool ejector_valve = false;
private:
TP pulse_gen;
void Update() override {
// Fire ejector for exactly 50ms upon trigger.
pulse_gen(sensor_trigger, 50ms, ejector_valve);
}
};
|
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 |
As long as Q is true, the duration in ET is incremented until the value reaches PT. It then remains equal to PT. |
|
Input that triggers the start of the pulse. |
|
Input defining the duration of the pulse. |
|
Output that produces the defined pulse. If IN is false, the output Q is false. As soon as IN is true, Q becomes true and remains so for the duration PT, irrespective of the state of the input IN. |
Created with MrDocs