Bird
Raised Fist0
PLC Programmingscripting~20 mins

Analog input configuration (4-20mA, 0-10V) in PLC Programming - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Analog Input Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Calculate scaled value from 4-20mA input
Given a raw analog input value of 3276 from a 12-bit ADC (0-4095) representing a 4-20mA signal, what is the scaled process value in engineering units if 4mA = 0 and 20mA = 100 units?
PLC Programming
raw_value = 3276
scaled_value = ((raw_value / 4095) - 0.2) * (100 / 0.8)
print(round(scaled_value, 2))
A90.0
B80.0
C60.0
D75.0
Attempts:
2 left
💡 Hint
Remember to convert raw ADC counts to current ratio, then scale from 4-20mA range to 0-100 units.
💻 Command Output
intermediate
2:00remaining
Convert 0-10V analog input to engineering units
A 0-10V analog input is read by a 12-bit ADC (0-4095). If the process range is 0 to 200 units, what is the engineering value for an ADC reading of 2048?
PLC Programming
adc_reading = 2048
engineering_value = (adc_reading / 4095) * 200
print(round(engineering_value, 2))
A100.0
B50.0
C200.0
D150.0
Attempts:
2 left
💡 Hint
Calculate the voltage ratio from ADC reading and multiply by max units.
🔧 Debug
advanced
2:00remaining
Identify error in 4-20mA scaling formula
What error will occur when running this code snippet for scaling a 4-20mA input? raw_adc = 3000 scaled = raw_adc / 4095 - 0.2 * 125 print(round(scaled, 2))
PLC Programming
raw_adc = 3000
scaled = raw_adc / 4095 - 0.2 * 125
print(round(scaled, 2))
ATypeError because raw_adc is not a number
BSyntaxError due to missing parentheses
COutput is incorrect because of missing parentheses causing incorrect operator precedence
DNo error, output is correct
Attempts:
2 left
💡 Hint
Check the parentheses and operator order in the scaling formula.
🚀 Application
advanced
2:30remaining
Write a script to normalize 0-10V input with offset
You have a 0-10V analog input read by a 12-bit ADC (0-4095). The sensor has a 0.5V offset that must be removed before scaling to 0-100 units. Which script correctly calculates the scaled value for an ADC reading stored in variable adc_val?
Ascaled = ((adc_val / 4095) * 10 + 0.5) * (100 / 10.5)
Bscaled = ((adc_val / 4095) * 10 - 0.5) * (100 / 9.5)
Cscaled = ((adc_val / 4095) * 10) * (100 / 10)
Dscaled = ((adc_val / 4095) * 10 - 0.5) * (100 / 10)
Attempts:
2 left
💡 Hint
Subtract the offset voltage before scaling the remaining voltage range.
🧠 Conceptual
expert
1:30remaining
Why is 4mA used as the lower limit in analog current loops?
In 4-20mA analog current loops, why is 4mA chosen as the minimum signal instead of 0mA?
ATo allow detection of wire breaks or faults by distinguishing zero signal from no current
BBecause 0mA would consume too much power in the loop
CTo reduce electromagnetic interference in the signal wiring
DBecause sensors cannot produce 0mA output reliably
Attempts:
2 left
💡 Hint
Think about how the system detects if the signal wiring is broken.

Practice

(1/5)
1. What is the typical current range used for analog input signals in industrial PLCs?
easy
A. 0-5V
B. 10-30mA
C. 4-20mA
D. 0-24V

Solution

  1. Step 1: Understand common analog signal standards

    Industrial sensors commonly use 4-20mA current loops for analog signals because they are less affected by electrical noise.
  2. Step 2: Compare options with standard ranges

    Among the options, only 4-20mA is the standard current range for analog inputs in PLCs.
  3. Final Answer:

    4-20mA -> Option C
  4. Quick Check:

    Standard analog current signal = 4-20mA [OK]
Hint: Remember: 4-20mA is the classic industrial current signal [OK]
Common Mistakes:
  • Confusing voltage and current ranges
  • Choosing 0-5V as standard current signal
  • Thinking 10-30mA is common
2. Which of the following is the correct way to configure a 0-10V analog input in a PLC program?
easy
A. Set input range to 0-24V and scale raw value accordingly
B. Set input range to 4-20mA and scale raw value accordingly
C. Set input range to 0-5V and scale raw value accordingly
D. Set input range to 0-10V and scale raw value accordingly

Solution

  1. Step 1: Identify the signal type

    For a 0-10V sensor, the PLC input must be configured to accept voltage signals from 0 to 10 volts.
  2. Step 2: Apply correct scaling

    The raw input value must be scaled based on the 0-10V range to convert it into meaningful units.
  3. Final Answer:

    Set input range to 0-10V and scale raw value accordingly -> Option D
  4. Quick Check:

    0-10V input needs 0-10V range setting [OK]
Hint: Match sensor type with input range setting [OK]
Common Mistakes:
  • Using 4-20mA range for voltage input
  • Choosing 0-5V range for 0-10V sensor
  • Ignoring scaling after setting range
3. Given a 4-20mA input scaled to 0-100 units, what is the scaled value if the raw input is 12mA?
medium
A. 50
B. 60
C. 40
D. 70

Solution

  1. Step 1: Understand scaling formula for 4-20mA

    The formula to scale current (I) to units is: scaled = ((I - 4) / (20 - 4)) * 100
  2. Step 2: Calculate scaled value for 12mA

    scaled = ((12 - 4) / 16) * 100 = (8 / 16) * 100 = 0.5 * 100 = 50
  3. Step 3: Re-check calculation

    Wait, 12mA is halfway between 4 and 20, so scaled value should be 50.
  4. Final Answer:

    50 -> Option A
  5. Quick Check:

    Halfway current = 50 units [OK]
Hint: Use linear scaling: subtract 4mA, divide by 16mA range [OK]
Common Mistakes:
  • Using 20mA as denominator instead of (20-4)
  • Not subtracting 4mA offset
  • Mixing up units and raw values
4. A PLC analog input configured for 0-10V is reading 5V, but the scaled value shows 100 units instead of 50. What is the most likely cause?
medium
A. Input range is incorrectly set to 0-5V
B. Sensor is faulty and outputs wrong voltage
C. Scaling formula uses 4-20mA range instead of 0-10V
D. PLC input channel is damaged

Solution

  1. Step 1: Analyze the symptom

    5V input should scale to 50 units if range is 0-10V, but shows 100 units, meaning scaling is doubled.
  2. Step 2: Identify configuration error

    If input range is set to 0-5V, 5V is max input, so scaled value is max (100 units), causing the error.
  3. Final Answer:

    Input range is incorrectly set to 0-5V -> Option A
  4. Quick Check:

    Wrong input range causes wrong scaling [OK]
Hint: Check input range matches sensor output voltage [OK]
Common Mistakes:
  • Assuming sensor fault without checking config
  • Confusing 4-20mA scaling with voltage scaling
  • Ignoring input channel hardware issues
5. You have a sensor outputting 4-20mA representing 0-200°C. How do you configure the PLC to correctly scale the input to temperature?
hard
A. Set input range to 0-10V and scale using formula: Temp = (V / 10) * 200
B. Set input range to 4-20mA and scale using formula: Temp = ((I - 4) / 16) * 200
C. Set input range to 4-20mA and scale using formula: Temp = (I / 20) * 200
D. Set input range to 0-20mA and scale using formula: Temp = (I / 20) * 200

Solution

  1. Step 1: Identify sensor output and temperature range

    The sensor outputs 4-20mA representing 0-200°C, so 4mA = 0°C and 20mA = 200°C.
  2. Step 2: Apply correct scaling formula

    Subtract 4mA offset, divide by 16mA span, then multiply by 200°C: Temp = ((I - 4) / 16) * 200.
  3. Step 3: Verify other choices

    The other choices use wrong input ranges or omit offset, causing incorrect scaling.
  4. Final Answer:

    Set input range to 4-20mA and scale using formula: Temp = ((I - 4) / 16) * 200 -> Option B
  5. Quick Check:

    Correct scaling subtracts 4mA offset and scales to 200°C [OK]
Hint: Always subtract 4mA offset before scaling [OK]
Common Mistakes:
  • Not subtracting 4mA offset in formula
  • Using voltage scaling for current input
  • Assuming 0-20mA range instead of 4-20mA
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