TrigGen (FB)

FUNCTION_BLOCK TrigGen

Short Description

Impulse generation with adjustable time interval


Portrayal

../_images/TrigGen_FB.png

Interfaces

Inputs

Name

Datatype

Range

Init-Value

Functional Description

xEn BOOL    

Enable input

wInterval WORD    

Time value for the time interval

eTimeBase eTimeMS    

Time basis for the time interval

xEnImp BOOL    

Option Enable 1st impulse

Outputs

Name

Datatype

Range

Init-Value

Functional Description

xTrig BOOL    

Impulse output

Functional Description

General

At the impulse output xTrig, impulses are generated cyclically with a duration of one program cycle and a time interval of (wInterval multiplied by eTimeBase)
when the enable input xEn is active.

Limitation of the maximum time interval

The time interval is limited to a maximum of 48 days to avoid an internal value overflow.

Example for calculating the time interval

wInterval* = 1000, eTimeBase = Millisecond, impulses are generated in a time interval of 1000ms.

../_images/TrigGen_Bild_1.png

Enable 1st impulse xEnImp

If this option is active (xEnImp = TRUE), the first impulse is generated immediately after enabling xEn.
If this option is not active (xEnImp = FALSE), the 1st impulse is generated after the time interval xEn has elapsed.

../_images/TrigGen_Bild_2.png

Visualization




Information

Element

Authors

Date

Version

Notes

Functional Description

Adam Bartod 09.2017 1.0

Initial version

Programming

Adam Bartod 09.2017 1.0

Initial version

Test Jochen Reu 10.2017 1.0

Initial version

Documentation

Jochen Reu 10.2017 1.0

Initial version

Codesys

InOut:
Scope Name Type Comment
Input xEn BOOL

Enable input

wInterval WORD

Time value for the time interval

eTimeBase eTimeMS

Time basis for the time interval

xEnImp BOOL

Option Enable 1st impulse

Output xTrig BOOL

Impulse output

tNextImp TIME

Remaining time to impulse