“PLC High-Speed Counters: The Black Technology That Makes Equipment’s ‘Heartbeat’ Accurate to 0.1%!”

1️⃣ Single-phase Counter: The ‘Lone Ranger’
Expertise: A single signal line can handle simple counting scenarios.
Pitfall: Weak anti-interference ability, prone to ‘going crazy’ under electromagnetic interference.
2️⃣ Dual-phase Counter: The ‘Dual Swordsman’
Expertise: Two signal lines distinguish forward and reverse rotation, suitable for conveyor direction monitoring.
Pitfall: Complex wiring; reversing connections leads to ‘backward operation’.
3️⃣ A/B Phase Quadrature Counter: The ‘Left and Right Hands’ Working in Harmony
Expertise: Quadruple frequency technology, directly doubling accuracy!
Pitfall: Must use differential signals; ordinary signal lines are prone to ‘betrayal’.
4️⃣ Absolute Encoder: The ‘Memory Master’ That Never Forgets
Expertise: Data retention during power loss, suitable for high-precision positioning.
Pitfall: Expensive, not suitable for small devices.
III. Practical Solutions: 3 Steps to Build a ‘0.1% Error’ Production Line
1️⃣ Hardware Selection: Don’t Let ‘Bronze’ Mix into the ‘King’s League’
2️⃣ Wiring Principles: Stay Away from ‘Signal Assassins’
Principle 1: Keep signal lines separate from power lines, maintaining at least a 30cm distance.
Principle 2: Use twisted pair shielded cables, grounding the shield at one end.
Principle 3: Adjust input filtering time according to frequency, e.g., set to 0.1ms for 100kHz.

3️⃣ Software Debugging: Don’t Let the Program ‘Hold You Back’
Secret 1: Use interrupt service routines to handle counting, avoiding interference from scanning cycles.
Secret 2: Regularly reset the counter to prevent value overflow.
Secret 3: Use OB32 timed interrupts to monitor counting status.
IV. Pitfall Guide: Avoid These ‘Landmines’!
❗ Misconception 1: Not changing the default filtering time
Consequence: The S7-1200 has a default filtering time of 6.4ms, which will eliminate signals above 100Hz!
Solution: Change the filtering time to 0.1ms in the hardware configuration.
❗ Misconception 2: Mixing encoder wiring
Consequence: Mixing NPN and PNP signals can burn out the module!
Solution: Use a multimeter to measure output types; connect NPN to source input and PNP to sink input.
❗ Misconception 3: Pulse frequency exceeding the limit
Consequence: The CPU1217C has a maximum of 1MHz, while ordinary models can only reach 100kHz.
Solution: Use a signal board extension, supporting up to 200kHz.
Finally, here’s a saying for everyone: “Is PLC counting inaccurate? It’s not that the equipment is faulty, it’s that you haven’t used the right method!” Like the TOP3 to receive the ‘Industrial Protocol Secrets’, follow me for daily hardcore PLC insights!