SOLID-STATE CONTROLS:PROGRAMMING CONSIDERATIONS

PROGRAMMING CONSIDERATIONS

When developing a program for a programmable logic controller, there are certain characteristics of a PLC that should be considered. One of these is the manner in which a programmable logic controller performs its functions. Programmable logic controllers operate by scanning the program that has been entered into memory. This process is very similar to reading a book. It scans from top to bottom and from left to right. The computer scans the program one line at a time until it reaches the end of the pro- gram. It then resets any output conditions that have changed since the previous scan. The next step is to check all inputs to determine if they are high (power applied to that input point) or low (no power applied to that input point). This information is available for the next scan. The next step is to update the display of the programming terminal if one is connected. The last step is to reset the “watchdog” timer. Most PLCs contain a timer that runs continually when the PLC is in the RUN mode. The function of this timer is to prevent the computer from becoming hung in some type of loop. If the timer is not reset at the end of each scan, the watchdog timer will reach zero and all outputs will be turned off. Although this process sounds long, it actually takes place in a few milliseconds. Depending on the program length, it may be scanned several hundred times each second. The watchdog timer duration is generally set for about twice the amount of time necessary to com- plete one scan.

Scanning can eliminate some of the problems with contact races that occur with relay logic. The circuit shown in Figure 59–11 contains two control relay coils. A normally closed contact, con- trolled by the opposite relay, is connected in series with each coil. When the switch is closed, which relay will turn on and which will be locked out of the circuit? This called a contact race. The relay that is turned on depends on which one managed to open its normally closed contact first and break the circuit to the other coil. There is no way to really know which relay will turn on and which will remain off. There is not even a guarantee that the same relay will turn on each time the switch is closed.

Programmable logic controllers eliminate the problem of contact races. Because the PLC scans the program in a manner similar to reading a book, if it is imperative that a certain relay turn on before another one, simply program the one that must turn on first ahead of the other one. A similar circuit is shown in Figure 59–12. When contact 1 closes, coil 100 will always be the internal relay that turns on because it is scanned before coil 101.

Solid-State Controls-0617

Leave a comment

Your email address will not be published. Required fields are marked *