Programming A Plc:Entering the Program

Entering the Program

Now that the circuit has been developed, it must be entered into the memory of the CPU. When using a small programming terminal as shown in Figure 54 – 11, the program must be entered in a language called Boolean. When programming in Boolean, to connect one contact in series with another, the AND function must be used. To connect a contact in parallel with another, the OR function is used. To change a contact from open to closed, the NOT function is used. To start a line of the program, the STR function must be used. To end a line of the program, the OUT function is used except when programming a special function such as a timer or counter. When ending a line of the program with a timer, the TMR function is used; when ending the line with a counter, the CNT function is used. Each component of the program must be entered into memory us- ing the ENT key. Some of the keys on this programming unit use serve two functions. The AND key, for example, is also used to enter the number 7 into the pro- gram. The NOT key is also used to enter the number 0 into the program. The second function keys are very similar to the dual purpose keys on a typewriter where the shift key is used to access the second function of a key. The same is true for this unit. The SHF key is used to cause the keys to perform their second function.

Once the SHF key has been pressed, it will remain in effect until the ENT key is pressed. There is no need to hold the SHF key down when entering more than one digit into the program.

The first line of logic will be entered as follows:

STR SHF 0 ENT

AND NOT TMR SHF 601 ENT

TMR SHF 600 ENT

SHF .5 ENT

Notice that the STR command is used to start the line of logic. The SHF key must be pressed in order to permit the number 0 to be entered. The ENT command causes that instruction to be entered into the logic of the CPU. The AND function causes the next contact entered to be connected in series with the first contact, and the NOT command instructs the CPU that the contact is to be nor- mally closed instead of normally open. The TMR com- mand instructs the programmable controller that the contact is to be controlled by a timer. Since this line of logic is ended with a timer instead of a normal output or internal relay, the TMR command is used again to in- struct the CPU that the last coil is a timer and not an in- ternal relay or output. The CPU can interpret this last timer command to be a coil instead of a contact because directly following this command, the time of the timer had been entered instead of a tie command such as AND or OR. The time is entered with the use of a decimal

point in this controller instead of assuming each time in- terval to be 0.1 second. Different programmable con- trollers use different methods to enter the time.

The second line of logic is entered as follows:

STR SHF 0 ENT

AND NOT TMR SHF 600 ENT OUT SHF 10 ENT

The third line of logic is entered as follows: STR TMR SHF 600 ENT

TMR SHF 601 ENT

SHF .5 ENT

The fourth line of logic is entered as follows: STR SHF 0 ENT

AND NOT SHF 160 ENT OUT SHF 11 ENT

The fifth and sixth lines of logic will be entered to- gether because the sixth line of logic is connected in parallel with the fifth:

STR SHF 1 ENT OR SHF 160 ENT AND SHF 0 ENT OUT SHF 160 ENT

This completes the programming of the circuit into the CPU.

Review Questions

1. Why are NEMA symbols representing such com- ponents as push buttons, limit switches, and float switches not used in a programmable controller schematic?

2. Explain how to program an internal relay into the controller.

3. Why are the contacts used to represent stop buttons and overload contacts programmed normally open?

4. Why is the output I/O used to energize a motor starter instead of energizing the motor directly?

5. A timer is to be programmed for a delay of 3 min- utes. What number is used to set this timer?

6. When programming in Boolean, what command

is used to connect two circuit components together in series?

7. When programming in Boolean, what command

is used to connect two circuit components together in parallel?

8. When programming in Boolean, what command is used to change a contact from normally open to normally closed?

9. Why are the numbers 8 and 9 not used in an OCTAL based system?

Leave a comment

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