Looks like you achieved all the student exercise goals except the following two:
Your program reverses direction instead of stopping the door when the opposite-direction-of-travel buttton is pressed. Although that might be what you wanted, it is not what the specifications called for. If you write programs for a living, you will have to learn to give the customer what was asked for, not what you thought he needed.
Thanks for the comments..
I checked the coding again and I did do that 2 parts u mentioned above about opposite-direction-of-travel button..
Rung 1 & 2 is about stopping the motor when it is opening without closing it and Rung 7 & 8 is about stopping the motor when it is closing without opening it..
When the door is closing, pressing "Open Button" and holding it will stop the door. However the door will not open because "Latch Closing" is still HIGH.
One of the conditions for the "Opening State" is "Latch Closing" being LOW (Rung 0). "Latch Closing" will only be LOW at the release of "Open Button" (Rung 8)..
When "Open Button" is pressed the second time, then only the door will open..
The same thing also applies to the door opening..
As for Rungs 1 and 5 having only 1 output, those are the latches i used for only the above purposes. Because of that i decided to keep it separate and independent..
Honestly, when I was coding it, I didn't feel comfortable doing opposite-direction-of-travel part that way, but i didn't know of better way to do it.. Any idea on how I can make the code less confusing, easier to read and also easier to modify (as in minimal changes to get the job done)..?
Thanks..