Baconcrunchwrap
Member
OP
Don’t worry Dude the OP isn’t going to steal your program for his “ homework”
I think other replies here are correct, to give you a bit of a start I suggest you get a sheet of paper & think about the sequence of events, from there you should be able to put some code together.
Without actually showing you code here is a way of doing it.
Assume PLC is first powered up, & it is not in auto run.
So the first thing is the auto start latch (seal in circuit).
The logic needs the following:
The start button is pressed. and providing the count is less than 20 (i.e. a compare) and the stop button is on (N/C & not pressed) then it outputs the internal memory bit "Auto Run", this is ORED with the start button to seal it in.
Explanation: you need to drop out the auto if stop button pressed or the count = 20 (Counter.DN bit).
Then the solenoid that extends the stamp logic:
If we are in Auto Run, AND NOT Stamp Extended, out the stamp solenoid
Then we need to retract it:
If in auto AND the stamp is extended, Retract it.
Then we need to count the number of stamps:
Increment the count.
After the counter reaches 20 then the auto drops out.
A reset operation on the reset switch resets the count and allow the system to re-start.
This takes 5 rungs of simple code.
Rung 1 Auto Stop/Start latch
Rung 2 Extend stamp
Rung 3 Retract Stamp (memory bit as only single acting solenoid)
Rung 4 Counter
Rung 5 Ink out lamp
@Baconwrapcrunch,
Seriously, this forum contains a plethora of experience that has written programs similar if not identical to these dozens if not hundreds of times. These problems are trivial to that wealth of experience even if they are opaque to you, and that experience is more than willing to share.
But beware: mocking that experience with what could be a transparently minimal effort in an attempt to get a solution will not end well.
I did not enjoy writing that, but I feel it needed to be said.
And if your attempts were indeed genuine then I apologize as it only means you have a longer, though certainly navigable, path ahead.
With that out of the way, as a start, especially as it appears the ladder logic is beyond you at this point, please describe in prose what you are doing on each of those rungs.
Start with the last one, which should be the simplest of the entire program. I.e. what events or states cause the lamp L1 to be either on or off? Don't be concerned yet with how those events or states come to be or not to be, that is not the question ; just describe them in words.
Every long journey begins with a single step, and working backwards from there might be a workable path to the complete solution.
I am glad I was wrong, and again I apologize. My intention was not to mock you, only to find out your true intent. If you are serious, then great, let's get this done.@Dr. Boybits,
This is exactly the situation I find myself in. Sign up for PLC class at local college and the lab supervisor cannot be bothered to get up from his YouTube videos to attempt to help out or teach anything. Literally the only things I do know are from on the job training with an experienced controls tech.
Just like Mueller34, I would like to test my skill.
Would you guys take a look at my program?
I did the Skill 5 one. With 2 presses.
And to be fair, you did more or less mention the issue with Press 2 being stuck between its limit switches.Nice; it should mostly work. Comments below.
Rungs 0/1/2 appear, at first blush, to implement a start-dominant latch circuit
To be fair, it should work (too much noise to be certain),
But it could almost certainly be reduced to some form or the State Coil Circuit pattern (cf. here) on a single rung,
It does however beg the question of why it is not a more conventional stop-dominant latch using the Start/Stop Circuit pattern (cf. here), but the problem statement does not specify which button, Start or Stop, should be dominant.
-Nice this looks much better and easier to understand.In Rung 5, the [XIC S:FS] would be better placed in a branch in parallel with the Start condition [XIC Punch_Press_2_Extended] and Seal-in condition [XIC Press_2_Retract] branches
Great catch, now it adds 1 to the Good_Part_Count and Total_Part_Count each time a press is extended.The Good_Part_Count is not updated when the Total_Part_Count increments, but is only updated on Rung 7 when the Bad_Part button is pressed.
It was intended to not allow toggling of the extend limit switch to increment the part counters. (Should have been put in the rung comment. Comments are there now.)The purpose of Auto_Run is not clear, other than perhaps preventing an increment of Total_Part_Count on Rung 6 if the PLC starts up with either press's extend switch active, but the pre-scan logic of the ONS instructions would prevent that anyway.
I have implemented some code to combat this problem. (it is assuming we have an e-stop circuit). When the e-stop circuit is reset it will retract the cylinder.On Rung 5, if the PLC was started with neither limit switch on Press 2 active, then there is no way to move Press 2.
Gosh darn it you are right about the part counts not incrementing.
I think I would have to move rung 4 to before current rung 1. In order to have both of them work. Or do the other option that you suggested.
Thanks again for the helpful comments. It is nice to get constructive feedback.