Because there was already a request for a "counter" function, here a working example to count impulses by the Alarm Modem digital input P0 using math operations.
At first an process variable "counter" with start value 0 is defined.
ProcessVars:
[<SetConfig _="PROCCFG" ver="y">
<ProcessVars>
<Counter def="0"/>
</ProcessVars>
</SetConfig>]
There follows an EventState which triggers an Event "Count" with every impulse (flank High) at the input P0.
EventState:
[<SetConfig _="PROCCFG" ver="y">
<EventStates>
<Count>
<Enabled _="TRUE"/>
<ProcessVar _="Process/MB/IO/I/P0" flank="high"/>
<Event _="Count">
</Event>
</Count>
</EventStates>
</SetConfig>]
The Event adds the positive state of the input P0 by means of instruction ADD to the before defined aprocess variable "counter" and writes back the new value in the same.
EventHandler:
[<SetConfig _="EVENTS" ver="y">
<EventHandler>
<Count>
<Process>
<LD _="/Process/MB/IO/I/P0"/>
<LD _="/Process/PV/Counter"/>
<ADD _=""/>
<ST _="/Process/PV/Counter"/>
</Process>
</Count>
</EventHandler>
</SetConfig>]
_________________
Tixi Support Team
E-Mail-Support, Mo-Fr, 9:00am - 5:00pm,
Tixi-Support@tixi.com
Support-Hotline, Mo-Fr, 9:00am - 5:00pm, +49-30-406 08 300