20-sim webhelp > Language Reference > Functions > Event > frequencyevent


frequencyevent

Navigation:  Language Reference > Functions > Event >

frequencyevent

Previous pageReturn to chapter overviewNext page

Syntax

y = frequencyevent(p,o);

Description

y becomes true every time when p [s] have passed. The function starts after an offset of o [s]. The offset parameter is optional.  This function is a time event function.

Examples

parameters

 real period = 0.1 {s};

 real offset = 0.005 {s};

variables

 boolean y,z;

equations

 y = frequencyevent(1);                        // y = true every second

 z = frequencyevent(period,offset);        // z = true at 0.005 s, 0.105 s, 0.205 s etc.

 

Limitations

y must be a boolean, p and o must be a parameter or a constant.