Well the way I’d do it is probably pretty crude by other’s standards but then again I’m not a PLC programmer by trade.
I’d use a timer and two counters (maybe more depending on how many molds you’re going to count).
The first part is simply counting how many molds per minute I.E. speed. When the system is running there is a timer set for 60 seconds and a counter counting the molds. When the timer hits 60 seconds move the counter’s accumulator to a register, reset the counter and timer. With this every 60 seconds you get a fresh PPM (Parts Per Minute). If you want to get real ***y you can (figure out a way to) move each count, up to a certain number, to a different register so you can see if the PPM is consistent per minute. I’m sure I could figure out how to do it but with stuff like that I have to teach myself as I go. Keep in mind that with the first part you have to move the data before you reset the timer and counter. I prefer to use an EQU function so that when the timer’s accumulator reaches 60 seconds it moves the data and then resets everything (just my preference. I don’t have a great argument as to if this is better other than my experience).
The next step would be to have a second counter that keeps a running count. It is also triggered when the timer reaches 60 seconds but it’s not reset afterwards. However at some point in time you’ll have to reset it as it has an upper limit. When I’ve needed to count events (in my case in a SLC or Micro) when the first counter (counting the total, not the PPM) reaches its max and goes done, I use the done bit to count up on another counter and reset the first total parts counter. I’ve done this to count completed message instructions that are running full tilt over days so I’ve strung that out to upwards of four and five counters. So that’s clear as mud right? Let me show an example, let’s say I’m using a MicroLogix 1100 to count something and I’ll need to count more than 50,000,000. Because the 1100’s counters max out at 32767 I’ll need two counters, C5:0 and C5:1. When C5:0 reaches 32,767 and goes done, I use the done bit (along with a one shot) to count up by 1 on C5:1 and then reset C5:0. With this, C5:1 represents the number of times C5:0 has reached 32,767. To figure out the total, multiply C5:1 by 32,767 and add C5:0’s accumulated value. So if C5:1 is at 2,000 and C5:0 is at 24,800, then: 2,000*32,767 = 65,534,000+24,800 = 65,558,800.
As I said before, there are probably better ways to do this but I’ve had a lot of luck with this method over the years and it’s pretty simple to setup.