Author Topic: People Counter  (Read 39 times)

Lorne Van Dusen

  • Jr. Member
  • Posts: 83
  • I'm a old guy
    • View Profile
People Counter
« on: February 13, 2020, 05:11:05 PM »
I had some spare time and decided to show a simple people counter circuit that emulates an incremental encoder in a ladder circuit. I am hoping that this may help some new comers to help understand the use of ladder logic as well as some Basic.
This program shows how to store a DM32 set value as well as the DM32 count value into EEPROM and to move the stored value back into the original DM32 areas after the power comes back on. This may not be the most ideal way to count people or things but it does give an example of the use of edge triggered bits as well as latching relays and how to use a DM value as a up down counter.


  • Expert Member
  • Posts: 459
  • Old PLC Coder
    • View Profile
Re: People Counter
« Reply #1 on: February 15, 2020, 05:44:55 AM »

Nice post. It made me have to do some thinking.

I decided to simplify your code a bit and demo how to use PLC COUNTERs to keep track of the running count. It isn't that hard, but it doesn't handle negative numbers.

The high-speed counter mechanism is probably a better approach than ladder logic for most applications. The biggest limitation is the PLC ladder logic scan rate needs to be significantly faster the rate that the A and B inputs change state.

Best Regards,

Gary Dickinosn
« Last Edit: February 15, 2020, 06:31:25 PM by garysdickinson »