here's a hint ...
digo_h,
rather than just hand you the answer, here’s another “beginner’s type” programming problem which might help … suppose that you have two fans to be controlled … call these FAN-A and FAN-B … suppose that the one switch for these fans can be turned to any one of three possible positions … suppose that one of the switch positions is marked “BOTH FANS” … while in this position, both FAN-A and FAN-B must run … suppose that another of the switch positions is marked “ONE FAN” … while in this position, only FAN-A must run … suppose that the last switch position is marked “OFF” … while in this position, both of the fans must be off …
now most beginners would try to write their rungs something along these lines:
BOTH FAN-A
----] [----+----( )----+----
| |
| FAN-B |
+----( )----+
ONE FAN-A
----] [---------( )---------
the idea is: "when the switch is in the BOTH position, I need both fans to run ... but when the switch is in the ONE position, I only need FAN-A to run" ... now this seems to make perfect sense to us (as humans) ... but the PLC doesn't think like a human ... it thinks like a machine ...
here's what happens step-by-step when the processor scans the rungs shown above while the switch is in the BOTH position ... first the processor sees that the BOTH condition is TRUE ... so TRUE logic reaches the FAN-A output ... this puts a ONE in the output bit box for FAN-A ... now most beginners think that having a ONE in the output bit box will turn the fan ON ... and it will ... but only if the ONE status is still in the bit box AT THE END OF THE SCAN ... in other words, the status of the output bit boxes is only transferred over to the actual output module AFTER the processor has finished solving the logic on ALL of the program rungs ... and it's not finished yet ...
next the TRUE logic reaches the FAN-B output ... this puts a ONE in the output bit box for FAN-B ... again, remember that the status of the output bit box will only be transferred to the actual output module after the processor has finished solving the logic on ALL of the program rungs ... and it's still not finished yet ... we've got another rung to go ...
next the processor sees that the ONE switch condition is FALSE ... so FALSE logic now reaches the FAN-A output ... oooops! ... this puts a ZERO in the output bit box for FAN-A ... now when the processor finally reaches the end of the scan, look what the status of the FAN-A bit box will be ... it's a ZERO ... and so the screw for FAN-A on the output module will be turned OFF ... even though the switch position calls for both fans to be on ... so using these two rungs, only FAN-B will run when the switch is in the BOTH position ...
this is called a "double-coil" problem ... most beginners like to say "the last output wins" ... there's a little more to it than that, but that's the general idea ...
so what do we do to solve the problem? ... instead of thinking from left to right as we enter the rungs, let's try thinking from right to left ... this is a very handy programming trick ... suppose that we enter the following rungs to get started ...
FAN-A
------------( )----
FAN-B
------------( )----
now clearly we're not done ... we still need to add something about the switch conditions at the left end of each of the rungs ... but the fact is that we ARE FINISHED WITH THE RIGHT ENDS ... specifically, we need ONE output for FAN-A ... and ONLY one output for FAN-A ... and we need ONE output for FAN-B ... and ONLY one output for FAN-B ... and so the right side of our program is now finished ... completely finished ... and if we add anything to the right side we'll mess it up ... and if we take anything away from the right side we'll mess it up ... so let's leave the right side alone ...
now go back to the left side and decide how you're going to reference the BOTH and the ONE switch positions ... then you'll be through and the fan program will work correctly ...
your programming problem can be solved by thinking along these same lines ... party on ...