gblack

MrPLC Member
  • Content count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About gblack

  • Rank
    Hi, I am New!

Contact Methods

  • ICQ 0
  1. I have an application where I need to shut down a machine if 5 of the last 10 parts were bad. I wrote some code that uses a bit shift to set bits in a word for every bad part, but I can not find a simple way to count the bit on in a word. I did come up with a method of using these bits to count into another word and it works fine for 10 parts but would get pretty complicated if I have to expand it to 20 or 30 parts. Does anyone know a simple way to get a percentage of bad vs good parts? The application is using a micrologix 1000 with an input to show a part is in the test area and an input that identifies the part as good.