Bird
Raised Fist0
PLC Programmingscripting~5 mins

Analog input configuration (4-20mA, 0-10V) in PLC Programming

Choose your learning style10 modes available
Introduction

Analog input configuration lets your PLC read real-world signals like temperature or pressure. It converts electrical signals (4-20mA or 0-10V) into numbers your program can use.

You want to measure temperature from a sensor that outputs 4-20mA.
You need to read a pressure sensor that sends 0-10V signals.
You want to monitor liquid level using an analog sensor.
You need to convert sensor signals into digital values for control.
You want to set up alarms based on sensor readings.
Syntax
PLC Programming
AnalogInputConfig(channel, signalType, minValue, maxValue)

// channel: input channel number
// signalType: '4-20mA' or '0-10V'
// minValue: sensor minimum value (e.g., 0 degrees)
// maxValue: sensor maximum value (e.g., 100 degrees)

The configuration maps electrical signals to real-world units.

Make sure to select the correct signal type for your sensor.

Examples
Configures channel 1 for a 4-20mA sensor measuring from 0 to 100 units.
PLC Programming
AnalogInputConfig(1, '4-20mA', 0, 100)
Configures channel 2 for a 0-10V sensor measuring from -50 to 50 units.
PLC Programming
AnalogInputConfig(2, '0-10V', -50, 50)
Sample Program

This program sets up channel 1 for a 4-20mA sensor. It then simulates reading 12mA and converts it to a value between 0 and 100.

PLC Programming
// Simple PLC program to read and scale analog input

// Configure channel 1 for 4-20mA sensor measuring 0-100 units
AnalogInputConfig(1, '4-20mA', 0, 100)

// Read raw input value (simulated here as 12mA)
rawValue = 12.0

// Scale raw 4-20mA to engineering units
scaledValue = ((rawValue - 4) / (20 - 4)) * (100 - 0) + 0

// Output scaled value
Print('Scaled sensor value: ' + scaledValue + ' units')
OutputSuccess
Important Notes

Always verify sensor wiring matches the configured signal type.

Scaling formulas convert electrical signals to meaningful units.

Test with known input values to confirm correct configuration.

Summary

Analog input configuration connects sensors to your PLC.

Choose the right signal type (4-20mA or 0-10V) for your sensor.

Scaling converts raw signals into useful measurements.

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