Register    Login    Forum    Search    FAQ

Board index » Programming Alarm Modems » TiXML




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Hours run counter
 Post Posted: Tue Oct 11, 2005 2:16 pm 
Offline
Tixi-Support-Team

Joined: Mon Oct 10, 2005 1:40 pm
Posts: 94
Location: Berlin
A hours run counter can be created using the counter function:
In this example the minutes are counted and are added up.
With the help of the division function one may do this also with hours
etc.
Using the IF condition with a trigger (e.g., digital input),
the hours run of an external device can be also counted.

Example hours run counter:
The process variable "RunCounterMinute" offers the minutes.
The process variable "RunCounterHour" offers the hours.

At first the process variable "RunCounterMinute" is defined which will contain the added up minutes later.
In addition, one may define a variable "RunCounterHour" which offers the counted hours after division by 60.
ProcessVars:
[<SetConfig _="PROCCFG" ver="y">
<ProcessVars>
<RunCounterMinute def="0"/>
<RunCounterHour>
<Value>
<LD _="/Process/PV/RunCounterMinute"/>
<LD _="60"/>
<DIV _=""/>
</Value>
</RunCounterHour>
</ProcessVars>
</SetConfig>]

As the next an Event is required which adds 1 to the process variable RunCounterMinute on each trigger.
EventHandler:
[<SetConfig _="EVENTS" ver="y">
<EventHandler>
<RunCount>
<Process>
<LD _="1"/>
<LD _="/Process/PV/RunCounterMinute"/>
<ADD _=""/>
<ST _="/Process/PV/RunCounterMinute"/>
</Process>
</RunCount>
</EventHandler>
</SetConfig>]

Then the "every minute" trigger of this event is defined using the scheduler.
Scheduler:
[<SetConfig _="SCHEDULE" ver="y">
<Schedule>
<RunCounter _="RunCount">
<Minute _="0-59"/>
</RunCounter>
</Schedule>
</SetConfig>]

Should the hours run of an external device be counted
(e.g., online signal using I/P0), so the EventHandler would have to be adapted ("IF" is available with firmware 2.0.2.). The variable RunCounterMinute becomes counted only if the input is 1.
[<SetConfig _="EVENTS" ver="y">
<EventHandler>
<RunCount>
<If _="/Process/MB/IO/I/P0">
<Process>
<LD _="1"/>
<LD _="/Process/PV/RunCounterMinute"/>
<ADD _=""/>
<ST _="/Process/PV/RunCounterMinute"/>
</Process>
</If>
</RunCount>
</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


Top 
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 1 post ] 

Board index » Programming Alarm Modems » TiXML


Who is online

Users browsing this forum: No registered users and 3 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron