Bird
Raised Fist0
PLC Programmingscripting~10 mins

Counter preset and reset in PLC Programming - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Counter preset and reset
Start
↓
Counter Enabled?
No→Hold Count
Yes↓
Increment Count
↓
Check Preset Reached?
Yes→Set Output ON
↓
Wait for Reset
↓
Check Reset Signal?
Yes→Reset Count to 0
No↓
Loop Back to Counter Enabled?
The counter increases when enabled, sets output when preset is reached, and resets count when reset signal is active.
Execution Sample
PLC Programming
COUNTER C1
PRESET 3
RESET R
ENABLE E
OUTPUT Q

// Each cycle: if E=1, count++ until 3, Q=1; if R=1, count=0, Q=0
This PLC counter counts up to 3 when enabled, sets output, and resets on reset signal.
Execution Table
CycleEnable (E)Reset (R)Count BeforeCount AfterPreset Reached?Output (Q)
11001No0
21012No0
31023Yes1
41033Yes1
51130No0
61001No0
70011No0
80110No0
💡 Simulation stops after 8 cycles demonstrating preset and reset behavior.
Variable Tracker
VariableStartAfter 1After 2After 3After 4After 5After 6After 7After 8
Count012330110
Output Q000110000
Key Moments - 3 Insights
Why does the count not increase after reaching the preset value?
Once the count reaches the preset (3), the output Q is set and the count holds at 3 until reset, as shown in cycles 3 and 4 in the execution_table.
What happens to the count and output when the reset signal is activated?
When reset (R) is 1, the count resets to 0 and output Q turns off immediately, as seen in cycle 5 of the execution_table.
Why does the count stay the same when enable is 0?
If enable (E) is 0, the counter does not increment and holds its current count, demonstrated in cycles 7 and 8 where count stays at 1 and then resets on reset.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at cycle 3. What is the output Q value?
A1
B0
C3
DReset
💡 Hint
Check the 'Output (Q)' column for cycle 3 in the execution_table.
At which cycle does the count reset to 0?
ACycle 4
BCycle 6
CCycle 5
DCycle 7
💡 Hint
Look at the 'Count After' column and the 'Reset (R)' signal in the execution_table.
If enable (E) is 0, what happens to the count?
AIt increments by 1
BIt stays the same
CIt resets to 0
DIt sets output Q to 1
💡 Hint
Check cycles 7 and 8 in the execution_table where E=0 and observe 'Count After'.
Concept Snapshot
Counter preset and reset in PLC:
- Counter increments when enabled.
- Output sets ON when count reaches preset.
- Reset signal clears count and output.
- Count holds at preset until reset.
- Enable must be ON to count up.
Full Transcript
This visual execution trace shows how a PLC counter works with preset and reset. The counter increases its count each cycle when enabled. When the count reaches the preset value of 3, the output turns ON and the count holds steady. If the reset signal activates, the count resets to zero and output turns OFF. If enable is OFF, the count does not increase and holds its value. The execution table tracks each cycle's enable, reset, count before and after, preset check, and output. The variable tracker shows how count and output change over time. Key moments clarify why count stops increasing at preset, what reset does, and how enable affects counting. The quiz tests understanding of output at preset, reset timing, and behavior when enable is off.

Practice

(1/5)
1. What does the preset value in a PLC counter do?
easy
A. It sets the target count the counter must reach.
B. It resets the counter to zero.
C. It increments the counter by one.
D. It pauses the counter from counting.

Solution

  1. Step 1: Understand the role of preset in counters

    The preset value defines the goal number the counter counts up to before triggering an action.
  2. Step 2: Differentiate preset from reset and increment

    Reset clears the count, increment adds to count, but preset sets the target number.
  3. Final Answer:

    It sets the target count the counter must reach. -> Option A
  4. Quick Check:

    Preset = target count [OK]
Hint: Preset is the goal number, reset clears count [OK]
Common Mistakes:
  • Confusing preset with reset
  • Thinking preset increments count
  • Assuming preset pauses counting
2. Which of the following is the correct way to reset a counter named CNT1 in ladder logic?
easy
A. Use RES CNT1 instruction.
B. Use PRE CNT1 instruction.
C. Use INC CNT1 instruction.
D. Use SET CNT1 instruction.

Solution

  1. Step 1: Identify reset instruction syntax

    In PLC ladder logic, RES is the standard instruction to reset a counter.
  2. Step 2: Confirm other instructions meanings

    PRE sets preset, INC increments, SET sets bits, not reset counter.
  3. Final Answer:

    Use RES CNT1 instruction. -> Option A
  4. Quick Check:

    Reset = RES instruction [OK]
Hint: Reset uses RES instruction, not PRE or INC [OK]
Common Mistakes:
  • Using PRE instead of RES to reset
  • Confusing increment with reset
  • Using SET which is for bits, not counters
3. Given a counter with preset 5 and current count 3, what will be the count after two increments?
medium
A. 4
B. 5
C. 3
D. 6

Solution

  1. Step 1: Calculate count after increments

    Starting count is 3, two increments add 2, so 3 + 2 = 5.
  2. Step 2: Compare count to preset

    The count reaches the preset value 5 after two increments.
  3. Final Answer:

    5 -> Option B
  4. Quick Check:

    3 + 2 = 5 [OK]
Hint: Add increments to current count, compare to preset [OK]
Common Mistakes:
  • Not adding increments correctly
  • Confusing preset with current count
  • Assuming count resets automatically
4. A PLC counter is not resetting when the reset button is pressed. Which of these is the most likely cause?
medium
A. The preset value is set too high.
B. The increment instruction is used instead of reset.
C. The counter is already at zero.
D. The reset instruction is missing or not connected to the reset button.

Solution

  1. Step 1: Check reset wiring and instruction

    If the reset button does not trigger reset, likely the reset instruction is missing or not linked to the button.
  2. Step 2: Eliminate other causes

    Preset value or current count does not prevent reset; increment instruction wrong but would not cause no reset on button press.
  3. Final Answer:

    The reset instruction is missing or not connected to the reset button. -> Option D
  4. Quick Check:

    Reset fails if instruction missing or unlinked [OK]
Hint: Reset needs instruction linked to button [OK]
Common Mistakes:
  • Blaming preset for reset failure
  • Ignoring wiring or logic connection
  • Confusing increment with reset
5. You want a counter to count up to 10, then reset automatically and start counting again from zero. Which ladder logic setup achieves this?
hard
A. Set preset to 0, increment counter indefinitely.
B. Set preset to 10, reset counter manually with a button.
C. Set preset to 10, use counter done bit to trigger reset instruction.
D. Use reset instruction before counting starts only.

Solution

  1. Step 1: Understand automatic reset logic

    To reset automatically, use the counter's done bit (which is true when count reaches preset) to trigger the reset instruction.
  2. Step 2: Evaluate other options

    Manual reset requires user action, preset 0 is invalid for counting, resetting only before counting won't loop.
  3. Final Answer:

    Set preset to 10, use counter done bit to trigger reset instruction. -> Option C
  4. Quick Check:

    Done bit triggers reset for auto count loop [OK]
Hint: Use done bit to auto reset counter [OK]
Common Mistakes:
  • Relying on manual reset for auto counting
  • Setting preset to zero
  • Resetting only once before counting
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard