Configuring High-Speed Pulse Counting and Batch Loading Measurement with Pcs7Cnt1 in PCS 7

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

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

  1. 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.
  2. 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}}$.
  3. Batch Reset Synchronization: Between consecutive truck fills, residual counts must be cleared to zero without restarting the CPU. Manipulating the software gate via SWGateEn provides deterministic zeroing synchronized with the loading sequence.

Step-by-Step Implementation Procedure

Step 1: Parameterize the Counter Module in HW Config

  1. In SIMATIC Manager, open HW Config.
  2. Open properties for the counter module (FM 350-1 or TM Count 1x24V).
  3. Set Operating Mode to Continuous counting or Count once.
  4. Under Gate Configuration, enable Software Gate.
  5. Set the Load Value behavior: Load value on gate open := 0.
  6. Save and compile HW Config and download to the AS.

Step 2: Instantiate Pcs7Cnt1 in the CFC Loading Chart

  1. Open the CFC chart managing the loading sequence.
  2. Drag block Pcs7Cnt1 (FB127) from the PCS 7 Basis Library into the chart.
  3. In the block Object Properties, configure the I/O base address matching the counter module peripheral address assigned in HW Config.
  4. Verify that the module driver generator is enabled to create the supporting @MOD_... diagnostic block.

Step 3: Implement Scaling and Batch Reset Logic

  1. Insert an analog multiplier block Mul02.
  2. Connect Pcs7Cnt1.Cnt_Out to Mul02.In1.
  3. Set Mul02.In2 to the flowmeter K-factor (e.g., 0.05 for a meter delivering 20 pulses/kg).
  4. Route Mul02.Out to the batch total display on WinCC and to a comparator block evaluating loading cutoff.
  5. Connect the sequence reset trigger from your batch state machine:
    - To reset via gate: Connect the inverse of the sequence reset signal to Pcs7Cnt1.SWGateEn so that resetting drops SWGateEn to 0 for 1 cycle, then restores 1 to zero the counter.
    - To reset via direct load: Connect parameter Pcs7Cnt1.Load_Val := L#0 and pulse Pcs7Cnt1.L_Direct := 1 when the operator clicks Tare / Reset.

Step 4: Compile and Deploy

  1. In CFC, execute Chart > Compile > Changes Only.
  2. Download changes to the operating AS controller in RUN.
  3. Compile the OS to generate WinCC tags for live loading visualization.

Verification

  1. Static Tare Verification: Before starting flow, pulse the reset command. Confirm that both Pcs7Cnt1.Cnt_Out and the scaled output Mass_Kg read exactly 0.0 kg.
  2. 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.
  3. Post-Load Gate Latch Test: After loading completes, verify that setting SWGateEn = 0 locks the final batch weight on screen without drift until the next vehicle is ready.

Limitations and Operational Precautions

  1. 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.
  2. 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 Pcs7Cnt1 with 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

Related Articles

Related Tags

  • Pcs7Cnt1
  • Pulse Counting
  • Batch Loading
  • K-Factor
  • FM 350-1
  • SWGateEn
  • Weighing Systems
20 respuestas