S7-1200 Laser Tank Level Sensor: 0-10V Selection and TIA Setup

David Krause19 min read
Application NoteS7-1200Siemens
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

S7-1200 Laser Tank Level Sensor: 0-10V Selection and TIA Setup

This application note covers the selection, wiring, and TIA Portal integration of a top-mounted laser distance sensor for two vertical oil storage tanks (8 m and 7 m nominal height) feeding a Siemens SIMATIC S7-1200 PLC. The fluids are coconut oil and palm kernel oil, both low-viscosity edible oils with refractive indices near 1.45. The original requirement was a 0-10 V analog output proportional to oil level; this document also covers the 4-20 mA alternative that is strongly preferred for industrial sites, and shows how to use a single 500 Ω precision resistor to derive 0-10 V from a 4-20 mA loop if the PLC input card must remain a voltage channel.

1. Application Overview

Parameter Tank 1 Tank 2
Fluid Coconut oil Palm kernel oil
Nominal height 8.0 m 7.0 m
Assumed diameter Application-dependent (verify on site) Application-dependent
Measurement target Continuous level / volume Continuous level / volume
Sensor mounting Top, above max fill line Top, above max fill line
Sensor output 0-10 VDC or 4-20 mA 0-10 VDC or 4-20 mA
PLC SIMATIC S7-1200 (CPU 1214C / 1215C class) Same PLC, second AI channel

Top-mounted laser time-of-flight sensors measure the empty distance between the sensor and the liquid surface. The PLC subtracts this measured distance from the calibrated tank height to obtain the oil level, then converts level to volume using the tank's geometry. For cylindrical tanks, the volume is:

V = π × (D / 2)² × hlevel

where D is the inner tank diameter in metres and hlevel is the calculated oil height. For non-cylindrical tanks, a strapping table (height vs. volume) is required; this can be stored in a DB and indexed by scaled level in TIA Portal.

2. Fluid Properties Relevant to Level Measurement

Both coconut oil and palm kernel oil are clear-to-pale-yellow edible oils. Before selecting an optical (laser) sensor, verify that the surface is compatible with the chosen measurement principle.

Property Coconut oil (typical, 25 °C) Palm kernel oil (typical, 25 °C) Effect on sensor choice
Density ~920 kg/m³ ~930 kg/m³ Hydrostatic pressure calculation (if used as backup)
Kinematic viscosity ~55 mm²/s ~50 mm²/s Affects filling dynamics and surface settling
Refractive index (nD) ~1.448-1.450 ~1.449-1.452 Determines specular/diffuse reflection; affects laser triangulation accuracy
Dielectric constant (εr) ~2.9-3.2 ~2.8-3.0 Matters for capacitive probes, not for laser
Vapour / condensation Low at 25-40 °C Low at 25-40 °C Condensation on laser window is unlikely if tank headspace is ambient
Surface foam / swirling Possible during fill or pump circulation Possible during fill or pump circulation Add PLC-side filtering and use long measurement averaging
Important: Always validate the cited density and refractive index with the actual oil batch certificate of analysis. The values above are typical for refined oils at 25 °C and will shift with temperature and free-fatty-acid content.

3. Measurement Technology Comparison

Several non-contact and contact technologies are available for tank level. Match the technology to the application constraints.

Technology Suitable here? Notes
Laser time-of-flight (ToF) Yes (primary recommendation) Long range (10-80 m), unaffected by vapour at ambient, 0-10 V or 4-20 mA outputs available. Verify compatibility with shiny oil surface.
Ultrasonic Often suitable Lower cost; can be confused by foam, temperature gradients, or aggressive vapour. Less accurate at long range than laser ToF.
Radar (FMCW, 80 GHz) Excellent for oil Highest accuracy and immunity to foam/dust, but higher cost. Many 80 GHz radars ship with 4-20 mA + HART.
Hydrostatic pressure (bottom-mounted) Backup option only Requires density compensation; subject to temperature drift. Output is 4-20 mA. Not recommended as primary for a top-mounted measurement project.
Capacitive / RF admittance Possible Requires oil-specific calibration because dielectric constant is low (~3). Coating and temperature drift reduce accuracy.
Floating magnetostrictive / guided wave radar (GWR) Yes, intrusive Highest accuracy; requires a stilling well or top access and is in contact with the oil. Higher installation cost.

For two open or vented tanks of 7-8 m height with clear refined oils, a laser time-of-flight sensor is the best price/performance compromise. If the tank is closed with agitation and significant foam, move up to FMCW radar (VEGA VEGAPULS 64, Siemens SITRANS LR560, or Endress+Hauser Micropilot FMR6x).

4. Recommended Laser Distance Sensors

The following devices cover the 7-8 m range and ship with both 0-10 V and 4-20 mA analog outputs (or selectable). They are widely available and supported with datasheets, manuals, and 3D models.

Manufacturer / family Model (example) Range to natural surface Analog output Notes
SICK DT50 / DT50 Hi DT50-2B215252 0.2-50 m 0-10 V + 4-20 mA, switchable Class 2 red laser, IP67, M12 connector. Suitable for diffuse oil surfaces; configure output scaling to the tank's empty-to-full span.
SICK DT80 DT80-N1113 0.2-80 m 4-20 mA + 0-10 V Larger housing, integrated heater option, IO-Link variant (DT80-IL).
Keyence IL series IL-065 / IL-1000 Up to 65 m (IL-065) / 1000 mm options 4-20 mA + 0-10 V (with amplifier) IL-065 is class 1 laser, very long range. For 7-8 m, IL-300 (up to 3 m) is too short; pick IL-065 or IL-2000 (2 m head + amplifier).
Banner Engineering LT7 LT7PIDQ 0.3-10 m 4-20 mA (analog) + discrete Class 1 laser, robust IP67 housing, simple setup via push buttons or IO-Link.
IFM Electronic O1D O1D106 (10 m) / O1D155 (35 m) 0.2-10 m / 0.2-35 m 4-20 mA + 0-10 V (selectable) PMD ToF chip, IO-Link, M12. Good fit for two-tank installations on a small budget.
Pepperl+Fuchs VDM28 VDM28-15-L-IO/73c/110/122 0.2-15 m 4-20 mA + 0-10 V (IO-Link) Class 2 laser, IP67, IO-Link for parameter backup.
Wenglor OPT OPT2160 / OPT2161 0.2-10 m 4-20 mA + 0-10 V (selectable) Class 1 laser, IO-Link v1.1, very compact housing.
Verify oil-surface compatibility. Laser triangulation and time-of-flight sensors assume diffuse (Lambertian) reflection. Highly polished or perfectly mirror-like oil surfaces can produce a specular return. In practice, refined coconut and palm kernel oils provide a slightly diffuse return, but always bench-test with the specific oil before specifying. If a glossy surface is encountered, target the sensor 5-10° off vertical, or specify a radar / FMCW device instead.

5. Signal Type: Why 4-20 mA Beats 0-10 V in the Field

The original request specified 0-10 VDC. In an industrial environment with cable runs typically 20-100 m, voltage signals are highly susceptible to:

  • Capacitive pickup from VFD cables and motor leads
  • Ground-loop offsets (mV-level errors that look like real level changes)
  • Voltage drop on long cables, biasing the zero point

A 4-20 mA current loop is immune to all three. The PLC input sees a current, not a voltage, so loop resistance does not degrade accuracy as long as the loop supply voltage is sufficient. If the field engineer has already committed to 0-10 V (for example, the chosen sensor only ships with a 0-10 V output, or the PLC is configured for voltage input), follow the recommendations in section 5.1.

5.1 Converting 4-20 mA to 0-10 V at the PLC

For sensors that have both outputs, prefer the 4-20 mA channel. Place a precision 500 Ω, 0.1 % resistor across the analog-input terminals of the S7-1200 SM 1231 (configured for ±10 V) to develop 2 VDC at 4 mA and 10 VDC at 20 mA. The transfer is:

VAI = Iloop × 500 Ω

VAI (V) = 2.0 + 0.5 × (Level % × 10)

Use a 500 Ω resistor with ≤ 50 ppm/°C drift (e.g., a Vishay Z201 or equivalent) to keep the loop accurate over industrial temperature swings. The PLC sees 2.0-10.0 V; in TIA Portal, treat the input as 0-10 V mapping 0-100 % of span with a 20 % offset in software, or use the ±10 V range and offset/subtract in the scaling block.

6. S7-1200 Analog Input Hardware

The S7-1200 family supports analog input through:

  • SM 1231 signal modules on the right side of the CPU
  • SB 1231 signal boards on the front of the CPU (1 channel, ±10 V or 0-20 mA)
Module / Board Order number (MLFB) Channels Voltage ranges Current ranges Resolution
SM 1231 AI4 × 13 bit 6ES7231-4HD32-0XB0 4 AI ±10 V, ±5 V, ±2.5 V 0-20 mA, 4-20 mA 12 bit + sign (~27648 counts at ±10 V)
SM 1231 AI8 × 13 bit 6ES7231-4HF32-0XB0 8 AI ±10 V, ±5 V, ±2.5 V 0-20 mA, 4-20 mA 12 bit + sign
SM 1231 AI4 × 16 bit 6ES7231-5ND32-0XB0 4 AI (TC/RTD/AI) ±10 V, ±5 V, etc. 0-20 mA, 4-20 mA 15 bit + sign
SB 1231 AI1 × 12 bit 6ES7231-4HA30-0XB0 1 AI (signal board) ±10 V 0-20 mA 11 bit + sign
SB 1231 AI1 × 12 bit (TC) 6ES7231-5QA30-0XB0 1 AI ±80 mV (TC)

For two sensors, a single 4-channel SM 1231 (6ES7231-4HD32-0XB0) is the most economical choice. For higher accuracy, use the 16-bit SM 1231 (6ES7231-5ND32-0XB0) which gives 15-bit signed resolution and better than 0.1 % accuracy over the industrial temperature range. The default Siemens S7-1200 System Manual covers all module wiring and parameter pages.

7. Wiring and Shielding

  1. Use twisted-pair shielded cable, e.g., Belden 3082A (1 pair 18 AWG) or Lapp ETHERLINE® Sensor IP67 for short runs. For long runs (>30 m) the 4-20 mA loop is preferred because voltage drop on the 18 AWG pair is ~6.4 mΩ/m, which would shift the 0-10 V signal by 1 % for a 30 m run at 5 mA sensor load.
  2. Connect the shield at one end only — at the PLC side — to a clean earth ground bar (not the DIN-rail mounting screw, which can carry cabinet return currents).
  3. Keep analog signal cables at least 200 mm away from VFD output cables and three-phase motor leads, crossing at 90° if a crossover is unavoidable.
  4. Provide a 24 VDC, 0.5 A minimum supply to each sensor from the same 24 VDC bus that feeds the PLC inputs, so ground references are common.
  5. Wire M12 connectors with a torque-limiting tool to 0.6 Nm. Field-wireable M12 connectors from Phoenix Contact (SACC-M12MS-4QO) or Binder (713 series) are recommended for sensor cables.
Functional ground. The S7-1200 CPU has a functional earth (FE) terminal that must be bonded to the cabinet ground bar with a low-impedance connection (≤ 1 Ω). Failure to bond FE is the most common cause of noisy analog readings on field-deployed S7-1200s.

8. TIA Portal Configuration

After wiring, configure the SM 1231 in the TIA Portal device view. Open Devices & networks → CPU → signal board / SM 1231 → Properties → Analog inputs → Channel 0 and set:

Parameter Value (0-10 V laser, ±10 V range) Value (4-20 mA with 500 Ω, ±10 V range)
Measurement type Voltage Voltage
Voltage range ±10 V ±10 V
Smoothing Strong (or None if filtering in FB) Strong
Diagnostics: wire break Enabled (only for current) Disabled (voltage mode)
Overflow / underflow diagnostics Enabled Enabled

Repeat for channel 1. Save and download to the CPU. The analog-input process image is now at %IW64 (channel 0) and %IW66 (channel 1) for a SM 1231 in slot 0; the exact addresses depend on slot order, which the TIA Portal device view confirms in the I/O mapping table.

9. Scaling the Analog Input

The S7-1200 returns a 16-bit INT (or REAL after the SCALE / NORM_X instructions). Use the following reference values:

Range Raw integer (0-27648 for unipolar, -27648 to 27648 for bipolar) Scaled to
0-10 V (configured as 0-10 V unipolar) 0-27648 0.000-10.000 V
±10 V (default for SM 1231, used here) -27648 to 27648 -10.000 to 10.000 V
4-20 mA across 500 Ω → 2-10 V -11059 to 27648 (mapped to -10 V to 10 V, but the 4 mA offset uses only 2-10 V) 2.000-10.000 V

Add a data block DB_Sensors with the following structure:

DATA_BLOCK "DB_Sensors"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
NON_RETAIN
  STRUCT
    iRaw_Tank1 : INT;        // %IW64  raw AI value, ±10 V range
    iRaw_Tank2 : INT;        // %IW66  raw AI value, ±10 V range
    rVoltage_Tank1 : REAL;   // scaled voltage 0.0-10.0 V
    rVoltage_Tank2 : REAL;   // scaled voltage 0.0-10.0 V
    rDist_Tank1_m : REAL;    // measured distance from sensor to oil surface, m
    rDist_Tank2_m : REAL;
    rLevel_Tank1_m : REAL;   // calculated oil level, m
    rLevel_Tank2_m : REAL;
    rVolume_Tank1_m3 : REAL; // calculated oil volume, m³
    rVolume_Tank2_m3 : REAL;
  END_STRUCT;
END_DATA_BLOCK

Build a function block FB_LevelScale that performs normalization, conversion to engineering units, subtraction from tank height, and volume calculation. The following SCL (Structured Control Language) source works for both sensors, with a true/false flag selecting the 0-10 V or 4-20 mA interpretation.

FUNCTION_BLOCK "FB_LevelScale"
VAR_INPUT
    iRaw          : INT;     // raw value from %IW64 or %IW66
    bIs4to20mA    : BOOL;    // TRUE = 4-20 mA across 500 Ω (2-10 V at AI)
    rTankHeight   : REAL;    // nominal tank height in metres, e.g. 8.0
    rEmptyVoltage : REAL;    // voltage at empty tank (sensor sees full distance), V
    rFullVoltage  : REAL;    // voltage at full tank (sensor sees minimum distance), V
    rEmptyDistance: REAL;    // distance from sensor to oil at empty, m
    rFullDistance : REAL;    // distance from sensor to oil at full, m
    rDiameter     : REAL;    // tank inner diameter, m
    bRisingVoltage: BOOL;    // TRUE if voltage rises with level
END_VAR
VAR_OUTPUT
    rDistance_m   : REAL;
    rLevel_m      : REAL;
    rVolume_m3    : REAL;
    bError        : BOOL;
END_VAR
VAR
    rVolt         : REAL;
    rFraction     : REAL;
END_VAR
BEGIN
    bError := FALSE;

    // 1. Normalize raw value to engineering voltage
    IF bIs4to20mA THEN
        // 0-10 V range; usable 2-10 V, raw 5529-27648
        rVolt := NORM_X(MIN := 0,    VALUE := INT_TO_REAL(iRaw), MAX := 27648) * 10.0;
        IF rVolt < 1.5 OR rVolt > 10.5 THEN
            bError := TRUE;        // wire break or sensor fault
        END_IF;
    ELSE
        // 0-10 V unipolar, raw 0-27648
        rVolt := NORM_X(MIN := 0,    VALUE := INT_TO_REAL(iRaw), MAX := 27648) * 10.0;
        IF rVolt < -0.2 OR rVolt > 10.5 THEN
            bError := TRUE;
        END_IF;
    END_IF;

    // 2. Convert voltage to distance (sensor-specific, linear over 10-90 % of range)
    rFraction := (rVolt - rEmptyVoltage) / (rFullVoltage - rEmptyVoltage);
    // Clamp to 0-1
    rFraction := LIMIT(0.0, rFraction, 1.0);
    rDistance_m := rEmptyDistance - rFraction * (rEmptyDistance - rFullDistance);

    // 3. Convert distance to level (m of oil in tank)
    rLevel_m := rTankHeight - rDistance_m;
    IF bRisingVoltage THEN
        // Sensor output rises with level (use voltage to drive level directly)
        rLevel_m := rFraction * rTankHeight;
    END_IF;

    // 4. Volume for a cylindrical tank (m³)
    rVolume_m3 := 3.14159265 * (rDiameter / 2.0) * (rDiameter / 2.0) * rLevel_m;
END_FUNCTION_BLOCK

9.1 Calling the FB in OB1 (cyclic main)

// Tank 1: 8.0 m, Ø2.5 m, 0-10 V laser with V = 0 V at empty (8.0 m distance), V = 10 V at full (0.5 m distance)
"i_DB_Tank1"(iRaw := %IW64,
             bIs4to20mA := FALSE,
             rTankHeight := 8.0,
             rEmptyVoltage := 0.0,
             rFullVoltage  := 10.0,
             rEmptyDistance:= 8.0,
             rFullDistance := 0.5,
             rDiameter     := 2.5,
             bRisingVoltage:= FALSE,
             rDistance_m   => "DB_Sensors".rDist_Tank1_m,
             rLevel_m      => "DB_Sensors".rLevel_Tank1_m,
             rVolume_m3    => "DB_Sensors".rVolume_Tank1_m3,
             bError        => "DB_Sensors".bErr_Tank1);

// Tank 2: 7.0 m, 4-20 mA laser with 500 Ω resistor, 2 V at empty, 10 V at full
"i_DB_Tank2"(iRaw := %IW66,
             bIs4to20mA := TRUE,
             rTankHeight := 7.0,
             rEmptyVoltage := 2.0,
             rFullVoltage  := 10.0,
             rEmptyDistance:= 7.0,
             rFullDistance := 0.5,
             rDiameter     := 2.0,
             bRisingVoltage:= FALSE,
             rDistance_m   => "DB_Sensors".rDist_Tank2_m,
             rLevel_m      => "DB_Sensors".rLevel_Tank2_m,
             rVolume_m3    => "DB_Sensors".rVolume_Tank2_m3,
             bError        => "DB_Sensors".bErr_Tank2);

10. Filtering, Averaging, and HMI Display

Raw laser distance values often exhibit 1-3 mm of cycle-to-cycle noise. Add a first-order lag filter on the level and on the volume to stabilize HMI display:

// First-order IIR filter: y[n] = α·x + (1-α)·y[n-1]
rLevel_Tank1_filtered := rLevel_Tank1_filtered * 0.9 + "DB_Sensors".rLevel_Tank1_m * 0.1;

A coefficient of 0.1 (one-second time constant at 100 ms cycle) removes the visible noise without slowing the level response during fill/draw. For a step change in flow, the 90 % settling time is ~2.3 s, which is acceptable for inventory tracking.

On the HMI (Siemens KTP700 or WinCC Unified), display the volume in m³ and in litres (× 1000), and add a bar graph tied to the scaled raw value 0-100 %. Include an alarm for bErr_Tank1 or bErr_Tank2 = TRUE that latches until acknowledged by the operator.

11. Installation Considerations for Oil Tanks

  1. Mount the laser at least 150 mm above the maximum fill level. The sensor's minimum measurable distance is typically 0.2 m; the configured full-tank distance of 0.5 m gives a safety margin of 300 mm.
  2. Add a bracket or swing-arm assembly that allows the sensor to be aimed at the centre of the tank, not the wall. A wall-aimed beam picks up wall reflection on shiny oil.
  3. Vent the tank headspace. If the tank is sealed with positive pressure, laser windows can fog and bias the measurement. Add a Gore-Tex vent (e.g., Donaldson P171505) to equalise pressure without admitting moisture.
  4. Tilt the sensor 5-10° off vertical if the oil surface becomes glossy. This turns a specular return into a slightly diffuse one for triangulation sensors.
  5. Disable the sensor's laser during fill operations if the fill stream crosses the beam. Many SICK and IFM devices support a teach-in to ignore an exclusion zone.
  6. Use UV-resistant cable jackets (e.g., TPE or PUR) if the conduit runs outdoors; PVC jacket oils will embrittle in 2-3 years in tropical installations.

12. Troubleshooting Matrix

Symptom Likely root cause Diagnostic step Corrective action
Raw AI value stuck at 32767 (overflow) or -32768 (underflow) Out-of-range input, wire break, or sensor unpowered Measure voltage at SM 1231 terminals with a DMM; check 24 VDC at sensor Repair cable, restore 24 V, or recalibrate sensor output scaling
Reading drifts by 5-20 mm over an hour Thermal expansion of bracket; temperature-induced oil density change shifting level Log raw value for 1 hour; check ambient temperature trend Use a thermally stable stainless bracket; apply temperature compensation in PLC if needed
Reading jumps by 50-100 mm during pump transfer Turbulent surface and foam at the sensor's footprint Observe the surface through a sight glass during fill Increase PLC filter time constant; add sensor exclusion window; or switch to FMCW radar
Reading is consistently 3-7 % low Voltage drop on long cable (0-10 V mode) or wrong scaling in FB Measure voltage at sensor vs. PLC; trace FB inputs in online TIA Portal Switch to 4-20 mA loop with 500 Ω resistor, or correct the rEmptyVoltage / rFullVoltage scaling
Sensor error LED on, no output Laser window dirty, out-of-range distance, or receiver fault Clean window with isopropyl; re-teach sensor span; consult sensor manual Clean window, re-teach span, replace sensor if receiver damaged
Volume reading in TIA Portal is half of expected Tank diameter entered in inches, not metres Check rDiameter value in the FB instance DB Re-enter diameter in metres (e.g., 2.5 m not 2.5 in)
Both tanks show identical levels I/O address swap (channel 0 vs. channel 1) Disconnect one sensor and check which %IW drops to 0 Swap wiring or correct the FB-call parameter iRaw
Level reads correctly at empty but jumps at full Sensor minimum distance violated (beam too close to oil) Measure empty/full distances and compare to sensor datasheet Reposition the sensor higher or use a sensor with shorter minimum range

13. Commissioning Procedure

  1. Power up the S7-1200 with the sensor cables disconnected. Download the project and confirm the CPU goes to RUN with no I/O faults.
  2. Connect the sensor for tank 1 only. In TIA Portal online, monitor %IW64. The value should sit between -27648 and 27648 with the sensor aimed at the empty tank.
  3. Run the sensor's teach-in sequence per the manufacturer manual: press the teach button for 3 s at the empty condition, then for 3 s at the calibrated full condition (water or a known-height substitute during commissioning).
  4. Verify the AI value spans the expected range. For an 8 m tank with 0-10 V sensor, the empty reading should be ~0 V (raw 0) and the full reading should be ~10 V (raw 27648). With 4-20 mA across 500 Ω, expect 2-10 V (raw 5529-27648).
  5. Watch the filter response in the online monitor for 5 minutes; confirm no bError is latched.
  6. Repeat for tank 2. Document the final empty/full raw values in the sensor's commissioning sheet.
  7. Perform a step test: pump in 200 L, watch the volume tick up, and verify against a sight glass or hand-dipped measurement.

14. When to Look Beyond Laser

If during commissioning the laser return from the oil is unstable, the next step is a 80 GHz FMCW radar. Devices such as the VEGA VEGAPULS 64, Endress+Hauser Micropilot FMR62, or Siemens SITRANS LR560 all deliver ±1 mm accuracy, are unaffected by foam, vapour, or surface texture, and natively output 4-20 mA + HART. The price premium (typically 3-5× a laser) is recovered in reduced recalibration and fewer false alarms. Hydrostatic pressure and ultrasonic remain valid as low-cost backup methods but should not be specified as the primary on a refined oil service where accuracy and surface stability matter.

15. Summary

For two vertical oil tanks of 7-8 m with refined coconut and palm kernel oil, a laser time-of-flight sensor such as the SICK DT50, IFM O1D106, Banner LT7, or Pepperl+Fuchs VDM28 mounted 0.5 m above the maximum fill point gives a clean 0-10 V or 4-20 mA output. Wire the 4-20 mA channel into the S7-1200 SM 1231 (6ES7231-4HD32-0XB0 or the 16-bit 6ES7231-5ND32-0XB0) configured for ±10 V through a 500 Ω precision resistor. Configure the module in TIA Portal, call a scaling FB (NORM_X → linearise → volume formula) once per tank in OB1, and present the engineered level and volume on the HMI. Add first-order filtering to suppress surface noise, and provide an operator-facing error flag for wire break or out-of-range conditions.

Can I use a 0-10 V laser sensor directly on the S7-1200 SM 1231?

Yes. Configure the SM 1231 channel for voltage, range ±10 V, and read the raw value at the process image (e.g. %IW64). Use NORM_X to scale 0-27648 raw counts to 0.0-10.0 V, then linearise against the empty/full distances you recorded during commissioning. A 4-20 mA loop terminated in 500 Ω is preferred for runs over 15 m because voltage drop and noise pickup bias 0-10 V readings.

How accurate is a laser time-of-flight sensor on coconut or palm kernel oil?

A Class 2 laser ToF such as the SICK DT50 typically delivers ±3-5 mm absolute accuracy on diffuse surfaces over 7-8 m. On glossy oils, expect ±5-10 mm; the dominant error source is surface specularity, not the sensor itself. If better than ±2 mm is required, move to an 80 GHz FMCW radar (VEGA VEGAPULS 64, E+H Micropilot FMR62, Siemens SITRANS LR560).

What SM 1231 module should I order for two 0-10 V sensors?

For two sensors, the SM 1231 AI4 (6ES7231-4HD32-0XB0) is the lowest-cost fit. For higher accuracy, choose the 16-bit SM 1231 AI4 (6ES7231-5ND32-0XB0). For just one sensor, the SB 1231 signal board (6ES7231-4HA30-0XB0) plugs into the front of the CPU and saves a slot. All three are documented in the S7-1200 Programmable Controller System Manual.

Do I need a 500 Ω resistor for 4-20 mA into a voltage AI?

Only if your SM 1231 channel is configured for voltage. The S7-1200 SM 1231 supports 0-20 mA and 4-20 mA ranges natively; switch the channel type in TIA Portal from "Voltage" to "Current" and connect the loop directly. The 500 Ω trick is for installations where the AI card cannot be reconfigured for current or where the loop must drive a panel meter in parallel.

Why is the HMI volume reading half of the real volume?

Almost always a unit mismatch on the tank diameter or a wrong area formula. The PLC computes V = π × (D/2)² × h, so a D entered in inches (e.g. 2.5) instead of metres (2.5 m = 98.4 in) gives a volume that is off by 1/0.0254² ≈ 1550×. Re-check the FB instance DB: the diameter must be in metres, the level in metres, and the resulting volume is in cubic metres (multiply by 1000 for litres).

Back to blog