Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cbus to Comfort comands HELP
#8
Why don\'t you try using only two counters.

Counter1 counts from 0-255, as soon as you add another to counter 1 it wraps to 0 and then you set Counter 1 to 1 and you can count again from 0-255 using Counter1. When you get to another 255 then add 1 to Counter 2 etc.

This way you can count to huge numbers. Counter 2 will always show how many times Counter 1 overflowed. For the value 1000 you will have the following:

Counter 1 = 232

Counter 2 = 3

The calculation is then 232 + (3 * 256) = 1000. For 64201 it will be 201 + (250 * 256).

That is if my maths are correct :-) How to implement it in Comfort is another story... I haven\'t done it myself but I am sure it\'s not too difficult.

Ingo
Reply


Messages In This Thread
[No subject] - by - 04-18-2011, 05:56 PM
[No subject] - by - 04-18-2011, 08:15 PM
[No subject] - by - 04-24-2011, 04:17 AM
[No subject] - by - 04-24-2011, 04:20 AM
[No subject] - by - 04-24-2011, 04:22 AM
[No subject] - by - 04-24-2011, 04:22 AM
[No subject] - by - 05-31-2011, 09:21 AM
[No subject] - by - 05-31-2011, 09:52 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)