Paul T,
I have been asking others in the department and engineering for more details. i also think i have created some confusion on my part. The 12 station machine runs independent of the 24 station machine. i just need them to run in the same manner.
When the process is finished, the operator manually removes the part.
The main constraint is water above all else. All other resources are fixed and are not a problem.
If the station faults, the parts must be salvaged if possible and reworked.
I want to limit the stations being run to a first come, first serve basis.
Other stuff is happening on the assembly line, but they are processed as they come down the line, first come, first served.
To be honest, i don't know if i need a fifo or not. What i want to do is process the first start pushbutton pressed and then hold in memory the order the remaining pushbuttons are pressed. When station 1 for example is done, process station 2 or 10 or whatever is next.
We are only able to run one product at a time thank goodness.
Production is key as you said, but not if we scrap more than we make.
regards,
james
Hm. So, can you simply count the number of stations that are running and limit it? Then, when a START is pressed, you capture it and every minute or so you look at the count and then start stations as allowed?
This would be pretty easy, assuming that your START PB is now wired to the PLC.
First, you'd create a STN RUNNING flag for each station. Well, you will probably need to do this anyway no matter what. This is set when the station actually starts, and cleared when the station is done. Maybe when it faults if the water valves close when that happens, otherwise not.
Then, you'd create a STN START REQUEST flag for each station. That is tied to the existing START PB. When the OPR presses START, it sets that flag. Bonus points... if the OPR happens to press the START PB and the station is already running or faulted or offline, nothing happens... i.e., flag is not set. When the station starts, it clears the flag. If you do in fact need a FIFO, the FIFO stack would replace this - keep reading, LOL!
Then, you'd create a STN START CMD flag for each station. That replaces the existing START PB contact in the existing station logic. Again, when the station starts, it clears that flag.
I say flags, but I do this stuff using N registers that I set to 0 or 1 rather than using bits in B words. Personal preference. I like N registers because I can write them in more than one place, I can use different values in them if I need more than two states, and I can clear them all to zero with a simple FLL whenever I need to do a system reset. Pet Peeve!! Whatever you do, registers or bits, write logic to clear them all via the HMI, the EStop, preferably both, so that if an individual station, or the whole machine, needs to be reset it can be.
Anyway. Now that you have a bunch of new flags, write a new subr. Call it every minute using a timer.
It starts by clearing a register that holds the current run count, then adds one for each station that is running.
Now for each station, create a rung that is [STN RUNNING COUNT < MAX ALLOWED RUNNING COUNT] - (not STN RUNNING) - (STN START REQUEST) in series. If those are all true, set STN START CMD for whatever STN we're examining and add 1 to STN RUNNING COUNT.
So you have 12, or 36, rungs, one for each station. The logic scans down them and if the count is less than max, the station is not running, and the station run request flag is up, the station start flag will be set.
The drawback is that this starts STN1, STN2, etc and maybe never gets to STN12 or STN36 if the OPR keeps removing product from the first stations and putting new product in. To do what you want - capture the PB press and then run the stations in that order - yup you need a FIFO.
So, in that case the FIFO is loaded with the station number, rather than setting the STN START REQ flag, whenever the START PB is pressed. In the new subr, if the running count was less than the allowed count, you would unload the FIFO and, with that number that you unloaded, use indexed addressing to set the RUN CMD flag for that station. (So if you're still awake, the START REQ flags would go away since the FIFO would be holding that info.)
Clear? LOL! But the biggest question at this point is, what is the baseline logic for running the stations?? If it's just a simple count of what's running, great. If it has to be more than that, you need to know that first.
Sorry, gotta go do some work! But let us know what the STN START criteria are, then we can help figure out the logic to do it. You probably do want a FIFO, it's not that bad once we know the criteria for using it.