Calculating Pulse Flow Meter Rate and Total on Siemens LOGO!

David Krause13 min read
PLC HardwareSiemensTutorial / How-to
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

Calculating Pulse Flow Meter Rate and Total on Siemens LOGO!

This reference walks through the complete procedure for interfacing an open-collector pulse-output flow meter to a Siemens LOGO! 8 logic module and computing both instantaneous volumetric flow (m³/h) and a running totalizer (m³). The target controller is the LOGO! 12/24RCE (part numbers 6ED1052-1MD08-0BA2 base without display, or 6ED1052-2MD08-0BA2 with display), the smallest member of the LOGO! 8 family that still provides the DC-coupled high-speed counter inputs required for pulse metering. The programming environment is LOGO! Soft Comfort V8.x or later. The reference meter used in the field report is a low-flow turbine or paddle-wheel sensor with a published K-factor of 7.5 pulses per litre and a 3...24 V DC square-wave output.

Selecting the wrong LOGO! variant is the single most common failure when beginners attempt pulse metering. The 230 V AC-supply modules (230RCE / 230RC) and the 24RCE variant do not expose high-speed inputs even though some legacy marketing material implies otherwise. Only the DC-supply modules listed in the selection table below can count above 5 Hz.

Prerequisites

  • LOGO! 8 base module 12/24RCE or 24CE with firmware FS:04 or later.
  • LOGO! Soft Comfort V8.x programming software (matches controller firmware generation).
  • Pulse flow meter with open-collector NPN output, supply range 3...24 V DC, square-wave output, and a documented K-factor (pulses per unit volume).
  • External 24 V DC regulated power supply sized for meter loop current plus LOGO! consumption (typically 1.5 A minimum for a small installation).
  • Pull-up resistor (typically 4.7 kΩ to 10 kΩ at 24 V) if the meter output is true open-collector, or appropriate series resistor for PNP.
  • PC with Ethernet or USB cable for downloading the LOGO! program.

Flow Meter Signal Characteristics

The reference meter in the field report is a low-cost turbine or paddle-wheel flow sensor with the following published parameters. These numbers are typical for the meter category and serve as a worked example throughout this article.

Parameter Value Notes
Supply voltage 3...24 V DC 24 V is the design operating point; derate at 3 V reduces noise margin.
Output type Open-collector NPN, square wave Requires external pull-up to LOGO! input voltage.
K-factor 7.5 pulses per litre Equivalent to 7 500 pulses per m³.
Maximum flow 30 L/min Yields maximum pulse frequency of 3.75 Hz.
Output low voltage < 0.5 V at 5 mA Sinks to common; pulled up to 24 V by external resistor.
Maximum switching current 20 mA 10 kΩ pull-up at 24 V gives 2.4 mA — well within rating.

Calculate the maximum pulse frequency from the K-factor:

f_max = K × Q_max / 60 = 7.5 × 30 / 60 = 3.75 Hz

3.75 Hz is far below the 5 kHz ceiling of the LOGO! high-speed inputs, confirming that this meter is compatible even with the slower counter modes of the controller. The same logic applies to any meter whose maximum frequency stays below 5 kHz, which covers the vast majority of industrial pulse meters (turbine, oval gear, vortex, and paddle-wheel types up to several hundred L/min).

LOGO! Hardware Selection: Why 12/24RCE

The LOGO! family exposes four fast counter inputs only on DC-supply modules. The AC-supply modules (230RCE / 230RC) and the relay-output DC module (24RCE, where "R" indicates relay outputs) use different input circuitry that cannot resolve pulses above a few hundred hertz and must never be specified for pulse metering. The official selection matrix from the LOGO! 8 system manual is reproduced below.

Part number Description Supply High-speed inputs Max frequency Suitable for pulse meter?
6ED1052-1MD08-0BA2 LOGO! 12/24RCE 12/24 V DC I3, I4, I5, I6 5 kHz Yes
6ED1052-1CC08-0BA2 LOGO! 24CE 24 V DC I3, I4, I5, I6 5 kHz Yes
6ED1052-1FB08-0BA2 LOGO! 230RCE 115/230 V AC None ~50 Hz (filtered) No
6ED1052-1HB08-0BA2 LOGO! 24RCE (relay) 24 V DC None ~50 Hz (filtered) No

The four high-speed inputs of the 12/24RCE are software-selectable as either up/down counters (function block "Counter" in LOGO! Soft Comfort), frequency counters, or threshold switches. For this application, the high-speed counter or the dedicated frequency block is the correct choice.

A commonly held misconception is that the LOGO! 230RC "has 4 high-speed digital inputs up to 5 kHz." That statement applies only to the DC-supply modules. The 230V AC module filters its inputs for mains-frequency noise and cannot resolve pulses in the kilohertz range. Verify the part number on the side label of the controller before wiring.

Wiring the Open-Collector Output

Wire the meter as a sourcing-against-pull-up arrangement. The meter's open-collector transistor pulls the signal low during a pulse; a pull-up resistor returns the line high between pulses. Because the LOGO! 12/24RCE inputs are PNP (sourcing) on the DC models, an external pull-down is normally used so that an open meter output reads as logic 0 and a low-going pulse is read as logic 1 only after inversion. The robust wiring below avoids ambiguity.

  1. Connect the meter's +V terminal to the 24 V DC supply positive rail.
  2. Connect the meter's GND terminal to the 24 V DC supply negative rail and to the LOGO! M terminal.
  3. Connect the meter's signal output to a 10 kΩ pull-up resistor tied to 24 V; the other end of the resistor and the signal line both go to LOGO! input I3 (any of I3-I6).
  4. Configure LOGO! Soft Comfort input I3 as high-speed counter with active edge rising (matches PNP-style positive-going pulses after pull-up).
Meter wiring to LOGO! 12/24RCE +V (24 V) Signal GND Flow meter +24 V rail 10 kΩ pull-up Signal to LOGO! I3 LOGO! 12/24RCE I3 (HSC) M (GND) M rail

If the meter is PNP (sourcing) rather than NPN (sinking), the same wiring works but the pull-up is replaced by a pull-down to M, and the active edge in the counter block is set to falling. Confirm the meter's datasheet before wiring.

Pulse-to-Flow Conversion Mathematics

All flow calculations reduce to two equations: one for instantaneous rate and one for totalized volume. Treat them as integer-friendly whenever possible to avoid floating-point drift in the LOGO! runtime.

Rate (instantaneous volumetric flow):

Given K = 7.5 pulses per litre and pulse frequency f [Hz]:

Q [L/s] = f / K = f / 7.5

Q [m³/h] = f × 3.6 / K = f × 0.48

Total volume (totalizer):

Given accumulated pulse count N since reset:

V [L] = N / K = N / 7.5

V [m³] = N / (K × 1000) = N / 7 500

For display on a LOGO! TD (text display) or built-in screen, scaling the rate to a 0...1000 range with one decimal place typically requires an integer count of pulses per 100 ms × 48, then dividing by 1000 with implicit scaling. The full scaling chain is shown in the program section below.

LOGO! Soft Comfort Program Structure

Build the program from four functional blocks. Place them in order on a single circuit diagram page in LOGO! Soft Comfort.

  1. Block B001 — High-Speed Counter (I3): Place the special function block Counter. Assign input I3 to the count input, set the threshold ON value to 100 000 (overflow guard), and the threshold OFF value to 0. Direction = up. The block outputs CV (current value) and a one-bit pulse output on each count.
  2. Block B002 — Frequency Measurement: Use Frequency from the special functions. Connect I3 as the input, set the time window to 1.0 s, and the output range to 0...10 Hz (sufficient for the reference meter at 3.75 Hz maximum). The analog output AQ carries the measured frequency as an integer scaled 0...1000.
  3. Block B003 — Analog Amplifier (rate scaling): Multiply the frequency output by 0.48 to convert to m³/h. With LOGO! 8 firmware FS:04+, use the Analog Math block: AQ = 0.48 × IN + 0, where IN is connected to B002 output. Route AQ to a marker that is displayed on the LOGO! TD.
  4. Block B004 — Analog Amplifier (totalizer scaling): Take CV from B001 and divide by 7 500 to get total m³. Use Analog Math again: AQ = IN / 7500. Because the LOGO! analog engine is integer-scaled, use scaling factor 1 and adjust via offset/gain or perform the divide at display time using marker arithmetic.

For retained total across power-cycle, latch B001 with the Retentive flag (right-click the block in Soft Comfort) and confirm the LOGO! retains retentive data on backup battery or capacitor (the LOGO! 8 base retains up to 80 h on capacitor backup).

Implementing the Frequency-to-Rate Block

The frequency block reports the average number of pulses per measurement window. With a 1 s window, the integer scaled output is:

AQ_rate_scaled = round(f × 100) where AQ is integer 0...1000

To obtain m³/h with one decimal place, multiply the scaled output by 0.48 (a constant) using the Analog Math block with expression A = 0.48 * IN. The result is a value in m³/h that you can display directly. For two-decimal precision, scale by 10 000 in the source block (AQ = f × 10 000) and multiply by 48 in the math block, then divide the displayed value by 1 000.

Implementing the Totalizer (m³ Summation)

The totalizer is just the raw count from B001. Every pulse from the meter adds one to CV. With K = 7.5 pulses/L, divide CV by 7.5 (or 7 500 for m³) at display time:

  • For litres: display = CV / 7.5. Since LOGO! is integer-only, store CV in marker MWx and compute externally on the TD using its formula display, or output a voltage proportional to the value on AQ1 (0...10 V mapped to 0...10 000 L).
  • For cubic metres: display = CV / 7 500. Same integer handling.

If the application requires a floating-point totalizer with two decimal places, use the Analog Math block expression A = IN / 7500 and route AQ to a marker that the LOGO! TD displays with two decimals. Verify precision against the cumulative count over a known-volume test.

LOGO! 8 firmware prior to FS:04 does not support the Analog Math block. On older firmware, use the Analog Amplifier block with gain = 0.48 and a 0 V offset. The gain is integer-scaled (gain range -1000...+1000 corresponding to a multiplication factor of -10.00...+10.00). Match the firmware version in your Soft Comfort project before generating the program.

Integer vs Floating-Point Considerations

LOGO! does not have native 32-bit IEEE-754 floating point. All analog values are integers in a fixed range of -10 000...+10 000 (default) or -32 768...+32 767 (configurable per analog block). This forces the user to perform all scaling in integers and accept quantization error. For a 3.75 Hz maximum frequency with 1 s measurement window:

Scale Quantization step Display value Worst-case error
Integer × 0.48 (m³/h) 0.48 m³/h per count 0...1.8 m³/h ±0.24 m³/h (±13 %)
Integer × 10 000, then × 48 ÷ 1 000 0.00048 m³/h per count 0...18.0 m³/h ±0.00024 m³/h (±0.001 %)
Floating-point via Analog Math (FS:04+) ~1e-6 m³/h 0...1.8 m³/h Negligible

Recommendation: scale the frequency output by a large integer (10 000) before applying the conversion factor 0.48. This preserves precision at the cost of a single division on the TD or display block. For totalizers, the running count of raw pulses never loses precision regardless of scaling, because the counter block uses 32-bit signed integer internally.

Commissioning and Verification

  1. Connect a known-volume source (graduated cylinder or calibrated pump) to the meter inlet.
  2. Apply 24 V DC; verify the meter LED (if fitted) pulses in time with flow.
  3. Confirm in LOGO! Soft Comfort Online mode that the high-speed counter increments on each pulse.
  4. Drive a constant flow of 15 L/min through the meter. Expected frequency = 7.5 × 15 / 60 = 1.875 Hz; expected rate = 0.90 m³/h.
  5. Verify the displayed rate reads 0.90 ± 0.01 m³/h after 30 s settling.
  6. Run 10.0 L through the meter. Verify the totalizer increments by exactly 10.0 L (or 0.010 m³) within ±1 pulse (0.13 L).
  7. Cycle LOGO! power. Confirm the retentive totalizer resumes from the previous value.
  8. Stop flow; confirm rate drops to zero within one measurement window (≤ 2 s) and the totalizer stops incrementing.

Troubleshooting Matrix

Symptom Likely cause Remedy
Counter never increments Meter wired to non-high-speed input (I1, I2, I7, I8) or to AC module Move signal wire to I3, I4, I5, or I6. Verify part number is 12/24RCE or 24CE.
Counter increments but rate is always 0 Frequency block time window too long for low flow, or analog math gain wrong Shorten window to 0.5 s; verify Analog Math expression reads 0.48 * IN.
Rate is double expected Double-counting from contact bounce on mechanical reed or wrong active edge Add 100 nF capacitor across meter output; switch active edge to rising only.
Rate jitters wildly Open-collector without pull-up, or pull-up too weak Install 4.7 kΩ pull-up to 24 V directly at LOGO! input terminal.
Totalizer resets on power cycle Counter block not flagged retentive Right-click Counter block → check Retentive → recompile and download.
Rate reads as negative Bidirectional flow or counter direction reversed Confirm direction = up; install meter so flow matches arrow on body.
Display shows -?- for analog value Analog value out of range Reduce gain or extend the analog block range to -32 768...+32 767.
LOGO! refuses to download program Project firmware newer than controller Match Soft Comfort version to controller firmware; downgrade project if necessary.

Notes on Alternative Controllers

For applications that exceed LOGO!'s analog precision or that require true floating-point math, scale up to a Siemens S7-1200 CPU (firmware V4.x or later) with the high-speed counter on inputs Ia.0...Ia.3 (up to 100 kHz on the DC versions). The same K-factor formulas apply directly, and the S7-1200 supports LREAL (64-bit IEEE-754) arithmetic in SCL, eliminating quantization concerns. A S7-1200 CPU 1214C DC/DC/DC (part 6ES7214-1AG40-0XB0) is the closest migration target. For systems that need PROFIBUS, PROFINET, or HART integration of the flow signal, move to a S7-1500 with the TM Count 2×24 V counter module (6ES7550-1AA00-0AB0), which provides hardware-accelerated frequency measurement at 200 kHz and direct engineering in TIA Portal.

FAQ

Which LOGO! part numbers support pulse flow metering?

Use only the LOGO! 12/24RCE (6ED1052-1MD08-0BA2) or LOGO! 24CE (6ED1052-1CC08-0BA2). Both expose high-speed counter inputs I3-I6 capable of 5 kHz. The 230RCE, 24RCE (relay), and 230RC variants do not have high-speed inputs and will not reliably count meter pulses.

How do I convert 7.5 pulses per litre to m³/h in the LOGO! program?

Use the frequency block output (Hz), multiply by 3.6, then divide by the K-factor: Q [m³/h] = f × 3.6 / 7.5 = f × 0.48. For a meter with K = 7.5 pulses/L and a measured 1.875 Hz, the result is 0.90 m³/h. Implement as Analog Math block on LOGO! 8 firmware FS:04 or later.

Does LOGO! support floating-point math for flow calculation?

LOGO! 8 firmware FS:04 and later supports the Analog Math block which performs floating-point operations internally. Earlier firmware only supports integer scaling via the Analog Amplifier. For best precision, scale frequency output by 10 000 first, multiply by 48, then divide the displayed value by 1 000 to recover the m³/h figure.

How do I retain the totalizer value across power cycles?

Right-click the high-speed Counter block in LOGO! Soft Comfort, enable the Retentive flag, and recompile. The LOGO! 8 base retains the counter value for up to 80 hours on internal capacitor backup; for permanent retention use the LOGO! 8 base with battery cartridge (6ED1057-1BA00-0AA0).

What maximum pulse frequency can the LOGO! 12/24RCE accept?

5 kHz on inputs I3-I6. This covers all turbine, paddle-wheel, vortex, and oval-gear meters used in low-to-medium flow applications. For ultrasonic or Coriolis meters with outputs above 5 kHz, migrate to a S7-1200 with the high-speed counter on Ia.0-Ia.3 (100 kHz) or to a TM Count 2×24 V module on S7-1500 (200 kHz).

Back to blog