This documentation is out of date.
The new version of the documentation is here: https://cannylogic.com/docs |
Difference between revisions of "Counter"
From CANNY Wiki
[unchecked revision] | [unchecked revision] |
(Created page with " <div style="float:right;margin:5px;"> {|class="cannytable" width="350px" |- !colspan="2" style="background-color:#AFEEEE;"|Appearance |- |colspan="2" align="center" style="...") |
m |
||
(3 intermediate revisions by one other user not shown) | |||
Line 14: | Line 14: | ||
!colspan="2" style="background-color:#AFEEEE;"|Group | !colspan="2" style="background-color:#AFEEEE;"|Group | ||
|- | |- | ||
− | |colspan="2" align="center"|[[Built-in Function Blocks#Counters and Edge Detectors]] | + | |colspan="2" align="center"|[[Built-in Function Blocks#Counters and Edge Detectors | Counters and Edge Detectors]] |
|- | |- | ||
!colspan="2" style="background-color:#AFEEEE;"|Inputs | !colspan="2" style="background-color:#AFEEEE;"|Inputs | ||
Line 25: | Line 25: | ||
|- | |- | ||
|style="padding-left:1em;"|Reset: | |style="padding-left:1em;"|Reset: | ||
− | |style="padding-left:1em;"|[[CFD Language#Data| | + | |style="padding-left:1em;"|[[CFD Language#Data|Logical]] |
|- | |- | ||
!colspan="2" style="background-color:#AFEEEE;"|Outputs | !colspan="2" style="background-color:#AFEEEE;"|Outputs | ||
|- | |- | ||
− | |style="padding-left:1em;"| | + | |style="padding-left:1em;"|Result: |
|style="padding-left:1em;"|[[CFD Language#Data|Integer]] | |style="padding-left:1em;"|[[CFD Language#Data|Integer]] | ||
|- | |- | ||
Line 44: | Line 44: | ||
<div> | <div> | ||
− | + | At zero value on input "Reset": on each rising edge (change in values from zero to non-zero) on the input "increment" is adding 1 to the "Result" value, and on each rising edge (change in values from zero to non-zero) at the input to "Decrement" is subtracted 1 from the output. | |
− | + | At non-zero value on input "Reset", sets the output value to zero. | |
</div> | </div> | ||
</div> | </div> | ||
<br clear="left"> | <br clear="left"> | ||
− | == | + | == Features == |
− | + | The output value is 16-bit, with the overflow. In other words, the result can not exceed 65535. In case of increasing output value over 65535, the result will be zero, and in case of reducing output value below zero, the result will be 65535. | |
+ | |||
− | == | + | == Examples == |
{| | {| | ||
|- | |- |
Latest revision as of 19:56, 13 December 2016
Appearance | |
---|---|
Symbol | |
COUNT | |
Group | |
Counters and Edge Detectors | |
Inputs | |
Increment: | Logical |
Decrement: | Logical |
Reset: | Logical |
Outputs | |
Result: | Integer |
Version CANNY Lab | |
from 0.6b |
At zero value on input "Reset": on each rising edge (change in values from zero to non-zero) on the input "increment" is adding 1 to the "Result" value, and on each rising edge (change in values from zero to non-zero) at the input to "Decrement" is subtracted 1 from the output.
At non-zero value on input "Reset", sets the output value to zero.
Features
The output value is 16-bit, with the overflow. In other words, the result can not exceed 65535. In case of increasing output value over 65535, the result will be zero, and in case of reducing output value below zero, the result will be 65535.