User Tools

Site Tools


en-us_products:mpino_studio2:box_functions:counter

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en-us_products:mpino_studio2:box_functions:counter [2026/09/09 17:54] – 만듦 - 바깥 편집 127.0.0.1en-us_products:mpino_studio2:box_functions:counter [2026/09/10 01:05] (current) – 바깥 편집 127.0.0.1
Line 5: Line 5:
 {{ :en-us_products:mpino_studio2:counter-behavior.svg?1000 |These commands count signal transitions and provide a current value and completion state. }} {{ :en-us_products:mpino_studio2:counter-behavior.svg?1000 |These commands count signal transitions and provide a current value and completion state. }}
  
-This ladder screen shows CTU connected to a counter input condition. +===== Common Rules =====
- +
-{{ :en-us_products:mpino_studio2:ladder-counter-ctu-c11-2x.png?1000 |This ladder screen shows CTU connected to a counter input condition. }} +
- +
-===== 1. Common Rules =====+
  
 Use ''C'' for a 16-bit counter and ''DC'' for a 32-bit counter. The count changes once on each OFF-to-ON transition. A bit contact for the counter address reads its done state, and a ladder RESET coil initializes the current value. C0 through C10 are mapped to board functions on MPINO-8A4R(T)-S, so the examples on this page use C11 and C12. Use ''C'' for a 16-bit counter and ''DC'' for a 32-bit counter. The count changes once on each OFF-to-ON transition. A bit contact for the counter address reads its done state, and a ladder RESET coil initializes the current value. C0 through C10 are mapped to board functions on MPINO-8A4R(T)-S, so the examples on this page use C11 and C12.
  
-===== 2. CTU ===== +{{ :en-us_products:mpino_studio2:counter-current-done.svg?1000 |Counter current value and done state }}
- +
-**Count Up Counter** +
- +
-Increments the current value once whenever the left condition changes from OFF to ON. The done state turns ON at or above the set value, and counting stops at the maximum value. +
- +
-**Syntax:** ''CTU C11 3'' +
- +
-^ Run condition ^ Before ^ Command entered ^ Expected result ^ +
-Left condition ON | C11=0 | ''CTU C11 3'' | 3 rising edges → C11=3, C11 done contact=ON | +
- +
-===== 3. CTD ===== +
- +
-**Count Down Counter** +
- +
-Preloads the current value with the set value, then decrements it once on each rising edge of the left condition. The done state turns ON at zero, where counting stops. +
- +
-**Syntax:** ''CTD C12 3'' +
- +
-^ Run condition ^ Before ^ Command entered ^ Expected result ^ +
-| Left condition ON | C12=3 | ''CTD C12 3'' | 3 rising edges → C12=0, C12 done contact=ON | +
- +
-===== 4. CTUD ===== +
- +
-**Count Up/Down Counter** +
- +
-While the left condition is ON, a rising edge on the up input adds one and a rising edge on the down input subtracts one. If both rise in the same scan, the value does not change. +
- +
-**Syntax:** ''CTUD C11 M0 M1 3'' +
- +
-^ Run condition ^ Before ^ Command entered ^ Expected result ^ +
-| Left condition ON | C11=0 | ''CTUD C11 M0 M1 3'' | M0 ×2, M1 ×1 → C11=1 |+
  
-===== 5. Troubleshooting =====+===== Box Function List =====
  
-Symptom What to check +Command Meaning 
-I expected the value to keep increasing while holding the button. | counter changes its value only once on each rising edge. | +[[en-us_products:mpino_studio2:box_functions:counter:ctu|CTU]] | Increments the current value once whenever the left condition changes from OFF to ON. | 
-CTD does not decrease below zero. CTD stops at its lower limit of zero. |+| [[en-us_products:mpino_studio2:box_functions:counter:ctd|CTD]] | Preloads the current value with the set value, then decrements it once on each rising edge of the left condition. | 
 +[[en-us_products:mpino_studio2:box_functions:counter:ctud|CTUD]] | While the left condition is ON, a rising edge on the up input adds one and a rising edge on the down input subtracts one. |
  
 ===== Related Documentation ===== ===== Related Documentation =====
  
   * [[en-us_products:mpino_studio2:box_functions|Phase 4 · Box Functions]]   * [[en-us_products:mpino_studio2:box_functions|Phase 4 · Box Functions]]
-  * [[en-us_products:mpino_studio2:box_functions:timer|Timer Box Functions]] 
-  * [[en-us_products:mpino_studio2:box_functions:bit_latch|Bit and Latch Box Functions]] 
   * [[en-us_products:mpino_studio2|MPINO STUDIO 2 User Manual]]   * [[en-us_products:mpino_studio2|MPINO STUDIO 2 User Manual]]
  
en-us_products/mpino_studio2/box_functions/counter.1788944071.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki