High-Speed Counting: Hardware vs. Software
When measuring rapid inputs like high-speed water meters, optical sensors, or spinning fans, standard software logic cycles might not be fast enough. If a rapid electrical pulse happens "between the photos" of your PLC's standard execution cycle, your software logic will completely miss it.
This is where hardware counting becomes essential. Utilizing dedicated chips on the PLC that never sleep, hardware counting accurately captures every single electrical pulse regardless of the main CPU's cycle time.
Important Note: Hardware counting is not a universal software feature; it requires supported edge hardware with dedicated high-speed inputs. Capabilities will vary depending on your setup, but common supported devices include Patron Unipi units, specific Wago counter input terminals, and specialized Modbus modules.
Configuring the Debounce Filter (Unipi Units)
While hardware counting is incredibly accurate, physical switches can sometimes create mechanical "bouncing"—a tiny, rapid flickering of the electrical signal as the contact closes. To prevent the system from counting a single switch press as multiple pulses, we use a filtering method.
Filtering capabilities vary by hardware manufacturer, but for Unipi units, you can easily adjust this using the Debounce property directly in the Mervis IDE (highlighted above). Just remember: when capturing genuinely high-speed pulses (like from a flow meter), you must lower your debounce filter appropriately (e.g., to 5ms or lower) so you aren't accidentally filtering out real data!
Helpful Links & Resources
- Technical Documentation: High-Speed Counting Tutorial