Skip to content

Latest commit

 

History

History
68 lines (47 loc) · 1.23 KB

PulseGenerator.md

File metadata and controls

68 lines (47 loc) · 1.23 KB

PulseGenerator

Description

PulseGenerator class creates a pulse signal with a configurable pulse pause duration

Install this package

apax add @simatic-ax/generators

Namespace

Simatic.Ax.Generators;

Configuration

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);

Methods

Execute() Execute the clock signal. Must called cycically
Clock() : BOOL Returns the clock signal
ClockRis() : BOOL Returns the rising edge of the clock signal
ClockFal() : BOOL Returns the falling edge of the clock signal

Example

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.Clock();
      
END_PROGRAM