¢ ¢
Like Ron Doran, I look at the rung like a circuit. I'm just trying to make a connection from one side to the other.
One thing I try not to do is to get too bogged down in the details. I have to remind myself constantly to "look at the big picture".
The contradictory part is that you can't let the picture get too big. Here's what I mean:
In troubleshooting, the basic question is "Why doesn't the #%&$# machine work!!!.
That's too big of a picture. Take a step closer and ask: "What
should be happening right now?" - The answer may be: "The motor should be coming on". Then, first thing I do is find out if the PLC is indeed trying to turn on the motor.
I look at Ron (Beaufort)'s gobbly-gook code above, and sure enough, O:3/2 isn't energized. So the question become: "Why?"
Thankfully, the thing that's holding up the process isn't that tangle of imputs. There's a clear path through I:2/8 - I:2/10 - I:1/7.
But there are still three thing that are holding up the works: B3/7, O:4/4 and I:9/14.
Now since Ron was kind enough to leave off the annotation, I'd hazzard a guess that O:4/4 and I:9/14 are related - that once the output is made, the input will come on. So I'd first write down B3/7 on a scrap of paper (if, in my travels, I see that it's hanging up the works, I'll change course and go after it instead". Then I'd do search or cross-reference to find out why O:4/4 isn't on, and off I'd go.
But I may already be too deep into the weeds already. Perhaps it's time for a big picture view. I've asked "Why isn't the motor coming on?" Well, why do I think that the motor should be coming on? What step in the sequence am I on? What's really going on here? Where does the PLC think that it is? It could be that the PLC, for some reason, thinks that the motor started, did it's thing, and is now on to something else. Trying to find out why the motor isn't coming on is a fool's errand. The PLC isn't stuck trying to start the motor. The PLC started and stopped it in one scan, did some other cleanup, and now is waiting for a physical condition to happen that can't, because it didn't alter the real world enough to make it happen.
(Example: The motor is supposed to pump water into the tank until a level switch is made. Then it's supposed to run the agitator (which is interlocked with the level switch), and proceed to time when it's confirmed that the agitator is running.
Except that someone bumped into the tank, causing the over-sensitve level switch to make for just a moment. So the pump stopped (at "level"), but the agitator doesn't come on, beause there's no liquid in the tank.
If you're not taking the "big picture" view, you miss the fact that you and the PLC are not trying to accomplish the same goals.
So what winds up happening is that, when I'm troubleshooting, I don't clutter my mind with facts. There will be lot's of code that I just ignore, because I know it's not applicable to my current problem. (Sometimes that's wrong, but it's one way to get going. When it IS wrong, I'll use the formal troubleshooting techniques that Ron (B) describes).)
I've seen enough code in my life that I can often tell, just by the general shape of it, whether there's a problem with it or not (Ron's gobbly-gook code set my teeth on edge. I'd spend quite a bit of time looking at that one before I was convinced that there wasn't at least a cleaner way.
Ron Beaufort said:
of course I only need to use this approach when I’m working on something a little more complicated than the average run-of-the-mill program
I don't know, Ron. A program that runs a whole mill is usually pretty complicated.