When I was learning how to code, I organized all my code around the inputs. I would start with my inputs, figure out what conditions I wanted to test, and then each condition had an associated action. If X and Y are true, I want motor A and motor B to start. This lead to a lot of latch/unlatch logic, and things got kinda messy.
Over time, I realized that things generally worked better and were more readable if i tried to organize my l logic around the outputs instead. I thought about under what conditions I wanted a certain output to be on. Each output got one coil, and anything that needed to be included went in the same rung. instead of conditions 1, 4, and 7 each turning on the output, I would have one network where the output turned on if either condition 1, 4, or 7 were true. Eventually I started using state machines to simplify that logic a bit, but it would still be essentially the same.
It's kind of a subtle difference, but it has allowed me to simplify the way I code, and things have become a lot more readable.
Over time, I realized that things generally worked better and were more readable if i tried to organize my l logic around the outputs instead. I thought about under what conditions I wanted a certain output to be on. Each output got one coil, and anything that needed to be included went in the same rung. instead of conditions 1, 4, and 7 each turning on the output, I would have one network where the output turned on if either condition 1, 4, or 7 were true. Eventually I started using state machines to simplify that logic a bit, but it would still be essentially the same.
It's kind of a subtle difference, but it has allowed me to simplify the way I code, and things have become a lot more readable.