Comfort Home Automation/ Security System Forums Home
Home Search search Menu menu Not logged in - Login | Register

add counters
 Moderated by: admin
 New Topic   Reply   Printer Friendly 
 Rate Topic 
AuthorPost
 Posted: Saturday Apr 4th, 2015 04:00 am
   PM  Quote  Reply 
1st Post
batman
Member
 

Joined: Sunday Jul 9th, 2006
Location: Paço De Arcos, Portugal
Posts: 18
Status: 
Offline

  back to top

Thus anybody know how to add the values of two counters and load ir on a third counter.
My problem is i have a counter temperature and a counter ventilation and i want to add this two counters and the result load on a counter called IRCode.



 Posted: Saturday Apr 4th, 2015 08:27 am
   PM  Quote  Reply 
2nd Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 4375
Status: 
Offline

  back to top

There is no direct way to add 2 counters

There may be an indirect way  because there is an action to subtract counter from last action value

Get Counter Counter001
Get Negative
Set Counter002
Get Counter Counter003
Subtract Counter002
Set Counter004

This adds counter 3 to counter 1 and saves in counter 4

counter 2 is used to hold the negative value of counter 1
counter 3 - counter 2 should be the same as counter 3 + counter 1

but I am not able to test tihs now



 Posted: Saturday Apr 4th, 2015 03:47 pm
   PM  Quote  Reply 
3rd Post
Ingo
UCM Pi Users


Joined: Sunday Jan 21st, 2007
Location: South Africa
Posts: 546
Status: 
Offline

  back to top

Chiu, I tested it and it works perfectly.



 Posted: Saturday Apr 4th, 2015 07:26 pm
   PM  Quote  Reply 
4th Post
batman
Member
 

Joined: Sunday Jul 9th, 2006
Location: Paço De Arcos, Portugal
Posts: 18
Status: 
Offline

  back to top

Thanks it works perfectly, perhaps next configurator we have this implementation directly.



 Posted: Saturday Apr 4th, 2015 07:29 pm
   PM  Quote  Reply 
5th Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 4375
Status: 
Offline

  back to top

Thanks ingo
It is rare for something to work right first time



 Current time is 08:09 pm
Top




UltraBB 1.172 Copyright © 2007-2014 Data 1 Systems