You are on page 1of 2

Programming Examples

B.2

Example: Bit Logic Instructions

Example 1: Controlling a Conveyor Belt


The following figure shows a conveyor belt that can be activated electrically. There are two push button switches at the beginning of the belt: S1 for START and S2 for STOP. There are also two push button switches at the end of the belt: S3 for START and S4 for STOP. It it possible to start or stop the belt from either end. Also, sensor S5 stops the belt when an item on the belt reaches the end.

Sensor S5

MOTOR_ON

S1 S2

O Start O Stop

S3 S4

O Start O Stop

Absolute and symbolic Programming


You can write a program to control the conveyor belt using absolute values or symbols that represent the various components of the conveyor system. You need to make a symbol table to correlate the symbols you choose with absolute values (see the STEP 7 Online Help).
System Component Push Button Start Switch Push Button Stop Switch Push Button Start Switch Push Button Stop Switch Sensor Motor Absolute Address I 1.1 I 1.2 I 1.3 I 1.4 I 1.5 Q 4.0 Symbol S1 S2 S3 S4 S5 MOTOR_ON Symbol Table I 1.1 I 1.2 I 1.3 I 1.4 I 1.5 Q 4.0 S1 S2 S3 S4 S5 MOTOR_ON

B-2

Ladder Logic (LAD) for S7-300 and S7-400 Programming A5E00261407-01

Programming Examples

Ladder Logic Program to control the conveyor belt


Network 1: Pressing either start switch turns the motor on. S1 I 1.1

Q 4.0 S

S3 I 1.3

Network 2: Pressing either stop switch or opening the normally closed contact at the end of the belt turns the motor off. S2 I 1.2

Q 4.0 R

S4 I 1.4

S5 I 1.5

Ladder Logic (LAD) for S7-300 and S7-400 Programming A5E00261407-01

B-3

You might also like