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
- Channel Driver FB127 (CH_CNT) and Hardware Parameterization
- Comparison of FM 350-1 Counting Modes and Gate Position Calibration
- Step-by-Step Procedure to Configure FM 350-1 and CH_CNT in PCS 7
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
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:
Position = (V - Offset) * ResolutionStep-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:
-
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. -
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 inputLADDRto the hardware start address of the FM 350-1 (W#16#100for address 256).
- ConnectSW_GATE = 1to enable continuous hardware counting. -
Implement Mathematical Gate Position Scaling:
- Calculate the mechanical resolution:Distance_Per_Pulse = (Drum_Circumference / Encoder_PPR) / Gear_Ratio.
- ConvertCH_CNT.V(DINT) to REAL using blockDI_R.
- Insert subtraction blockSUB_Rto subtractZero_Offset(pulse count when gate is fully closed).
- Insert multiplication blockMUL_Rto multiply byDistance_Per_Pulse(e.g.,0.0005 meters/pulse). -
Connect to Technological Control Blocks:
- Feed the scaled position into inputPVonMonAnL(FB1845) for operator visualization and limit alarming.
- Connect the position output to gate command interlocks: compare againstPos_Open_SPandPos_Close_SPto 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
- 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.
- 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_CNTupon power recovery. - 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
- SIMATIC S7-300 FM 350-1 Counter Module Function Manual (A5E00057777-03)
- SIMATIC Process Control System PCS 7 Basis Library (V9.0) Manual (A5E39222238-AA)
- SIMATIC PCS 7 Advanced Process Library (V9.0) Manual (A5E39147340-AA)
- Siemens Industry Online Support FAQ: Parameterizing FM 350-1 in PCS 7 (Entry ID 24249116)
Related Articles
- Configuring FM 350-1 Counter Modules (6ES7350-1AH03-0AE0) in SIMATIC PCS 7 CFC
- Resolving PT100 RTD Driver Errors and Channel Wiring Mismatches in SIMATIC PCS 7
- Converting REAL Floating-Point Values to WORD or DWORD in SIMATIC PCS 7 CFC
- Diagnosing S7-400 CPU External Fault (EXTF) and I-O Access Errors (OB122) in PCS 7
Related Tags
- FM 350-1
- CH_CNT FB127
- Gate Positioning
- Incremental Encoder
- CFC Scaling
- ET 200M