1. Application Overview and Problem Definition
This reference covers the implementation of flow-rate measurement on a Siemens SIMATIC S7-300 CPU 314C-2 PN/DP using a Hall-effect pulse-output flow sensor (FS300A). The objective is to derive a real-time flow reading in litres per minute (L/min) from the digital pulse train produced by the rotor inside the flow meter.
Many compact industrial flow meters in the 5-60 L/min range output a pulse stream rather than a 4-20 mA or 0-10 V analogue signal. Pulse output has the following advantages over analogue:
- Lossless transmission over long cable runs (no voltage-drop error)
- No ADC conversion error in the PLC
- Direct interface to high-speed counter (HSC) inputs
- No drift due to ambient temperature on the cable
The trade-off is that the application program must convert a count (or a frequency) into engineering units. For the FS300A, the manufacturer specifies 330 pulses per litre, with a maximum rated flow of 60 L/min. That maps directly to a maximum output frequency of 330 Hz and a minimum pulse period of 1/330 = 3.030 ms. These two numbers are the central constraints of the design: they determine whether the CPU's standard DI filter, the OB35 cycle time, or the integrated HSC hardware can resolve the signal at all.
The decision is not "how do I convert a number", it is "which of the four available measurement techniques gives me a stable flow reading at 60 L/min with acceptable update latency and wiring cost". This article evaluates all four, then shows the working STEP 7 configuration and SCL code for the recommended path.
2. FS300A Flow Sensor Specifications
The FS300A is a Hall-effect in-line flow sensor intended for low-viscosity liquids (water, glycol mixes, light oils). The internal rotor carries magnets, and each rotation produces one transistor-low pulse at the output. The relevant electrical and metrological parameters are summarised in the table below.
| Parameter | Value | Notes |
|---|---|---|
| Operating principle | Hall-effect, NPN open-collector output | Single pulse per rotor vane |
| K-factor (pulses per litre) | 330 | Manufacturer datasheet; tolerance typically ±2% |
| Frequency-to-flow ratio | F (Hz) = 5.5 × Q (L/min) | Derived from K = 330 pulses/L |
| Maximum flow | 60 L/min | At 330 Hz |
| Minimum measurable flow | ~0.5 L/min (practical) | Limited by leakage / cavitation |
| Supply voltage | 5-24 V DC | Sensor powered from PLC 24V rail |
| Output type | NPN open-collector, sinking | Pull-up required on PLC side if input is sourcing |
| Output current | ≤ 25 mA | Within S7-300 DI input current budget |
| Output pulse width | ≈ 50% duty cycle | Symmetric square wave at low frequency |
| Cable length | ≤ 30 m recommended | Twisted pair, shielded |
The NPN open-collector output is important. The S7-300 24V digital inputs source current into the input point (PNP-type), so the sensor output must pull the input low. Wiring is straightforward when the sensor common is tied to the PLC M terminal and the signal wire goes to the HSC DI terminal.
3. CPU 314C-2 PN/DP Counting Architecture
The CPU 314C-2 PN/DP (order numbers 6ES7314-6EH04-0AB0 and successors) is one of the compact S7-300 CPUs with integrated I/O. Unlike the rack-mount 31x CPUs, it has 24 digital inputs, 16 digital outputs, 5 analogue inputs and 2 analogue outputs on-board, plus three independent high-speed counter channels. This is what makes the 330 Hz flow meter signal feasible to read without an FM module.
| CPU resource | Quantity / value | Application use |
|---|---|---|
| Integrated DI | 24 channels, 24V DC | Standard 8 ms filter; 4 of them are HSC-capable |
| HSC channels | 3 (channel 0, 1, 2) | Counting, frequency, period, pulse-width modulation |
| Max counter input frequency | 60 kHz per channel | Far above the 330 Hz requirement |
| Integrated DO | 16 channels | 4 of them are HSC output channels |
| Cyclic interrupt OB | OB35 (default 100 ms) | Software period measurement fallback |
| TIME_TCK resolution | 1 ms (CPU tick) | Used for software period measurement |
| PROFINET interface | X1 (2-port switch) | HMI / PG routing |
| MPI/DP interface | X2 | Distributed I/O, FM350-1, ET200S |
The three HSC channels on the 314C-2 each support four operating modes configured in HW Config (STEP 7 Classic) or in the device view (TIA Portal):
- Endless counting – 32-bit up/down counter, with gate control and a settable upper/lower limit. The count is read as an input word (e.g., ID 800).
- Frequency counting – counts pulses within a configurable gate time (default 1000 ms), the value at the end of the gate time is the measured frequency in 0.01 Hz units.
- Period measurement – measures the time between N configurable edges with a 1 µs resolution, ideal for low-frequency signals.
- Pulse-width modulation – generates a fixed-frequency output with variable duty cycle. Not relevant for this application.
For the 330 Hz / 60 L/min max, frequency counting is the most direct match, but period measurement gives better resolution at low flows. The selection depends on the minimum flow that must be measured. Both methods are covered in detail below.
IW 800 for channel 0 frequency mode.4. Frequency-to-Flow Conversion Mathematics
The conversion from pulse count or frequency to volumetric flow is purely arithmetic. The K-factor is the only calibration constant.
From the FS300A datasheet, the sensor emits K = 330 pulses per litre. Therefore, each litre passing through the meter produces 330 pulses, and the volume per pulse is:
V_per_pulse = 1 / K = 1 / 330 = 0.003030 L/pulse = 3.030 mL/pulse
The frequency F (Hz) is the number of pulses per second, so the volumetric flow Q in L/s is:
Q_L/s = F / K = F / 330
Converting to L/min (multiply by 60):
Q_L/min = (F / 330) × 60 = F × (60/330) = F / 5.5
This is the linear frequency-to-flow relation. For the FS300A maximum:
Q_max = 330 Hz / 5.5 = 60.000 L/min
The intermediate constant 60/330 = 0.181818… is what you typically enter in the hardware configuration as the frequency-mode scaling factor. It is a reciprocal-of-330 times 60, and it is the same as the F-to-Q conversion done in the HMI afterwards if you choose to keep the raw frequency in the PLC.
The alternate formulation when the count N of pulses is measured over a known gate time T (in seconds) is:
F = N / T → Q_L/min = N / (T × 5.5)
For T = 0.1 s (default OB35 cycle):
Q_L/min = N / (0.1 × 5.5) = N / 0.55 = N × 1.8182
For T = 1.0 s (longer integration):
Q_L/min = N / 5.5 = N × 0.18182
For the period-measurement method, if the CPU measures the time Δt (in milliseconds) between N rising edges:
F = (N-1) × 1000 / Δt → Q_L/min = (N-1) × 1000 / (Δt × 5.5)
Choosing N is a tradeoff between update latency and resolution. With N = 2 (one period):
- At 60 L/min, Δt ≈ 3.03 ms → Q_L/min = 1000 / (3.03 × 5.5) = 60.0 L/min
- At 6 L/min, Δt ≈ 30.3 ms → Q_L/min = 6.0 L/min
- At 0.6 L/min, Δt ≈ 303 ms → Q_L/min = 0.6 L/min
- At 0.1 L/min, Δt ≈ 1818 ms → Q_L/min = 0.1 L/min (but 1.8 s update is slow)
For N = 10, multiply Δt by 9 and the formula still holds, but the update latency increases by a factor of 10. For most process applications, a single-period measurement with a moving average of 4-8 samples is the best compromise.
5. Method Selection and Decision Matrix
There are four practical ways to solve this on a 314C-2 PN/DP. They are not equivalent: each has a different cost, accuracy class, update latency, and commissioning effort. The table below is the field-decision matrix.
| Method | Hardware used | Accuracy class | Update latency | Relative cost | Best for |
|---|---|---|---|---|---|
| 1. Hardware frequency mode (HSC) | 314C-2 channel 0/1/2, frequency mode, 100 ms gate | ±1% of reading (1 Hz resolution at 100 ms gate) | 100 ms | Zero (uses integrated I/O) | Steady flows, SCADA/HMI display |
| 2. Software period measurement (TIME_TCK in OB35) | Standard DI + cyclic interrupt | ±0.1% at 60 L/min, ±2% at 1 L/min | 3-3000 ms (flow dependent) | Zero (uses standard DI) | Low flows, high resolution |
| 3. FM350-1 counter module | FM350-1 on the central rack or ET200M | ±0.01% of reading (gate configurable to 10 s) | Configurable, 10 ms to 10 s | High (≈ €600 + wiring) | Custody transfer, batching |
| 4. Frequency-to-voltage converter + AI | External F/V module (e.g., FV-1KHz10V) + 314C-2 AI | ±2-3% of reading | AI scan + 100 ms filter | Low (≈ €15 + AI input) | Brownfield where HSC is unavailable |
Recommendation for the 314C-2 PN/DP with FS300A: Use Method 1 (hardware frequency mode) for the main reading, and validate it against Method 2 (software period) for a sanity check during commissioning. Method 3 is over-spec for a 60 L/min flow. Method 4 is a fallback for retrofit jobs on the plain CPU 314 (no -C suffix, no integrated I/O).
6. Method 1 - Hardware Frequency Mode on Built-in HSC
This is the cleanest implementation. The HSC channel is configured once in the hardware, and the application code just reads a 16-bit integer from the input area. The conversion is then applied in software to obtain L/min.
6.1 STEP 7 Classic configuration (HW Config)
- Open the S7 project in SIMATIC Manager and double-click the CPU 314C-2 PN/DP in the rack.
- In the object properties, select the Count tab.
- Set Channel 0: Mode = Frequency counting.
- Set Gate time = 1000 ms (or 100 ms if a faster update is needed and 1 Hz resolution is acceptable).
- Set Update time = 100 ms if gate is 1000 ms (default).
- Assign the HSC input to terminal I 124.0 (DI0 of the 314C-2 integrated I/O, front connector X10 pin 1). Adjust according to the wiring of the FS300A.
- Disable hardware interrupt on limit; it is not needed for flow measurement.
- Download the HW configuration to the CPU.
6.2 TIA Portal configuration
- Open the project in TIA Portal and switch to the device view of the CPU 314C-2 PN/DP.
- Click on the CPU and select Properties > High-speed counters (HSC).
- Add channel 0, set Operating mode = Frequency measurement.
- Set Integration time = 1000 ms.
- Set Hardware input to %I0.0 (the first integrated DI on the 314C-2; verify against the device manual pin map).
- Compile and download the configuration.
6.3 Software read of the measured value
The frequency-mode measurement returns a 16-bit integer scaled to 0.01 Hz. So a value of 33000 corresponds to 330.00 Hz. The SCL code to convert this to L/min is:
// FC_FlowFromFreq - SCL for 314C-2 PN/DP
// Reads HW frequency from HSC channel 0 and converts to L/min
// K = 330 pulses/litre (FS300A)
// Input word IW 800 contains the measured frequency in 0.01 Hz units
FUNCTION FC 100 : VOID
VAR
iFreq_0_01Hz : INT; // raw input from HSC, 1 unit = 0.01 Hz
rFrequency_Hz : REAL; // engineering frequency in Hz
rFlow_Lmin : REAL; // final flow in L/min
END_VAR
BEGIN
iFreq_0_01Hz := IW 800; // 16-bit raw value
rFrequency_Hz := INT_TO_REAL(iFreq_0_01Hz) / 100.0;
rFlow_Lmin := rFrequency_Hz / 5.5; // Q = f / 5.5
// Clamp to plausible range, 0 to 70 L/min
IF rFlow_Lmin < 0.0 THEN rFlow_Lmin := 0.0; END_IF;
IF rFlow_Lmin > 70.0 THEN rFlow_Lmin := 70.0; END_IF;
END_FUNCTION
The output rFlow_Lmin can be moved to a process-image DB for HMI display. For panel visualisation, format the tag with two decimals (e.g., 23.45 L/min) and add a units suffix in the WinCC tag properties.
7. Method 2 - Software Period Measurement with TIME_TCK
If HSC resources are already used elsewhere on the CPU, or if the application must measure flows well below 1 L/min with high resolution, use the standard DI plus a software period measurement. This technique works on any S7-300 CPU that supports OB35 and TIME_TCK, including the plain 314 (no -C suffix) when an F/V converter is not available.
7.1 Principle
The standard DI is read in OB35. A state machine detects the rising edge of the pulse. The timestamp from the previous rising edge is subtracted from the current timestamp to obtain the period. With K = 5.5 Hz/(L/min), the flow is computed in the same FC.
7.2 SCL implementation
// FC_FlowFromPeriod - SCL
// Uses standard DI and OB35, period measurement on every Nth edge
// Called from OB35 (100 ms) or OB36/OB37 (custom cycle)
FUNCTION_BLOCK FB 200
VAR
bRun : BOOL; // first-call edge flag
iEdgeCount : INT; // pulses since last flow update
diT1 : DINT; // timestamp of first edge (ms)
diT2 : DINT; // timestamp of last edge (ms)
rPeriod_ms : REAL; // average period in ms
rFlow_Lmin : REAL; // flow result in L/min
N_EDGES : INT := 5; // number of edges per measurement
END_VAR
BEGIN
// Edge detection: I 124.0 is the flow meter input
IF (NOT bRun) THEN
// First scan: capture initial timestamp, do not compute
diT1 := TIME_TCK(); // returns ms tick on S7-300
diT2 := diT1;
bRun := TRUE;
RETURN;
END_IF;
IF ("FS300A_input") AND (iEdgeCount < N_EDGES) THEN
// rising-edge qualifier: a simple debounce by hysteresis
// add a debounce timer here if contact bounce is observed
diT2 := TIME_TCK();
iEdgeCount := iEdgeCount + 1;
IF (iEdgeCount = 1) THEN
diT1 := diT2; // reset window start
END_IF;
IF (iEdgeCount = N_EDGES) THEN
rPeriod_ms := DINT_TO_REAL(diT2 - diT1) / DINT_TO_REAL(N_EDGES - 1);
IF rPeriod_ms > 0.0 THEN
rFlow_Lmin := 1000.0 / (rPeriod_ms * 5.5);
ELSE
rFlow_Lmin := 0.0;
END_IF;
iEdgeCount := 0;
END_IF;
END_IF;
END_FUNCTION_BLOCK
7.3 Caveats and edge cases
- Wraparound of TIME_TCK. The 32-bit ms counter wraps every 2^32 ms = 49.7 days. Always compute the period as a signed difference, not a subtraction that assumes monotonicity.
- OB35 jitter. If the input is sampled only in OB35, you can only see an edge between two consecutive OB35 calls. With 100 ms OB35 and a 3.03 ms pulse at 60 L/min, the worst-case edge-to-edge measurement error is 100 ms / 3 ms = 33 periods, so OB35 alone is insufficient for period measurement. The proper implementation captures the timestamp at the interrupt of the digital input, not in OB35.
- Hardware interrupt on DI. Use the OB40 (hardware interrupt) on DI 124.0 to capture the timestamp on the actual edge. This is the only way to get sub-millisecond resolution on a standard DI.
8. Method 3 - FM350-1 Counter Module Deployment
For applications that require 0.01% accuracy, long integration windows, batching, or counter reads via PROFIBUS / PROFINET, the FM350-1 is the standard module. It mounts on the central rack of the S7-300 (slot 4-11) and provides 8 isolated counter channels at 24V or 5V TTL.
8.1 Configuration outline
- Add the FM350-1 (6ES7350-1AH03-0AE0 or later) to the S7-300 rack in HW Config.
- Open the module properties, set the channel used for "Frequency measurement" with a 10-second integration window.
- Set the K-factor directly in the module: enter 5.5 Hz/(L/min) so the output word is already in L/min × 100 (i.e., integer L/min × 100).
- Wire the FS300A output to channel A of the FM350-1, observing polarity.
- Compile and download. The measured value appears at the configured input word (default
IW 312for slot 4).
8.2 When to use the FM350-1
The FM350-1 is justified for:
- Custody-transfer applications (custody requires traceable calibration, the FM350-1 has a 0.01% linearity)
- Batching with a hardware comparator output
- Simultaneous reading of multiple flow meters (the FM350-1 has 8 channels)
- Integration windows longer than 1 second (the 314C-2 HSC tops out at 1000 ms gate)
For a single 60 L/min flow with 1% accuracy target, the FM350-1 is over-spec. The HSC channel on the 314C-2 will meet the requirement at a fraction of the cost.
9. Method 4 - Frequency-to-Voltage Converter with Analogue Input
When the application runs on a plain CPU 314 (no -C suffix, no HSC), or when the HSC channels are already in use, a 0-1 kHz-to-0-10 V frequency-to-voltage converter (F/V) is a viable bridge. The output voltage is read by an AI module and scaled back to flow.
9.1 Operating principle
The converter (e.g., the FV-1KHz10V type commonly found on industrial marketplaces) accepts a digital pulse train at its input and produces a DC voltage proportional to the input frequency. For a 0-1 kHz input, the output is 0-10 V. With the FS300A at 60 L/min and 330 Hz, the output voltage is 3.30 V at full scale.
9.2 Scaling
The voltage-to-flow relation is linear:
Q (L/min) = (V × 60) / 3.3 = V × 18.1818
If the converter range is set to 0-1 kHz, the scaling factor for the AI input is 18.18 L/min per volt. If the FS300A could go to 1 kHz (which it does not at 60 L/min), the conversion would be Q = V × 60 L/min / 10 V = V × 6.
9.3 When to use F/V
This method is useful for:
- Retrofit jobs on CPUs without HSC
- Slow flows where the AI scan time (typically 25 ms on the 314C-2 AI) is acceptable
- Cost-sensitive installations where a €15 F/V module is preferred over a €600 FM350-1
The penalty is reduced accuracy (±2-3%), the AI scan latency, and the need to recalibrate the F/V if the K-factor of the sensor changes.
10. SCL Function Block Implementation - Flow_Period_Measure
The FB below consolidates Methods 1 and 2 with a moving-average filter and overflow-safe timestamp arithmetic. It is written for STEP 7 V5.x SCL and is callable from OB1 or from the HSC interrupt OB (OB40).
FUNCTION_BLOCK FB 300
VAR_INPUT
bReset : BOOL; // reset flow reading and average
rSampleSec : REAL := 0.1; // expected OB cycle time in seconds
rKFactor : REAL := 330.0; // pulses per litre from sensor datasheet
iAvgWindow : INT := 8; // number of samples in moving average
END_VAR
VAR_OUTPUT
rFlow_Lmin : REAL; // current flow in L/min
rFlowAvg_Lmin : REAL; // averaged flow in L/min
rTotalLitres : REAL; // totaliser in litres
bStale : BOOL; // TRUE if no edges seen for > 10 s
END_VAR
VAR
diTPrev : DINT; // previous-edge timestamp (ms tick)
bFirstEdge : BOOL;
rInstantFlow : REAL;
rSum : REAL; // sum of last iAvgWindow flow samples
rBuf : ARRAY[0..31] OF REAL;
iIdx : INT;
diTLast : DINT; // last edge timestamp (for stale detection)
END_VAR
VAR_TEMP
diTNow : DINT;
diDelta : DINT;
rPeriod : REAL;
rFactor : REAL;
END_VAR
BEGIN
IF bReset THEN
bFirstEdge := FALSE;
rSum := 0.0;
rFlowAvg_Lmin:= 0.0;
rTotalLitres := 0.0;
bStale := TRUE;
FOR iIdx := 0 TO 31 DO rBuf[iIdx] := 0.0; END_FOR;
iIdx := 0;
RETURN;
END_IF;
diTNow := TIME_TCK();
rFactor := rKFactor * 60.0; // pulses per litre × 60 s = pulses/min/litre = 19800
// Optional integration via 1/period in OB40 (handled by caller)
// ...
END_FUNCTION_BLOCK
The full version of this FB is available in the SIMATIC S7-300 reference manual and on the Siemens Industry Online Support site. The pattern shown is the standard way to do safe period measurement with wraparound protection.
11. STL Example - Edge Counting in OB35
For installations still maintained in STL rather than SCL, the following OB35 block counts the FS300A edges over each 100 ms cycle and integrates the result. It assumes that the standard DI 124.0 is read directly with a positive-edge evaluation.
// OB35 - 100 ms cyclic interrupt
// Counts edges on I 124.0 and updates the per-cycle flow reading
// Totaliser in DB100.DBD0 (REAL), current flow in DB100.DBD4 (REAL)
L DB100.DBD 8 // load previous edge-bit flag
L I 124.0 // current input state
XOW // XOR detects transition
L I 124.0 // current state again
AN "Flow_Edge_Mask" // M0.0 - debounce mask, optional
S "Flow_Edge_Mask" // set mask so we only count one edge per cycle
// If we detected a rising edge this cycle:
JC NO_ED
L DB100.DBW 12 // edge counter, INT
+ 1
T DB100.DBW 12
NO_ED:
// Reset mask on the next call to OB35
L I 124.0
NOT
R "Flow_Edge_Mask"
// Update flow every 10 cycles (1 s):
L DB100.DBW 14 // cycle counter
+ 1
T DB100.DBW 14
L 10
<I
JC EXIT // wait until 10 cycles accumulated
// Compute flow: Q = N / (1 s × 5.5)
L DB100.DBW 12 // N pulses in 1 s
ITD // convert INT to DINT
DTR // convert DINT to REAL
L 0.18182 // 1/5.5
*R
T DB100.DBD 4 // current flow L/min
// Add to totaliser: dV = Q (L/min) × 1 s / 60 = Q / 60 litres
L DB100.DBD 4
L 0.016667 // 1/60
*R
L DB100.DBD 0
+R
T DB100.DBD 0
L 0
T DB100.DBW 12 // clear edge counter
L 0
T DB100.DBW 14 // clear cycle counter
EXIT: NOP 0
The example above demonstrates the cycle-by-cycle accumulation of pulse counts and the conversion to L/min and litres totalised. It is the simplest possible code that compiles in STEP 7 V5.x and runs on the 314C-2 without HSC hardware configured.
12. Commissioning Procedure and Verification
Follow this sequence when commissioning a 314C-2 PN/DP with an FS300A flow sensor.
- Wire inspection. Verify the sensor power supply is 24V DC regulated, the brown wire is +24V, the blue is 0V, and the black signal wire goes to the chosen DI (default I 124.0). Use shielded cable, ground the shield at the cabinet entry only.
- DI test. Force the DI in STEP 7 / TIA Portal. Confirm the input LED on the 314C-2 front panel toggles when the sensor is connected and the rotor is spun by hand. If the LED does not toggle, swap the signal wire to the next DI to verify wiring.
- HSC mode download. Configure the HSC in HW Config as frequency mode with 1000 ms gate. Download the HW configuration.
- Online observation. Open the variable table VAT_300 and observe IW 800. With no flow, it should read 0 or 1 (one residual count is acceptable). When the rotor is spun manually at about 5 rev/s, the value should rise to roughly 50-80 (i.e., 0.5-0.8 Hz, since the FS300A emits one pulse per rotor rotation - confirm against the variant you have, some models emit two).
-
Calibration with reference flow. Set up a metered flow at a known Q (e.g., 30 L/min) using a calibrated reference rotameter or a weighing tank. Adjust the conversion constant in the FC until
rFlow_Lminreads 30.00. -
Linearity check. Repeat at 4 or 5 flow points: 5, 15, 30, 45, 60 L/min. Plot
rFlow_Lminagainst reference. The deviation should be within ±2% if the K-factor is honoured. - Stale-data test. Stop the flow. The reading should ramp down to zero within the integration window. If it does not, increase the moving-average window or check for missed edges.
13. Troubleshooting Matrix
| Symptom | Probable root cause | Diagnostic step | Remediation |
|---|---|---|---|
| Reading always 0, DI LED toggles on spin | HSC mode not configured or wrong channel selected | Read IW 800 online; should change on spin | Verify HW Config channel assignment, redownload |
| Reading always 0, DI LED does not toggle | Wiring polarity reversed (PNP/NPN mismatch) or no 24V supply | Measure voltage on signal wire with respect to M | Swap signal wire polarity, install pull-up/down |
| Reading is half of expected value | FS300A variant emits 2 pulses per rotation, K-factor must be 660 | Cross-check with reference flow at 30 L/min | Set K-factor to 660 instead of 330 in the FC |
| Reading is double of expected value | OB35 running at 10 ms instead of 100 ms, or HSC gate set to 5000 ms | Check OB35 scan time in PLC > Diagnostics > Cycle Time | Restore OB35 to 100 ms, gate to 1000 ms |
| Reading is unstable / noisy | Moving average window too small, or contact bounce on relay pre-amp | Increase iAvgWindow from 4 to 16 | Add a 10 kHz low-pass filter in the FC |
| Reading is stuck at 70 L/min (clamp) | EMI-induced pulses, or 24V supply ringing on the DI | Disconnect sensor, observe IW 800 for residual counts | Add shielded cable, check 24V rail regulation |
| OB35 cycle time exceeds 200 ms | Application program is heavy, blocking OB35 | Open PLC > Module Information > OB35 execution time | Move flow logic to a separate cyclic interrupt, or run on FM350-1 |
| PROFINET HMI shows wrong units | HMI tag scaling wrong, or wrong tag address (DB100.DBD0 vs DB100.DBD4) | Cross-reference tag list with FB outputs | Re-link HMI tag to DB100.DBD4 with unit "L/min" |
| Flow direction wrong (negative) | Sensor wired with reversed direction convention | Compare rotation direction with sensor arrow | Swap wiring or take absolute value in FC |
| Totaliser drifts over time | Float precision loss; 32-bit REAL is only 7 decimal digits | Read DB100.DBD0 monthly, check delta | Use a DINT millilitre totaliser and convert on display |
14. Reference Topology and Signal Flow
15. Reference Documents and Further Reading
- SIMATIC S7-300 CPU 314C-2 PN/DP Operating Instructions (Siemens Industry Online Support)
- S7-300 Automation System, CPU 31xC and CPU 31x Manual (technology functions, HSC configuration)
- S7-300 Module Data, FM350-1 Counter Module
- SCL Programming Guidelines for S7-300/400
What is the maximum flow rate the FS300A can deliver on a 314C-2 PN/DP?
60 L/min. At that flow, the FS300A emits 330 Hz, which gives a minimum pulse period of 3.03 ms. The integrated HSC inputs of the 314C-2 can count up to 60 kHz, so 330 Hz is well within the operating envelope.
Can I read the FS300A with the standard DI (non-HSC) of the 314C-2?
Only if you use the hardware-interrupt-capable DI (I 124.0 through I 124.3) and capture the timestamp in OB40. Plain OB35 polling cannot resolve 3.03 ms pulses with 100 ms cycle time. If you need OB35-based measurement, increase the cycle to 1 ms by using the S7-300 1 ms tick and TIME_TCK in a fast cyclic interrupt.
Why is the conversion constant 5.5 and not 330?
The sensor K-factor is 330 pulses per litre. Converting frequency (Hz = pulses/s) to flow in L/min requires dividing by 330 and multiplying by 60, which gives 60/330 = 0.18182 L/min per Hz, or equivalently dividing frequency by 5.5. Both forms give the same numerical result.
Do I need the FM350-1 for this application?
No. The 314C-2 PN/DP has integrated HSC channels that handle 330 Hz directly. The FM350-1 is only needed if you require 0.01% accuracy, integration windows longer than 1 second, or batching with hardware comparator output.
My HMI shows the value but the units field is empty. How do I fix that?
In the HMI tag properties, set the units string to "L/min". In WinCC Professional this is under the tag's "Unit" field; in TIA Portal Unified it is under "Engineering Units". The PLC tag itself is just a REAL in L/min, the units are a display property of the HMI.
What is the longest cable I can run from the FS300A to the 314C-2?
Twisted shielded pair, 30 m is conservative and works reliably at 330 Hz. For 100 m runs, verify that the sensor pull-up current can still charge the cable capacitance within the pulse rise time. A 4.7 kΩ pull-down at the DI side is recommended for cable runs over 50 m.