PulseGenerator class creates a pulse signal with a configurable pulse pause duration
apax add @simatic-ax/generators
Simatic.Ax.Generators;
| PulseTime | Defines the pulse time for the signal |
| PauseTime | Defines the pause time for the signal |
Example configuration in a VAR section
clock : PulseGenerator := (PulseTime := T#0.5s, PauseTime := T#0.5s);
| Execute() | Execute the clock signal. Must called cycically |
| Q() : BOOL | Returns the clock signal |
| QRis() : BOOL | Returns the rising edge of the clock signal |
| QFal() : BOOL | Returns the falling edge of the clock signal |
USING Simatic.Ax.Generators;
CONFIGURATION MyConfiguration
TASK Main(Priority := 1);
PROGRAM P1 WITH Main: MainProgram;
VAR_GLOBAL
clock : PulseGenerator := (PulseTime := T#0.5s, PauseTime := T#0.5s);
clk : BOOL;
END_VAR
END_CONFIGURATION
PROGRAM MainProgram
VAR_EXTERNAL
clock : PulseGenerator;
clk : BOOL;
END_VAR
clock.Execute();
clk := clock.Q();
END_PROGRAM