Configuring FM 350-1 Counter Modules and CH_CNT for Sluice Gate Position Measurement in PCS 7

Configuring FM 350-1 Counter Modules and CH_CNT for Sluice Gate Position Measurement in PCS 7

To measure and control sluice gate position using a SIMATIC S7-300/ET 200M FM 350-1 Counter Module (6ES7350-1AH03-0AE0) in PCS 7, configure the module in HW Config for 'Continuous Counting' with an incremental encoder. In CFC, insert the standard channel driver CH_CNT (FB127) interconnected to the module logical base address (LADDR). The raw counter pulses from CH_CNT.V are converted to physical decimal gate position (meters or percentage) using mathematical scaling: Position = (V - Zero_Offset) * Pulse_To_Distance_Factor. Feed the scaled position into an APL monitoring block (MonAnL) or positioning block (PosMo) to generate open, close, and intermediate limit commands.

Table of Contents

FM 350-1 Counter Architecture in Process Gate Positioning

In civil engineering, water treatment, hydropower, and bulk materials processing, mechanical sluice gates, weir gates, and radial spillway gates require precise position measurement. To measure mechanical displacement, engineers utilize heavy-duty optical or magnetic rotary incremental encoders (24V HTL or 5V RS-422) coupled to the gate hoisting drum.

Because standard S7-400 digital inputs cannot track high-frequency encoder pulses, the SIMATIC FM 350-1 Counter Module (6ES7350-1AH03-0AE0), installed in a distributed ET 200M station (6ES7153-2BA10-0XB0), performs hardware-based high-speed pulse counting up to 500 kHz. In SIMATIC PCS 7, the counter module integrates directly into the Continuous Function Chart (CFC) architecture via the dedicated channel block CH_CNT (FB127 from the PCS 7 Basis Library).

Channel Driver FB127 (CH_CNT) and Hardware Parameterization

The CH_CNT block provides the standard software abstraction layer between the S7-400 CPU and the FM 350-1 hardware registers:

  • LADDR (Logical Address): Configured in HW Config (e.g. 256), maps the 16-byte I/O communication window.
  • V (Current Count Output): 32-bit DINT output reporting the live accumulated pulse count.
  • SW_GATE (Software Gate): Digital input used to enable or pause counting.
  • LOAD_VAL (Load Value): Value written to the counter hardware upon calibration or zero reset.
  • QUALITY / QERR: Channel quality code and diagnostic error flags evaluated by the PCS 7 maintenance system.

For sluice gate position measurement, the FM 350-1 must be parameterized in HW Config in Continuous Counting mode with an encoder evaluation multiplier (1x, 2x, or 4x evaluation of tracks A and B) to detect travel direction (opening vs closing).

Comparison of FM 350-1 Counting Modes and Gate Position Calibration

The following table compares FM 350-1 counting modes and calibration considerations for mechanical gates:

Parameter / ModeContinuous CountingPeriodic CountingSingle CountingCounting Range-2,147,483,648 to +2,147,483,6470 to Configured Upper Limit0 to Configured Upper LimitBehavior at LimitRolls over past limit; continuous trackingResets to load value and restartsStops counting at limitGate Travel ApplicationStandard for sluice gates (handles full travel)Not suitable for bidirectional travelUsed only for batch pulse dosingDirection EvaluationTracks A/B phase shift (90° quadrature)Unidirectional pulse trainUnidirectional pulse trainZero Calibration MethodExternal physical limit switch sets counter to 0Hardware gate triggerSoftware resetEngineering ScalingPosition = (V - Offset) * ResolutionRaw modulo countsRaw counts

Step-by-Step Procedure to Configure FM 350-1 and CH_CNT in PCS 7

Follow this procedure to configure the counter module and implement gate position calculations:

  1. Parameterize FM 350-1 in HW Config:
    - In HW Config, insert the FM 350-1 (6ES7350-1AH03-0AE0) into the ET 200M rack.
    - Double-click the module to open Object Properties. Select the Parameters tab.
    - Set Operating Mode to Continuous Counting.
    - Under 'Sensor Type', select your encoder signal: 24V Incremental (Track A and B).
    - Set Encoder Evaluation to 4-fold evaluation (maximum positional resolution).
    - Note the assigned Start Address (e.g. 256). Save and compile HW Config.

  2. Insert and Interconnect CH_CNT in CFC:
    - In the CFC Editor, open the control chart for the sluice gate.
    - From the PCS 7 Basis Library (PCS 7 BasisLibrary -> CH_CNT), drag FB127 (CH_CNT) into the chart.
    - Interconnect input LADDR to the hardware start address of the FM 350-1 (W#16#100 for address 256).
    - Connect SW_GATE = 1 to enable continuous hardware counting.

  3. Implement Mathematical Gate Position Scaling:
    - Calculate the mechanical resolution: Distance_Per_Pulse = (Drum_Circumference / Encoder_PPR) / Gear_Ratio.
    - Convert CH_CNT.V (DINT) to REAL using block DI_R.
    - Insert subtraction block SUB_R to subtract Zero_Offset (pulse count when gate is fully closed).
    - Insert multiplication block MUL_R to multiply by Distance_Per_Pulse (e.g., 0.0005 meters/pulse).

  4. Connect to Technological Control Blocks:
    - Feed the scaled position into input PV on MonAnL (FB1845) for operator visualization and limit alarming.
    - Connect the position output to gate command interlocks: compare against Pos_Open_SP and Pos_Close_SP to automatically de-energize the hoist motor contactor when target position is reached.

Verification

Verify gate position measurement and direction tracking:
1. In the CFC Editor, switch to Online test mode (Test -> Watch on). Verify that CH_CNT.QUALITY = 16#80 (Good) and QERR = 0.
2. Manually jog the sluice gate in the Open direction. Verify that CH_CNT.V increments positively and the scaled position in meters increases.
3. Jog the gate in the Close direction. Confirm that CH_CNT.V decrements smoothly.
4. Drive the gate to the physical bottom seating limit switch. Execute the zero calibration routine and verify that the calculated position resets exactly to 0.00 m.
5. Open the WinCC faceplate for MonAnL. Confirm that gate travel displays smoothly in real time with high/low limit warnings.

Limitations and Operational Precautions

  1. Mechanical Backlash and Slip: Incremental encoders measure drum rotation, not absolute gate leaf position. Cable stretch or mechanical slippage requires recalibrating the zero reference whenever the gate hits its mechanical closed limit switch.
  2. Loss of Position on Power Failure: Incremental counters lose absolute position if the gate moves mechanically while control power is off. Use the physical limit switches (closed limit switch) to automatically re-load the zero reference in CH_CNT upon power recovery.
  3. Shielding and Grounding Requirements: Incremental encoder cables carrying 24V or 5V pulses across long spillway distances are highly susceptible to electromagnetic interference (EMI) from hoist motor VFDs. Always use shielded, twisted-pair cable grounded at both ends with Siemens shield connection elements.

Engineer FAQ

Can I use an absolute SSI encoder with FM 350-1?

No. The FM 350-1 counter module (6ES7350-1AH03-0AE0) only accepts incremental encoders (24V HTL or 5V TTL/RS-422) and pulse generators. For absolute SSI encoders, you must use the FM 351 positioning module or FM 350-2 multi-channel module.

How do I reset the counter to zero when the gate reaches the closed limit switch?

In CFC, connect the digital input from the 'Gate Fully Closed' proximity switch to the LOAD_VAL trigger mechanism on CH_CNT with LOAD_VAL = 0, forcing the hardware counter register to zero upon contact closure.

What is the difference between CH_CNT (FB127) and standard counter blocks?

CH_CNT is a dedicated PCS 7 channel driver that manages the cyclic 16-byte I/O protocol, control bytes, and diagnostic interrupts of the FM 350-1 hardware. Standard software counters (e.g. CTU) cannot interface with high-speed FM modules.

Technical References

Related Articles

Related Tags

  • FM 350-1
  • CH_CNT FB127
  • Gate Positioning
  • Incremental Encoder
  • CFC Scaling
  • ET 200M
6 respuestas