Bird
Raised Fist0
PLC Programmingscripting~10 mins

Count-down counter (CTD) behavior in PLC Programming - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize the CTD counter preset value.

PLC Programming
CTD_Counter.Preset := [1];
Drag options to blanks, or click blank then click option'
ACounterValue
B10
CReset
DInput
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name instead of a number for the preset.
Assigning a reset signal to the preset.
2fill in blank
medium

Complete the code to decrement the CTD counter when the input is active.

PLC Programming
IF [1] THEN
  CTD_Counter.Count := CTD_Counter.Count - 1;
END_IF;
Drag options to blanks, or click blank then click option'
AInput
BReset
CPreset
DOutput
Attempts:
3 left
💡 Hint
Common Mistakes
Using the reset signal instead of the input signal.
Using the output signal as the condition.
3fill in blank
hard

Fix the error in the code to reset the CTD counter correctly.

PLC Programming
IF [1] THEN
  CTD_Counter.Count := CTD_Counter.Preset;
END_IF;
Drag options to blanks, or click blank then click option'
AInput
BOutput
CCount
DReset
Attempts:
3 left
💡 Hint
Common Mistakes
Using the input signal instead of reset.
Trying to reset using the output or count variables.
4fill in blank
hard

Fill both blanks to check if the CTD counter has reached zero and set the output.

PLC Programming
IF CTD_Counter.Count [1] 0 THEN
  CTD_Counter.[2] := TRUE;
ELSE
  CTD_Counter.Output := FALSE;
END_IF;
Drag options to blanks, or click blank then click option'
A<=
BCount
COutput
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of '<=' for the count check.
Setting the count variable instead of output to TRUE.
5fill in blank
hard

Fill all three blanks to create a dictionary that maps counter names to their current counts if counts are above zero.

PLC Programming
ActiveCounters := { [1]: [2] for [1], [2] in Counters.items() if [2] > 0 };
Drag options to blanks, or click blank then click option'
Aname
Bcount
Dcounter
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same variable name for both key and value.
Not filtering counts greater than zero.

Practice

(1/5)
1. What does a Count-down counter (CTD) do in a PLC program?
easy
A. It resets the count value to zero automatically.
B. It increases a count value each time an input signal is active.
C. It decreases a count value each time an input signal is active.
D. It counts the number of times a timer has finished.

Solution

  1. Step 1: Understand CTD basic function

    A Count-down counter decreases its count value when triggered by an input signal.
  2. Step 2: Compare options with CTD behavior

    Only It decreases a count value each time an input signal is active. describes decreasing the count on input signal activation, matching CTD behavior.
  3. Final Answer:

    It decreases a count value each time an input signal is active. -> Option C
  4. Quick Check:

    CTD decreases count on input = C [OK]
Hint: CTD always counts down, not up or reset automatically [OK]
Common Mistakes:
  • Confusing CTD with count-up counter
  • Thinking CTD resets count automatically
  • Assuming CTD counts timer completions
2. Which of the following is the correct syntax to declare a CTD counter named CTD1 with a preset value of 10 in a typical PLC program?
easy
A. CTD1.CNT := 10;
B. CTD1.PV = 10;
C. CTD1.PRESET = 10;
D. CTD1.PRE := 10;

Solution

  1. Step 1: Identify correct preset syntax

    In PLCs, the preset value for counters is often set with the .PRE property using := for assignment.
  2. Step 2: Check each option

    CTD1.PRE := 10; uses CTD1.PRE := 10; which is correct syntax. Others use incorrect property names or assignment operators.
  3. Final Answer:

    CTD1.PRE := 10; -> Option D
  4. Quick Check:

    Preset uses .PRE and := assignment = A [OK]
Hint: Preset value uses .PRE and := in PLC counters [OK]
Common Mistakes:
  • Using wrong property names like PV or PRESET
  • Using = instead of := for assignment
  • Assigning count value instead of preset
3. Given a CTD counter with preset 5 and current count 3, what will be the count after one input pulse activates the count-down input?
medium
A. 2
B. 5
C. 3
D. 4

Solution

  1. Step 1: Understand CTD count behavior on input pulse

    Each input pulse decreases the current count by 1, but never below zero.
  2. Step 2: Calculate new count

    Starting from 3, after one pulse, count becomes 3 - 1 = 2.
  3. Final Answer:

    2 -> Option A
  4. Quick Check:

    3 - 1 = 2 [OK]
Hint: Count decreases by one per input pulse, never below zero [OK]
Common Mistakes:
  • Adding instead of subtracting count
  • Not changing count on input pulse
  • Resetting count to preset incorrectly
4. A CTD counter is not decreasing its count when the input signal is active. Which of the following is the most likely cause?
medium
A. The preset value is set to zero.
B. The input signal is connected to the count-up input instead of count-down.
C. The count value is already zero.
D. The counter is not enabled.

Solution

  1. Step 1: Analyze why count does not decrease

    If the input signal is connected to the wrong input (count-up instead of count-down), the count will not decrease as expected.
  2. Step 2: Evaluate other options

    Preset zero or count zero would not prevent counting down if input is correct. Counter enable is usually implicit or separate.
  3. Final Answer:

    The input signal is connected to the count-up input instead of count-down. -> Option B
  4. Quick Check:

    Wrong input connection stops count down = B [OK]
Hint: Check input wiring: count-down input must receive signal [OK]
Common Mistakes:
  • Assuming preset zero stops counting
  • Ignoring input wiring errors
  • Confusing enable with input signal
5. You have a CTD counter with preset 8 and current count 1. If the count-down input activates twice quickly before the PLC scans again, what will be the count value after the scan?
hard
A. 0
B. -1
C. 1
D. 2

Solution

  1. Step 1: Understand count-down behavior with rapid inputs

    The CTD counter decreases count by 1 per input pulse but never below zero.
  2. Step 2: Calculate count after two pulses from 1

    First pulse: 1 - 1 = 0; second pulse: cannot go below 0, so remains 0.
  3. Final Answer:

    0 -> Option A
  4. Quick Check:

    Count never negative, min is zero = A [OK]
Hint: Count never goes below zero, even with multiple pulses [OK]
Common Mistakes:
  • Allowing count to go negative
  • Ignoring multiple pulses before scan
  • Assuming count resets automatically
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