i want make a simple program in cx- programming.. i have 4 sensor(detect the box). how to count the boxes that have presents..if all the boxes comes at the same time how can i count it?..
If you're saying all 4 boxes come together with no space between they may be sensed as one (long) box, if that's the case I would have a conveyor section going a little faster to pull the box to be counted away from the next box, & count the box when you're sure it's separated.
It is a bit difficult to read your JPG files, but I suspect you are monitoring in decimal instead of hex/BCD.
Check the symbol in front of the number, & is decimal, # is hex/BCD. 12 BCD = 18 decimal.
Yes. It appears that you are reading some boxes more than 1 time. Try this: use all 4 sensors to create a "Read" Bit (Sensor 1 and Sensor 2 and Sensor 3 and Sensor 4 = Read Bit). This Read Bit goes on only when all 4 sensors see a box at the same time. Then use Sensor 1 and Read Bit = Counter 1; and Sensor 2 and Read Bit = Counter 2, and so on for all 4 Counters. That should prevent reading a box more than 1 time.
The problem may come up IF there are ever less than 4 boxes in each hanger. Then you would have to come up with some additional logic.