Configuring High-Speed Pulse Counting and Batch Loading Measurement with Pcs7Cnt1 in PCS 7
In SIMATIC PCS 7, configuring high-speed pulse counting for batch material loading (such as measuring fluid or solid delivery in kilograms) using the Pcs7Cnt1 channel block involves pairing hardware counter modules (FM 350-1 / FM 350-2 / ET 200 TM Count) with APL totalization and tare logic. To measure mass in kilograms from pulse streams: 1) Parameterize the counter module in HW Config for Continuous Counting with Software Gate control; 2) In CFC, connect the driver block Pcs7Cnt1 to the module peripheral address; 3) Scale raw pulse counts (Cnt_Out) to kilograms using a multiplier block (Mul02) with the flowmeter calibration factor (K-factor in kg/pulse); and 4) Reset the batch quantity at the start of each loading cycle by pulsing SWGateEn (1 -> 0 -> 1) or asserting L_Direct := 1 with Load_Val := 0.
Table of Contents
- Executive Summary
- Architecture and Fundamental Mechanics
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
Accurate fiscal metering, truck filling, and batch dosing in process plants demand high-frequency pulse acquisition that standard PLC digital inputs cannot resolve due to scan-time limitations. In SIMATIC PCS 7, dedicated high-speed counter modules (such as the FM 350 series or ET 200SP TM Count) interface directly to field pulse transmitters, while the Pcs7Cnt1 channel driver block manages cyclic data exchange with CFC. Control engineers frequently need to translate raw counter ticks into engineering units (kilograms) and manage zero-tare operations for automated batch loading. This technical reference details the complete engineering pipeline from hardware configuration and K-factor scaling to automated batch reset logic.
Architecture and Fundamental Mechanics
Batch Metering and Counter Architecture in PCS 7
+-------------------------------------------------------------------------+
| FIELD INSTRUMENT: FLOWMETER / MASS PULSER |
| |
| - Positive Displacement Meter or Coriolis Flowmeter |
| - Pulse Output: e.g., 20 pulses per kilogram (K-factor = 0.05 kg/pulse)|
+-----------------------------------|-------------------------------------+
|
v High-Speed Pulse Stream (up to 500 kHz)
+-------------------------------------------------------------------------+
| HARDWARE COUNTER: FM 350-1 / TM Count |
| |
| - Fast hardware FPGA counts incoming electrical edges |
| - Gating: SW_GATE controlled from CPU cyclic data |
| - Peripheral Output: Accumulated Pulse Count (32-Bit DINT) |
+-----------------------------------|-------------------------------------+
|
v S7 Backplane Bus (OB35 - 100 ms Cycle)
+-------------------------------------------------------------------------+
| PCS 7 CFC PROCESSING PIPELINE |
| |
| [Pcs7Cnt1 (FB127)] |
| - Input: SWGateEn (1 = Run, 0 = Hold/Reset) |
| - Input: L_Direct (Pulse loads Load_Val = 0) |
| - Output: Cnt_Out (Raw Pulses, e.g. 10,000 pulses) |
| |
| [Mul02 Scaling Block] |
| - In1: Cnt_Out |
| - In2: K_Factor (0.05 kg/pulse) |
| - Out: Mass_Kg = 10,000 * 0.05 = 500.0 kg |
| |
| [Batch Dosing Interlock] |
| - Target Setpoint = 500.0 kg |
| - Comparator trips loading valve closed when Mass_Kg >= Target |
+-------------------------------------------------------------------------+
The Engineering Flow for Pulse-to-Mass Conversion
- High-Frequency Resolution: Standard digital input cards read signals in OB35 (100 ms) or OB1 (20–50 ms), capping measurable pulse rates below 10–25 Hz. High-speed counter modules (FM 350 / TM Count) feature dedicated onboard microprocessors capable of resolving pulses up to 100–500 kHz without placing execution load on the CPU.
- K-Factor Mathematical Scaling: Flowmeters report a calibration K-factor (pulses per unit volume or mass). The mass $M$ in kilograms is derived via:
$$M = \text{PulseCount} \cdot K_{\text{factor}}$$
where $K_{\text{factor}} = \frac{1}{\text{Pulses per kg}}$. - Batch Reset Synchronization: Between consecutive truck fills, residual counts must be cleared to zero without restarting the CPU. Manipulating the software gate via
SWGateEnprovides deterministic zeroing synchronized with the loading sequence.
Step-by-Step Implementation Procedure
Step 1: Parameterize the Counter Module in HW Config
- In SIMATIC Manager, open HW Config.
- Open properties for the counter module (FM 350-1 or TM Count 1x24V).
- Set Operating Mode to Continuous counting or Count once.
- Under Gate Configuration, enable Software Gate.
- Set the Load Value behavior: Load value on gate open := 0.
- Save and compile HW Config and download to the AS.
Step 2: Instantiate Pcs7Cnt1 in the CFC Loading Chart
- Open the CFC chart managing the loading sequence.
- Drag block
Pcs7Cnt1(FB127) from the PCS 7 Basis Library into the chart. - In the block Object Properties, configure the I/O base address matching the counter module peripheral address assigned in HW Config.
- Verify that the module driver generator is enabled to create the supporting
@MOD_...diagnostic block.
Step 3: Implement Scaling and Batch Reset Logic
- Insert an analog multiplier block
Mul02. - Connect
Pcs7Cnt1.Cnt_OuttoMul02.In1. - Set
Mul02.In2to the flowmeter K-factor (e.g.,0.05for a meter delivering 20 pulses/kg). - Route
Mul02.Outto the batch total display on WinCC and to a comparator block evaluating loading cutoff. - Connect the sequence reset trigger from your batch state machine:
- To reset via gate: Connect the inverse of the sequence reset signal toPcs7Cnt1.SWGateEnso that resetting dropsSWGateEnto0for 1 cycle, then restores1to zero the counter.
- To reset via direct load: Connect parameterPcs7Cnt1.Load_Val := L#0and pulsePcs7Cnt1.L_Direct := 1when the operator clicks Tare / Reset.
Step 4: Compile and Deploy
- In CFC, execute Chart > Compile > Changes Only.
- Download changes to the operating AS controller in RUN.
- Compile the OS to generate WinCC tags for live loading visualization.
Verification
- Static Tare Verification: Before starting flow, pulse the reset command. Confirm that both
Pcs7Cnt1.Cnt_Outand the scaled outputMass_Kgread exactly0.0 kg. - Dynamic Batch Loading Test: Initiate product flow. Verify that pulse counts accumulate smoothly, the scaled kilogram display increments in real-time, and the loading shutoff valve closes precisely when the target weight is reached.
- Post-Load Gate Latch Test: After loading completes, verify that setting
SWGateEn = 0locks the final batch weight on screen without drift until the next vehicle is ready.
Limitations and Operational Precautions
- Pulse Chatter Suppression: Ensure the counter module input filter is configured in HW Config (e.g., 2.5 µs or 25 µs) to filter mechanical relay bounce or electrical noise on the pulse line.
- Volatile Counter Memory: Physical counter modules store counts in volatile registers; a power loss during batch loading clears the live count. In custody transfer applications, pair
Pcs7Cnt1with non-volatile accumulator blocks (TotalL) to persist batch tallies across power disruptions.
Engineer FAQ
Why use Pcs7Cnt1 instead of standard digital inputs for weighing?
Standard digital inputs cannot capture high-speed pulse trains (>25 Hz) due to PLC scan times; counter modules process frequencies up to 500 kHz in hardware.
How do I calibrate pulses to kilograms?
Multiply raw pulses from Cnt_Out by the flowmeter K-factor (kg per pulse) using a Mul02 block.
How is the counter zeroed for a new batch?
By pulsing the software gate input SWGateEn (1 -> 0 -> 1) or pulsing L_Direct with Load_Val := 0.
Can Pcs7Cnt1 handle frequency measurement?
Yes, when paired with FM 350-1 configured for frequency measurement, it can calculate live flow rate in addition to total volume.
What happens if SWGateEn remains 0?
The counter gate remains closed and all incoming field pulses are ignored.
Is Pcs7Cnt1 suitable for custody transfer loading?
Yes, when paired with certified flowmeters, approved counter modules, and persistent batch logging blocks.
Can I preset a batch target and count down to zero?
Yes, load the target batch weight into Load_Val, configure count down, and trigger a stop when the counter reaches zero.
What block displays the loading total on WinCC?
The scaled REAL output can be connected to an APL MonAnL block or TotalL block to generate standard WinCC faceplates.
Where can I purchase FM 350 or TM Count hardware?
Through an authorized Siemens distributor or the Siemens Industry Mall.
Does modifying K-factors require stopping the AS?
No. The K-factor multiplier on Mul02 can be tuned online in RUN via CFC test mode or from WinCC.
Technical References
- SIMATIC FM 350-1 Function Module for Counting Techniques Manual
- SIMATIC PCS 7 Basis Library Function Manual - Counter Function Blocks
- Siemens Industry Online Support (SIOS) Entry ID 109780813: Batch Loading and Metering with Pcs7Cnt1
- SIMATIC ET 200SP TM Count 1x24V Technology Module Configuration Guide
Related Articles
- Resetting and Operating the PCS 7 High-Speed Counter Block Pcs7Cnt1 in CFC
- Implementing a Moving Totalizer Rolling Window FIFO Integrator in PCS 7 APL
- PCS 7 CFC Programming Fundamentals - Connecting Field I-O, Interlocks, and HMI Operator Controls
Related Tags
- Pcs7Cnt1
- Pulse Counting
- Batch Loading
- K-Factor
- FM 350-1
- SWGateEn
- Weighing Systems