J
Not counting off-delay timers in AB products, there are valid uses for most of the other instructions in PLCs. I do agree that an
overuse of latches is a clear indicator of extensive patching.
One shot instructions are handy for anti-repeat logic for buttons coming from intelligent devices.
Scan races are the most difficult thing to find. I agree that good programming avoids them by being structured and concise. Another good indicator of spaghetti programming is when there's
a programming terminal attached to the PLC around the clock, and the associated 'expert' has his pager number written nearby. "Old Joe, he really knows that PLC program. Whenever the machine is messed up, he knows exactly how to get it going
again." Sound familiar?
- - -
In a previous thread ( RE: ENGR: PLC code standards - "http://www.control.com/addPostingForm?pid=1026153091":http://www.control.com/addPostingForm?pid=1026153091 ):
"I have seen hundreds of PLC programs written by other people that used a lot of latches. I am pretty sure there was no attempt at creating any kind of state machine in any of these programs. It was just really awful code, written by people who just were not very good. If you will remember what I said was "You can always tell when someone is using too many latches because they end up with a bunch of singleshots in the code to get rid of the scan races." If it was good code, and a well thought out state machine, it would not have the one shots or the scan races."
overuse of latches is a clear indicator of extensive patching.
One shot instructions are handy for anti-repeat logic for buttons coming from intelligent devices.
Scan races are the most difficult thing to find. I agree that good programming avoids them by being structured and concise. Another good indicator of spaghetti programming is when there's
a programming terminal attached to the PLC around the clock, and the associated 'expert' has his pager number written nearby. "Old Joe, he really knows that PLC program. Whenever the machine is messed up, he knows exactly how to get it going
again." Sound familiar?
- - -
In a previous thread ( RE: ENGR: PLC code standards - "http://www.control.com/addPostingForm?pid=1026153091":http://www.control.com/addPostingForm?pid=1026153091 ):
"I have seen hundreds of PLC programs written by other people that used a lot of latches. I am pretty sure there was no attempt at creating any kind of state machine in any of these programs. It was just really awful code, written by people who just were not very good. If you will remember what I said was "You can always tell when someone is using too many latches because they end up with a bunch of singleshots in the code to get rid of the scan races." If it was good code, and a well thought out state machine, it would not have the one shots or the scan races."