Challenge - 5 Problems
Counter Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediateOutput of a preset counter after input pulses
Given a counter with a preset value of 5 and an initial count of 0, what will be the counter value after 3 input pulses without reset?
PLC Programming
Preset = 5 Count = 0 Input pulses = 3 Reset = False For each pulse: Count = Count + 1 If Count >= Preset: Counter Done = True Else: Counter Done = False Output Count
Attempts:
2 left
💡 Hint
Count increases by one for each pulse until it reaches the preset.
✗ Incorrect
The counter increments by 1 for each pulse. After 3 pulses, the count is 3, which is less than the preset 5, so the count remains 3.
💻 Command Output
intermediateCounter value after reset is triggered
A counter has a preset of 10 and current count of 7. If a reset signal is activated, what will be the counter value immediately after reset?
PLC Programming
Preset = 10 Count = 7 Reset = True If Reset == True: Count = 0 Output Count
Attempts:
2 left
💡 Hint
Reset sets the counter back to zero.
✗ Incorrect
When reset is true, the counter value is set to zero regardless of previous count.
🧠 Conceptual
advancedEffect of preset value on counter done signal
If a counter has a preset value of 8 and counts input pulses, at which count value does the 'done' signal become true?
Attempts:
2 left
💡 Hint
The done signal activates exactly when the count reaches the preset.
✗ Incorrect
The done signal becomes true when the count matches the preset value, indicating the counter reached its target.
💻 Command Output
advancedCounter behavior with preset and multiple resets
A counter has a preset of 4. It receives 2 pulses, then a reset, then 3 pulses. What is the final count?
PLC Programming
Preset = 4 Count = 0 # 2 pulses Count += 2 # Reset Count = 0 # 3 pulses Count += 3 Output Count
Attempts:
2 left
💡 Hint
Reset clears the count before the last pulses.
✗ Incorrect
After 2 pulses, count is 2. Reset sets count to 0. Then 3 pulses increase count to 3.
🚀 Application
expertDetermining counter output after complex pulse and reset sequence
A counter with preset 6 starts at 0. It receives pulses in this order: 3 pulses, reset, 2 pulses, reset, 6 pulses. What is the final count and is the done signal true or false?
PLC Programming
Preset = 6 Count = 0 Done = False # 3 pulses Count += 3 # Reset Count = 0 # 2 pulses Count += 2 # Reset Count = 0 # 6 pulses Count += 6 Done = (Count >= Preset) Output Count and Done
Attempts:
2 left
💡 Hint
Reset clears count before next pulses; done is true if count >= preset.
✗ Incorrect
After final 6 pulses, count equals preset 6, so done is true.
