In ladder diagram of LDMicro a counter instruction increases is value up on the input change from false to true. LDMicro classifies a counter into two categories - counter and circular counter. Here, we discuss about a counter only.
A counter divides into two instructions - Counter Up (CTU) and Counter Down (CTD) instruction.
CTU and CTD instruction |
Counter Up (CTU) instruction
A CTU increases its content by one whenever its input changes from false to true. This instruction output true when ever its content rolls over the preset value.
A property setting of CTU |
- Name - CTU identifier
- Start value - CTU initial value
- True if - set the value of output true condition from CTU
- Input kind - '\' for true to false and '/' for false to true.
Counter Down (CTD) instruction
Similarly, a CTD decrease its content whenever its input change state. It output true whenever its content drop below the preset value.
CTD instruction property |
A simple ladder diagram example shows a CTD that output true when its decrement content is less than -3.
Here MCU selection is not important. It could be any target up ton the user. Click here if you wish to download the ladder diagram of this working example.
No comments:
Post a Comment