115
LEARNING ACTIVITY PACKET MECHATRONICS BASIC PLC PROGRAMMING (SIEMENS S7-300/STEP 7) B25014-AA02UEN

BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

Embed Size (px)

Citation preview

Page 1: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

LEARNINGACTIVITYPACKETMECHATRONICS

BASIC PLC PROGRAMMING(SIEMENS S7-300/STEP 7)

B25014-AA02UEN

Page 2: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

2

LEARNING ACTIVITY PACKET 2

BASIC PLC PROGRAMMING

INTRODUCTIONThis LAP covers how to enter, edit, and store PLC programs using PLC software.

Additionally, this LAP discusses the PLC’s memory, how it is organized, and the types of numbering systems commonly used with the PLC. All of these skills are important to fully understand and operate the Siemens S7-300.

ITEMS NEEDEDAmatrol Supplied 1 870-PS7313-AAU, 870-PS7314-AAU, or 870-PS7315-AAU Mechatronics Learning System-S7 1 87-IOSS7-AAX I/O Simulator Learning System 1 87-MS1 Pick and Place Feeding Station or 1 87-MS2 Gauging Station or 1 87-MS3 Orientation-Processing Station or 1 87-MS4 Sorting-Buffering Station or 1 87-MS5 Servo Robotic Assembly Station or 1 87-MS6 Torque Assembly Station or 1 87-MS7 Inventory Storage Station

Amatrol or School Supplied 1 82-900 Step 7 Programming Software 1 72024 PC Programming Interface for Siemens S7 PLCs

School Supplied 1 Computer 1 Printer

FIRST EDITION, LAP 2, REV. CAmatrol, AMNET, CIMSOFT, MCL, MINI-CIM, IST, ITC, VEST, and Technovate are trademarks or registered trademarks of Amatrol, Inc. All other brand and product names are trademarks or registered trademarks of their respective companies.Copyright © 2012, 2011 by AMATROL, INC.All rights Reserved. No part of this publication may be reproduced, translated, or transmitted in any form or by any means, electronic, optical, mechanical, or magnetic, including but not limited to photographing, photocopying, recording or any information storage and retrieval system, without written permission of the copyright owner.Amatrol,Inc., 2400 Centennial Blvd., Jeffersonville, IN 47130 USA, Ph 812-288-8285, FAX 812-283-1584 www.amatrol.com

Page 3: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

3

TABLE OF CONTENTS

SEGMENT 1 NUMBERING SYSTEMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4OBJECTIVE 1 List fi ve types of numbering systems and explain their importance to PLCsOBJECTIVE 2 Describe the operation of the decimal numbering system and give an applicationOBJECTIVE 3 Describe the operation of the binary numbering system and give an application

SKILL 1 Convert between decimal and binary

SEGMENT 2 PLC MEMORY ORGANIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14OBJECTIVE 4 Describe the S7-300’s memory organizationOBJECTIVE 5 Describe the operation of the S7-300’s Input and Output Process Image tables

SKILL 2 View the status of the S7-300’s Input and Output Process Image tables

SEGMENT 3 PLC PROGRAMMING SOFTWARE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38OBJECTIVE 6 Describe the structure of an S7-300 projectOBJECTIVE 7 Describe three advantages of Programming a PLC with a PC

SKILL 3 Create and confi gure a PLC project using the SIMATIC ManagerSKILL 4 Enter and save a basic PLC program using the SIMATIC ManagerSKILL 5 Edit a PLC program using the SIMATIC ManagerSKILL 6 Generate and print out a ladder logic report using the SIMATIC Manager

SEGMENT 4 PLC PROGRAM ANALYSIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100OBJECTIVE 8 Describe how an input device can reference multiple input instructionsOBJECTIVE 9 Describe how the input device logic affects input instruction logicOBJECTIVE 10 Describe how a PLC controls multiple outputs at the same time

Activity 1 Control of multiple outputs

Page 4: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

4

SEGMENT 1NUMBERING SYSTEMS

OBJECTIVE 1 LIST FIVE TYPES OF NUMBERING SYSTEMS AND EXPLAIN THEIR IMPORTANCE TO PLCs

PLCs use numbering systems for everything from input addresses to math instructions. Because the type of data used varies from instruction to instruction, PLC designers have found it useful to have more than one type of numbering system. The fi ve types of numbering systems commonly used by PLCs are:

• Hexadecimal• Decimal• Binary• Octal• Binary Coded Decimal (BCD)

Both technicians and engineers must be thoroughly familiar with all fi ve numbering systems.

OBJECTIVE 2 DESCRIBE THE OPERATION OF THE DECIMAL NUMBERING SYSTEM AND GIVE AN APPLICATION

The numbering system you use every day to count money, keep score, add, subtract and multiply is known as the decimal numbering system. By understanding the operation of the decimal system, you can easily learn other numbering systems.

Every numbering system has a base or radix. Decimal is a base 10 numbering system and is said to have developed from the fact that most people have ten fi ngers.

The base of a numbering system determines the total number of unique symbols used in that system. Also, the largest-valued symbol of the system is always one less than the base. For example, the ten symbols (numbers) used in the decimal numbering system are: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.

Page 5: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

5

To express numbers greater than nine, a place value or “weight” is assigned to each position that a digit holds starting from right to left. The fi rst position, starting from the right-most position, is position 0, the second is position 1 and so on up to the last position, as shown in fi gure 1.

The weighted value of each position can be expressed as the base (10 in this case) raised to the power of the position, as shown in fi gure 1. For the decimal system, the position “weights” from right to left are: 1, 10, 100, 1000 etc.

Figure 1. Weighting Factor of Decimal Numbering System

The value of the decimal number is computed by multiplying each digit by the weight of its position and adding the results. An example of this is shown in fi gure 2 using the four-digit decimal number 5729. As shown in fi gure 2, the rightmost position of a number is commonly referred to as the least signifi cant digit (LSD), while the leftmost position is known as the most signifi cant digit (MSD).

Figure 2. Determining the Value of a Number Using the Weighting Method

As you will see later, the decimal equivalent of a number which is expressed in another base can be computed by using the weighting method.

X X X X

10 3 10 2 10 1 10 0

where X = any number 0-9 Value of position weights: 100 = 1 101 = 10 102 = 100 103 = 1000

PositionBasePosition Weight = 1

5 7 2 9

10 3 10 2 10 1 10 0

(MSD) (LSD)

9 x 10 0 =2 x 10 1 =7 x 10 2 =5 x 10 3 =

9 20 70050005729

DECIMALVALUE

ADD THERESULTS

Page 6: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

6

OBJECTIVE 3 DESCRIBE THE OPERATION OF THE BINARY NUMBERING SYSTEM AND GIVE AN APPLICATION

The binary numbering system is a base 2 numbering system, which includes two symbols, 0 and 1. This system is extremely useful in PLCs and digital elec-tronics in general. In digital electronics, for example, circuits operate using two discrete (separate) voltage levels. This is easily represented by a binary 1 for high voltage and by a binary 0 for no voltage. The S7-300, for example, uses binary numbering to keep track of the status of inputs, outputs, and instructions in its memory.

Some typical binary numbers and their decimal equivalents are shown in fi gure 3. Notice how the subscript number is used to indicate the base of the number.

EQUIVALENT NUMBERS

BINARY (base 2) DECIMAL (base 10)

011011012 10910

100011112 14310

101010102 17010

000110012 2510

111100002 24010

110011002 20410

Figure 3. Decimal Equivalents

Page 7: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

7

As with the decimal system, expressing numbers greater than the largest-valued symbol (1 in this case) is done by assigning a weighted value to each posi-tion from right to left. The decimal equivalent of a binary number is computed in a similar way as for a decimal number. Instead of 10 being raised to the power of the position, it is 2 that is raised to the power of the position, as shown in fi gure 4. For binary then, the weighted values of each position from right to left are: 1, 2, 4, 8, 16, 32, 64, etc.

Figure 4. Binary (base 2) Weighting Factors

X X X X X X X X

2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0

where X = any number from 0-1 Value of weighted positions: 2 0 = 1 2 1 = 2 2 2 = 4 2 3 = 8 2 4 = 16 2 5 = 32 2 6 = 64 2 7 = 128

(MSD) (LSD)

Page 8: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

8

SKILL 1 CONVERT BETWEEN DECIMAL AND BINARY

Procedure Overview

In this procedure, you will convert between the decimal and binary numbering systems.

We will step you through the procedure for converting between decimal and binary. Then you will do it yourself.

1. Perform the following substeps to convert the binary number 010011102 to

decimal form.

A. First, multiply each binary digit (LSD to MSD) by its appropriate weighting factor (as shown in fi gure 4). Then place the product in the space provided. The fi rst three digits have already been done for you. Try the others yourself.

B. Add the products together and write this number in the space provided. Be sure to write a subscript 10 (e.g. XX

10) to identify this number as decimal.

Your total should be 7810

.

0 1 0 0 1 1 1 0

2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0

Binary Digit

Weight Factor Product

0 X 2 0 = 0

1 X 2 1 = 2

1 X 2 2 = 4

X 2 3 =

X 2 4 =

X 2 5 =

X 2 6 =

X 2 7 =

Total =

(MSD) (LSD)

Binary Digits

WeightingFactors

Page 9: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

9

2. Perform the steps necessary to convert the following binary numbers into their decimal (base 10) equivalents. Use the method shown in step 1.

BINARY DECIMAL

011011012

011101112

000110112

011111002

011100112

011111112

000000012

001010102

010110112

000111012

Your answers should be:

011011012 = 109

10

011101112 = 119

10

000110112 = 27

10

011111002 = 124

10

011100112 = 115

10

011111112 = 127

10

000000012 = 1

10

001010102 = 42

10

010110112 = 91

10

000111012 = 29

10

Page 10: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

10

3. Perform the following substeps to convert the decimal number 112 to its binary equivalent.

The method used to convert a decimal number to a binary number is called successive division. Successive division is a method commonly used to convert decimal numbers to an equivalent value in another base. The idea in successive division is to divide the decimal number by the base of the number to which you want to convert (in this case 2) until the answer is zero.

In the case of decimal to binary conversion, each time 2 is divided into the decimal number and a remainder occurs, a binary 1 is produced in the binary number. Each time a 2 is divided evenly a binary 0 is produced. The binary number is converted from the least signifi cant (LSD) to the most signifi cant binary digit (MSD).

A. Divide the decimal number 11210

by the base of the binary numbering system, 2. Write the results in the space provided.

112 ÷ 2 = __________________________________________________

Two divides into 112 56 times with a remainder of zero. The remainder, you should recall, determines the digits in order from least signifi cant (LSD) to most signifi cant (MSD). The remainder 0, therefore, is the LSD of the equivalent binary number. Your calculations should appear similar to those shown below.

B. Carry the quotient of the fi rst step, 56, to the position just below 112 and divide it by 2; again placing the results in the space provided in your data sheet.

Your paper should appear as shown below. 56 divided by 2 is equal to 28 with a remainder of 0. Zero, therefore, is the next digit of the binary equivalent.

C. Carry, the quotient of the previous step, 28, to a position just below 56 and divide again.

Because 28 divided by 2 is equal to 14 with a remainder of 0, zero is the third digit of the binary equivalent.

RESULTS

112 ÷ 2 = 56 with a remainder of 0 (LSD)

RESULTS

112 ÷ 2 = 56 with a remainder of 0 (LSD)

56 ÷ 2 = 28 with a remainder of 0

Page 11: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

11

D. Continue the successive division method as described in substeps A-C, until the quotient is equal to zero, the remainder of which determines the converted number’s most signifi cant digit (MSD). When successive divi-sion results in an answer of less than one, (e.g.. 0.5), express the result as zero with a remainder as shown below.

Your results should appear as shown below.

E. Arrange the remainders from left (MSD) to right (LSD) as shown below.

Binary ____________________________________________________

Since there is no quotient left to divide, the conversion process is fi nished. Binary numbers, however, are generally arranged in groups containing eight digits. This can easily be done by simply adding a zero or zeros to the left side of the binary equivalent until eight positions have been fi lled as shown below. This does not affect the value of the binary number.

Congratulations, you have just converted a decimal number into its binary equivalent!

RESULTS

112 ÷ 2 = 56 with a remainder of 0 (LSD)

56 ÷ 2 = 28 with a remainder of 0

28 ÷ 2 = 14 with a remainder of 0

14 ÷ 2 = 7 with a remainder of 0

7 ÷ 2 = 3 with a remainder of 1

3 ÷ 2 = 1 with a remainder of 1

1 ÷ 2 = 0 with a remainder of 1 (MSD)

The binary equivalent of 11210 = 1 1 1 0 0 0 02

(MSD) (LSD)

The binary equivalent of 11210 = 0 1 1 1 0 0 0 02

(MSD) (LSD)

Page 12: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

12

4. Perform the steps necessary to convert the following numbers into their binary (base 2) equivalents. Use the method of successive division just demonstrated in step 3.

DECIMAL BINARY

7310

12210

7510

10010

12810

17510

1510

23210

13210

19510

Your answers should be:

7310

= 010010012

12210

= 011110102

7510

= 010010112

10010

= 011001002

12810

= 100000002

17510

= 101011112

1510

= 000011112

23210

= 111010002

13210

= 100001002

19510

= 110000112

Page 13: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

13

SEGMENT 1 SELF REVIEW

1. The fi ve types of numbering systems commonly used by PLCs are: ______, decimal, binary, octal, and binary coded decimal (BCD).

2. The numbering system you use every day to count money, keep score, add, subtract and multiply is known as the ______ numbering system.

3. The base of a numbering system determines the total number of unique ______ used in that system.

4. The largest-valued symbol of the system is always one less than the ______.

5. Decimal is a base ______ numbering system and is said to have developed from the fact that most people have ten fi ngers.

6. The rightmost position of a number is commonly referred to as the least signifi cant digit (LSD), while the leftmost position is known as the most signifi cant digit (______).

7. As with the decimal system, expressing numbers greater than the largest-valued symbol (1 in this case) is done by assigning a weighted ______ to each position from right to left.

8. The S7-300, for example, uses ______ numbering to keep track of the status of inputs, outputs, and instructions in its memory.

Page 14: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

14

SEGMENT 2PLC MEMORY ORGANIZATION

OBJECTIVE 4 DESCRIBE THE S7-300’S MEMORY ORGANIZATION

A programmable controller’s memory is divided into a number of sections or areas. Each area is used differently to store programs and data to perform specifi c functions. An S7-300 series controller contains four separate areas of physical memory.

Figure 5. S7-300 Memory Organization

LOAD MEMORY

DYNAMIC LOAD MEMORY (RAM,INTEGRATED OR ON A MEMORY CARD):CONTAINS THE USER PROGRAM

RETENTIVE LOAD MEMORY (EEPROM,ON MEMORY CARD OR INTEGRATED INS7-300 CPUs):CONTAINS THE USER PROGRAM

WORK MEMORY

WORK MEMORY (RAM)CONTAINS THE EXECUTABLE USERPROGRAM(FOR EXAMPLE LOGIC AND DATA BLOCKS)

SYSTEM MEMORY

SYSTEM MEMORY (RAM) CONTAINS:

PROCESS-IMAGE INPUT/OUTPUT TABLES,BIT MEMORY, TIMERS, COUNTERS

LOCAL DATA STACKBLOCK STACKINTERRUPT STACKDIAGNOSTIC BUFFER

MICRO MEMORYCARD (MMC)

M

L+

M

CPU314-2DPSF

BF

DC5V

FRCE

RUN

STOPPUSH

RUNSTOPMRES

SIMATICS7-300

SIEMENS

DI8xDC24VAI5/Ao2x12BIT

01234567

DI16/DO16xDC24V

01234567

01234567

01234567

01234567

Page 15: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

15

The memory areas of the S7-300 CPUs are:

•Load Memory - The Load memory stores user programs as they are down-loaded to the processor. The programs and data are downloaded without symbolic address assignments or comments since these are not needed by the processor to run the program. Blocks that are not required for startup are stored only in the Load memory. The portions of the program that the processor needs to execute the program are moved from the Load memory to the Work memory.

The Load memory may consist of an EPROM as well as RAM memory, depending on the model of the CPU. The Load memory can be expanded using micro memory cards.

•Work Memory - The program runs only in the Work memory and System memory areas. To ensure fast operation of the user program and to avoid unnecessary load on the Work memory (which cannot be expanded) only the parts of the blocks relevant for running the program are loaded in the Work memory. Parts of blocks that are not required for running the program (for example, block headers) remain in the Load memory.

•System Memory - The System memory of S7 CPUs is divided into an address area, a block stack, an interrupt stack, and a local data stack. The address area contains data about the machine or process being controlled, such as the on/off status of the input and output terminals (process image table), timer/counter information, and numeric variable information. Using instructions in your program, you can read and write data directly to the address area of the System memory. The format for addressing bits, bytes, words, and double words in the address area fi les is listed in the table on the next page.

•Micro Memory Card (MMC) - Many of the S7-300 CPUs, including the S7-312, 313, 314, 315, 317, and 318, require an MMC to operate. The MMC is used as Load Memory for the CPU, and to store blocks that are not immedi-ately needed by the CPU. The values contained in the blocks can be read and written to during operation, allowing data such as measured values or process recipes to be archived. The MMC also backs up RAM memory without the need for batteries.

The block stack, interrupt stack, and local data stack are memory locations used to temporarily store data and information about the various OBs (Organiza-tional Blocks) used in the project while the ladder logic program is running.

Page 16: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

16

S7-300 SYSTEM MEMORY ADDRESS AREA

Address Area File Type Identifi er Description

Process image input table Input

I - bitIB - byteIW - wordID - double word

At the beginning of the scan cycle, the CPU reads the inputs from the input modules and records the values in this area.

Process image output table Output

Q - bitQB - byteQW - wordQD - double word

During the scan cycle, the program calculates output values and places them in this area. At the end of the scan cycle, the CPU sends the cal-culated output values to the output modules.

Bit memory Memory

M - bitMB - byteMW - wordMD - double word

This area provides storage for interim results calculated in the program.

Timers Timer T T This area provides storage for timers.

Counters Counter C C This area provides storage for coun-ters.

Data block

Global data block, opened with “OPN DB”

DBX - bitDBB - byteDBW - wordDBD - double word

Data blocks contain information for the program. They can be defi ned for general use by all logic blocks (global DBs) or they can be assigned to a specifi c function block (FB) or system function block (SFB).Instance data block,

opened with “OPN DI”

DIX - bitDIB - byteDIW - wordDID - double word

Local data Local data bit

L - bitLB - byteLW - wordLD - double word

This area contains the temporary data of a block while the block is being executed. The L stack also provides memory for transferring block param-eters and for recording interim results from Ladder Logic networks.

Peripheral (I/O) area: inputs Peripheral input byte

PIB - bytePIW - wordPID - double word The peripheral input and output areas

allow direct access to central and dis-tributed input and output modules.

Peripheral (I/O) area: outputs Peripheral output byte

PQB - bytePQW - wordPQD - double word

Page 17: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

17

Each fi le in the System memory address area consists of a number of bytes of data. Each byte consists of eight bits that can each be set to a binary 1 (on) or 0 (off) to store data. Most areas can be addressed as individual bits, 8-bit bytes, 16-bit words, or 32-bit double words.

Figure 6 shows an example of the addressing scheme for the Bit Memory address area. The same scheme applies to the other fi le types in the address area. The top line shows how individual bits are addressed; in this case bit 2 of memory byte 0 is addressed using M0.2. Bit 4 of memory byte 3 is addressed using M3.4

Figure 6. Addressing the Memory Address Area

Data larger than 1 bit is addressed in groups of 8 (byte), 16 (word), and 32 (double word). The address for each is shown in fi gure 6 and described as follows:

• MBX- Memory byte x (i.e. MB0).• MWX- Memory word x (i.e. MW2).• MDX- Memory Double word x (i.e. MD0).

0 0 0 0 0 0 0 07 6 5 4 3 2 1 0

0 0 0 0 0 0 0 07 6 5 4 3 2 1 0

0 0 0 0 0 0 0 07 6 5 4 3 2 1 0

0 0 0 0 0 0 0 07 6 5 4 3 2 1 0

MB0 MB1 MB2 MB3MEMORY BYTE 3

MW2(INCLUDES MEMORY

BYTES 2 AND 3)

MD0MEMORY DOUBLE WORD 0

(INCLUDES MEMORYBYTES 0, 1, 2 AND 3)

M0.2BIT 2 OF MEMORY BYTE 0

M3.4BIT 4 OF MEMORY BYTE 3

ADDRESSING BITSMB.b

B - BYTE NUMBERb - BIT NUMBER

ADDRESSING BYTESMxB

x - B (BYTE - 8 BITS)W (WORD - 16 BITS)D (DOUBLE WORD - 32 BITS)

B - BYTE NUMBER

(1 BIT) BITS

(8 BITS) BYTES

(16 BITS) WORD

(32 BITS) DOUBLE WORD

Page 18: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

18

OBJECTIVE 5 DESCRIBE THE OPERATION OF THE S7-300’S INPUT AND OUTPUT PROCESS IMAGE TABLES

An input instruction is energized when its input terminal is on. An output terminal is turned on whenever its output instruction is energized. Neither of these operations occurs directly, but instead uses the input and output process image tables.

To understand how this works, examine fi gure 7. In this fi gure, there is a simple one-line program, or network, which turns on the output device M1 when PB1 is pressed. The bytes in the input and output process image tables for the related input and output modules are also shown.

Figure 7. Operation of the Input and Output Process Image Tables

0 0 0 0 0 0 0 07 6 5 4 3 2 1 0

BIT 0

INPUT BYTE I1

0 0 0 0 0 0 0 07 6 5 4 3 2 1 0

BIT 5

OUTPUT BYTE Q4

PB1

I1.0 Q4.5 M1

Q4.5I1.0

Network 1: Title:

Page 19: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

19

When the PLC is placed into the RUN mode, it begins its scan cycle. The PLC begins with the output portion of the scan cycle, PIQ (or process image output). It is in this section that the actual PLC outputs are turned on or off based on the status of the bits in the process image output table from the last scan. In this example, the PLC has already completed a scan cycle that read the inputs and evaluated the ladder logic in OB1, which set output bit Q4.5 on in the process image output table. The PIQ portion of the scan then turns the output on based on this value. All other terminals remain off because the output bits were set to zero in the program scan portion of the scan cycle. In this example, it is because the bits are not used in the program.

Figure 8. Output Scan (PIQ)

0

1

2

3

4

5

6

7

0

1

2

3

4

5

6

7

0

1

2

3

4

5

6

7

0

1

2

3

4

5

6

7

INPUT MODULE

0 0 0 0 0 0 0 17 6 5 4 3 2 1 0

INDICATORON

SCANCYCLE

OB1PROGRAM SCAN

PIIPROCESS IMAGE

INPUT

PIQPROCESS IMAGE

OUTPUT

BIT 0

INPUT BYTE I1

0 0 1 0 0 0 0 07 6 5 4 3 2 1 0

BIT 5

OUTPUT BYTE Q4

PB1

OUTPUT MODULE

+24 VDC

M1

PB1

I1.0 Q4.5 M1

Q4.5

INDICATORON

I1.0

Network 1: Title:

Page 20: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

20

After the output portion of the scan, the PLC begins the input portion of the scan cycle, PII (or process image input). First it scans the input terminal status, as shown in fi gure 9. During the input portion of the scan cycle the PLC looks at the on/off status of each input terminal and sets the input’s data bit to 1 or 0, depending on the status. This occurs for all input terminals.

For example, if input I1.0 is on during the process image input (PII) portion of its scan cycle, the PLC sees that it is on and sets bit 0 of input byte 1 to 1 in the process image input table. If an input is off, the PLC sets the bit for that terminal to 0 in the process image input table. Notice in fi gure 9 that all other bits in input byte 1 are set to 0. This means that their respective terminals are off.

Figure 9. Input Scan (PII)

0

1

2

3

4

5

6

7

0

1

2

3

4

5

6

7

INPUT MODULE

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0

INPUT BYTE 0 INPUT BYTE 1

INPUT BITSET TO 1

INDICATORON

INPUT BYTE 0

INPUT BYTE 1

SCANCYCLE

OB1PROGRAM SCAN

PIIPROCESS IMAGE

INPUT

PIQPROCESS IMAGE

OUTPUT

PB1

I1.0

Page 21: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

21

After the input portion of the scan, the PLC begins the program portion of the scan, OB1. The PLC uses the current values in the process image input and output tables to analyze the logic of the ladder diagram contained in Organizational Block OB1 and to call any additional blocks that need processing during the scan, such as those needed for interrupt processing or for subroutines. The PLC determines which outputs need to be turned on and which need to be turned off. It then sets the output bits in the process image output table to either 1 or 0.

In the case of the program shown in fi gure 10, bit 5 of output word Q4 is set to 1 because its network is true. It does not actually turn the output on itself; it only sets the bits in the process image output table.

The motor is already on because it was turned on during the PIQ portion of the last scan cycle. It will remain on because output bit Q4.5 will be set to on in the process image output table and the output will remain activated during the next PIQ portion of the scan cycle.

Notice that the other output bits in byte Q4 are set to 0. This is because either their output coils are located on a network that is not true or they are not used in the program at all.

Page 22: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

22

Figure 10. OB1 or Program Scan

0

1

2

3

4

5

6

7

0

1

2

3

4

5

6

7

0

1

2

3

4

5

6

7

0

1

2

3

4

5

6

7

INPUT MODULE

0 0 0 0 0 0 0 17 6 5 4 3 2 1 0

INDICATORON

SCANCYCLE

OB1PROGRAM SCAN

PIIPROCESS IMAGE

INPUT

PIQPROCESS IMAGE

OUTPUT

BIT 0

INPUT BYTE I1

0 0 1 0 0 0 0 07 6 5 4 3 2 1 0

BIT 5

OUTPUT BYTE Q4

PB1

OUTPUT MODULE

+24 VDC

M1

PB1

I1.0 Q4.5 M1

Q4.5

INDICATORON

I1.0Network 1: Title:

Page 23: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

23

This scan cycle actually occurs many times each second so that it appears that the ladder logic program is responding directly to the inputs and outputs. For example, as soon as PB1 is pressed and released, the input bit is reset to 0, which in turn causes the output bit to be set to zero and the output terminal to be turned off, as shown in fi gure 11.

Figure 11. PB1 Released, Input and Output Bits Set to 0

0 0 0 0 0 0 0 07 6 5 4 3 2 1 0

BIT 0

INPUT BYTE I1

0 0 0 0 0 0 0 07 6 5 4 3 2 1 0

BIT 5

OUTPUT BYTE Q4

PB1

I1.0 Q4.5 M1

Q4.5I1.0

Network 1: Title:

Page 24: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

24

SKILL 2 VIEW THE STATUS OF THE S7-300’S INPUT AND OUTPUT PROCESS IMAGE TABLES

Procedure Overview

In this procedure, you will use the SIMATIC software to view the PLC’s input and output process image tables. This will familiarize you with the operation of the PLC’s image tables and with the operation of the PLC in general.

1. Perform the following substeps to prepare the PLC trainer for use.

A. Verify that the Portable Mounting Console and 87-IOS are connected.

B. Make sure that the PLC power cable is connected to the 870-PS7 and plugged into an outlet.

C. Verify that the PLC power cable’s toggle switch is in the off position.

D. Make sure that the Interface cable is connected from the PC to the PLC.

E. Make sure that all of the 87-IOS Station’s switches are in the off (down) position.

2. Perform the following substeps to power up the PLC trainer.

WARNING

Most PLC applications require an organized startup and shutdown procedure to avoid personal injury and/or damage to the machinery. Be certain to follow these procedures when in the fi eld.

A. Turn the PLC power cable’s toggle switch to the on position.

B. Place the PLC’s Mode Selector switch into the RUN position.

C. Turn on the personal computer and monitor. 3. Double-click the SIMATIC Manager Icon to Start the PLC programming

software. If a Project Window opens in the SIMATIC Manager, close the Project

Window by clicking the [X] in the top right corner of the window.

Page 25: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

25

The software should open and the SIMATIC Manager main screen, shown in fi gure 12, should be displayed.

Figure 12. SIMATIC Manager

NEW PROJECTLIBRARYBUTTON

OPEN PROJECT/LIBRARY BUTTON

Page 26: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

26

4. Perform the following substeps to open project IOLIST. This program causes the PLC to turn a lamp on when its corresponding input

is turned on (i.e. switch 1 turns on lamp 1, switch 2 turns on lamp 2, etc.).

A. Click the Open Project/Library button on the toolbar.

The Open Project dialog shown in fi gure 13 should appear on the screen.

Figure 13. Open Project Dialog

Page 27: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

27

B. Locate the project named IOLIST.

C. Double-click IOLIST to open the project.

The IOLIST Project Window, shown in fi gure 14, should open in the workspace.

D. Select Show All Levels (expand all in earlier versions) from the View menu to expand the project tree if it is not expanded.

The option is Expand All if using STEP 7 Version 5.2 or Show All Levels if using STEP 7 Version 5.3 and higher.

Figure 14. IOLIST Project Window

E. Take a moment to familiarize yourself with the Project Window.

The Project Window is separated into two halves, the left-hand side and the right-hand side.

The left-hand side contains the objects that make up a project in a tree structure. The right-hand side shows the contents of the selected objects on the left-hand side.

You will learn more about the objects in the Project Window in a later skill.

DOWNLOAD BUTTON

STATION OBJECT

PROGRAMMABLEMODULE OBJECT

S7 PROGRAM OBJECT

BLOCKS FOLDEROBJECT

LEFT-HAND SIDEPROJECT WINDOW

RIGHT-HAND SIDEPROJECT WINDOW

Page 28: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

28

5. Perform the following substeps to reset the PLC. Before downloading a project to the PLC, you should perform a memory

reset on the CPU to ensure that no retentive data is still in the CPU.

A. Place the PLC’s Mode Selector switch in the STOP position.

The green RUN light should turn off and the amber STOP light should turn on.

B. Place the Mode Selector switch in the MRES position and hold until the STOP light blinks slowly.

C. Release the Mode Selector switch and immediately return it to the MRES position.

The STOP light should blink quickly.

When it blinks quickly, the memory has been reset.

If the STOP light doesn’t blink quickly, repeat substeps A through C.

D. Place the Mode Selector switch into the RUN or RUN-P position. 6. Perform the following substeps to download project IOLIST to the PLC.

A. Click the SIMATIC 300(1) Station object to select (highlight) it.

Since the Station can be downloaded to the PLC, the Download button should have become active when you selected the Station object.

B. Click the Download button on the toolbar to begin the process of down-loading project IOLIST to the PLC.

The Download dialog shown in fi gure 15 should appear.

Figure 15. Download Dialog

Page 29: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

29

C. Click Yes.

A dialog should appear stating that the module will be stopped for loading of system data.

D. Click OK.

A dialog should appear asking if you wish to perform a Warm Restart.

E. Click YES. 7. Perform the following substeps to open the LAD/STL/FBD Editor.

A. Click the Blocks folder object so that its contents are displayed in the right-hand side of the Project Window, as shown in fi gure 16.

Figure 16. Displaying the OB1 Block

Page 30: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

30

B. Double-click the OB1 block on the right-hand side of the project window to open the LAD/STL/FBD Editor, shown in fi gure 17.

Figure 17. LAD/STL/FBD Editor

PLC MENU

Page 31: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

31

8. Perform the following substeps to monitor the input and output process image table.

A. Select Monitor/Modify Variables from the PLC menu.

A Variable Table Window, shown in fi gure 18, should open on your screen.

Figure 18. Variable Table Window

ADDRESSFIELD

Page 32: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

32

B. Right-click in the address fi eld to display a shortcut menu of options.

C. Select Insert Range of Variables from the menu.

The Insert Range of Variables dialog shown in fi gure 19 should be displayed.

Figure 19. Insert Range of Variables Dialog

D. Type I0.0 in the As of Address fi eld.

E. Click the up arrow to place an 8 in the Number fi eld.

You will monitor the fi rst byte of the input process image table. The fi rst byte contains addresses from I0.0 through I0.7.

F. Make sure BIN is selected in the Display format fi eld.

This will cause the data to be displayed in binary format.

Page 33: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

33

G. Click OK to build the Variable Table.

Your screen should appear similar to that shown in fi gure 20.

H. Click the Monitor button to go online with the processor.

The status bar should indicate that the processor is running and that you are online with a pulsing green indicator, as shown in fi gure 20.

Figure 20. Variable Table for Monitoring I0.0 through I0.8

The status value fi eld displays the value contained at the addresses as 2#0. The 2# portion indicates that the value being displayed is binary, and the 0 is the actual value at that location.

I. Right-click in the address fi eld for the ninth entry, directly under address I0.7, and select Insert Range of Variables once more.

The Insert Range of Variables dialog should open.

J. Type Q4.0 for the As of Address on the Insert Range of Variables dialog.

You are going to monitor an output byte in addition to the input byte.

K. Click the up arrow until 8 is selected in the Number fi eld.

L. Click OK to accept the new variables and close the dialog.

MONITOR BUTTON

ONLINEINDICATION

Page 34: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

34

M. If no data appears in the Status Value fi eld, click the Monitor button to go online with the processor.

The Variable Table should now contain listings for I0.0 through I0.7, and Q4.0 through Q4.7, as shown in fi gure 21.

A listing may not appear for input I0.7, as shown in fi gure 21. This is an error in the software.

Figure 21. Variable Table Monitoring Inputs and Outputs

N. Turn switch 1 on the 87-IOS Station to the ON position.

You should notice that input bit I0.0 turns on (1) and off (0) with the switch. You should also notice that output bit Q4.0 turns on (1) and off (0) with the switch.

O. Turn switch 2 on the 87-IOS Station to the ON position.

You should notice that input bit I0.1 turns on (1) and off (0) with the switch. You should also notice that output bit Q4.1 turns on (1) and off (0) with the switch.

P. Turn the remaining switches of the 87-IOS Station on and off while viewing the input and output process image table for input word I0 and output word Q4.

You should notice that the bit related to each input and output terminal address changes to a value of 1 each time the corresponding switch is closed.

Q. Return the switches of the 87-IOS Station to the OFF position.

DISPLAY FORMATBUTTON

Page 35: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

35

9. Perform the following substeps to change the radix, or base, of the data.

A. Right-click the Display Format button, shown in fi gure 22, to display a menu of available display format options.

B. Select Decimal from the menu.

The data will be displayed in decimal format.

C. Turn the switches of the 87-IOS Station on and off while viewing the data in the variable table.

The decimal view is similar to the binary view when viewing single bits.

D. Change the radix back to Binary. 10. Perform the following substeps to view the data in the Variable Table as

words instead of as individual bits.

A. Select Select All from the Edit menu.

B. Select Delete from the Edit menu.

All of the variables that you were monitoring should be deleted.

C. Enter IB0 in the Address fi eld.

D. Select Binary in the Display Format fi eld.

E. Enter QB4 in the second address fi eld.

F. Select Binary in the Display Format fi eld.

Your screen should appear similar to that shown in fi gure 22.

G. If no data appears in the Status Value fi eld, click the Monitor button to go online with the processor.

Figure 22. Monitoring Words in the Table

CLOSEBUTTON

EDITMENU

DISPLAYFORMATBUTTON

Page 36: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

36

IB0 is input byte 0. The eight displayed bits are I0.0 through I0.7.

QB4 is output byte 4. The eight displayed bits are Q4.0 through Q4.7. You are monitoring the same bits as before, just in a different format.

You can also monitor 16 or 32 bits at one time. IW0 is input word 0, and would allow you to monitor 16 bits, or I0.0 through I0.7 and I1.0 through I1.7. ID0 is input double word 0 and would allow you to monitor 32 bits, or I0.0 through I0.7, I1.0 through I1.7, I2.0 through I2.7 and I3.0 through I3.7.

The output word works the same way. You can monitor 8 bits with QB4, 16 bits with QW4, or 32 bits with QD4.

H. Turn switch 1 on the 87-IOS Station to the on position.

You should notice that input bit I0.0, the bit on the far right of word IB0, turns on (1) and off (0) with the switch. You should also notice that output bit Q4.0, the bit on the far right of output word QB4, turns on (1) and off (0) with the switch.

I. Turn switch 2 on the 87-IOS Station to the on position.

You should notice that input bit I0.1 turns on (1) and off (0) with the switch. You should also notice that output bit Q4.1 turns on (1) and off (0) with the switch.

J. Turn the remaining switches of the 87-IOS Station on and off while viewing the input and output process image table for input word I0 and output word Q4.

You should notice that the bit related to each input and output terminal address changes to a value of 1 each time the corresponding switch is closed.

11. Return the switches of the 87-IOS Station to the off (left) position. 12. Perform the following substeps to close the S7 software.

A. Click the Monitor button to go offl ine with the processor.

B. Close the Variable Table window by clicking the [X] in the top right-hand corner as shown in fi gure 22.

A dialog will appear asking if you wish to save the variable table.

C. Click No to close the dialog and variable table without saving.

D. Display the LAD/STL/FBD Editor by selecting it from the PC’s task bar. If it is not displayed on the monitor, move the cursor to the bottom of the screen to display the task bar.

E. Close the LAD/STL/FBD Editor by clicking the [X] in the top right-hand corner.

F. Close the SIMATIC Manager by clicking the [X] in the top right-hand corner.

13. Perform the following substeps to power down the trainer.

A. Turn off the PC and monitor.

B. Remove power from the trainer.

Page 37: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

37

SEGMENT 2 SELF REVIEW

1. An S7-300 series controller contains four separate areas of physical memory. The memory areas of the S7-300 CPUs are: Load memory, Work memory, _________ memory, and Micro Memory Card (MMC).

2. The Load memory may consist of an EPROM as well as ______ memory, depending on the model of the CPU.

3. The Load memory can be expanded using micro ________ _______.

4. Each fi le in the System memory address area consists of a number of bytes of data. Each byte consists of eight bits that can each be set to a binary ______ (on) or ______ (off) to store data.

5. After the input portion of the scan, the PLC begins the program portion of the scan, ______.

6. This _______ ________ actually occurs many times each second so that it appears that the ladder logic program is responding directly to the inputs and outputs.

7. An input instruction is energized when its input terminal is on. An output terminal is turned on whenever its output instruction is energized. Neither of these operations occurs directly, but instead uses the input and output ______ ______ tables.

Page 38: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

38

SEGMENT 3PLC PROGRAMMING SOFTWARE

OBJECTIVE 6 DESCRIBE THE STRUCTURE OF AN S7-300 PROJECT

The SIMATIC Manager is the initial window used for confi guring and program-ming S7 projects. The SIMATIC Manager is used to:

• Create projects• Confi gure hardware• Confi gure network communications• Create programs in ladder logic (LAD), Statement List (STL), or Functional Block Diagram (FBD)• Test programs• Run programs

Figure 23. SIMATIC Manager

Page 39: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

39

An S7 project is a collection of all of the data and programs needed to control a machine or process. The types of data that are part of a project include:

• Hardware confi guration data and parameters for the CPU and any addition modules used by the project. • Confi guration data for network communications• PLC Programs

An S7 project stores programs and data in object form. The objects are arranged in a tree structure. When you open a project using the SIMATIC Manager, a Project Window opens as shown in fi gure 24. The Project Window is split into two halves. The left half shows a tree structure of the project. The right half shows the objects contained in the selected object in the left half of the window.

Figure 24. Project Window

PROJECT OBJECT

STATION OBJECTPROGRAMMABLEMODULE OBJECT

S7 PROGRAM OBJECT

SOURCE FILE FOLDEROBJECT

BLOCK FOLDEROBJECT

Page 40: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

40

The objects contained in an S7 project are:

•Project Object - The Project object, in this case IOLIST, contains all of the data and programs that are a part of the project.

•Station Object - The Station object, SIMATIC 300(1), represents the hard-ware confi guration of the project. The hardware confi guration represents all of the hardware that is a part of the project.

A partial list of the hardware that may be used in a project includes PLCs, input/output modules, interface modules, Profi bus or ethernet modules, and distributed I/O modules (i.e. ET200).

•Programmable Module Object - The Programmable Module object contains the confi guration data for a PLC that is part of the project. If the project uses more than one PLC, each will be represented by a Programmable Module object.

•S7 Program Object - The S7 Program object is a folder that contains the blocks, source programs, and symbol table for a particular PLC in a project.

•Source File Folder Object - The Source File Folder object is used for saving text or graphic source fi les.

•Block Folder Object - The Block Folder object contains the project’s logic blocks: Organizational Blocks (OB), Function Blocks (FB), Functions (FC), System Function Blocks (SFB), System Functions (SFC), Data Blocks (DB), and Variable Tables.

OBJECTIVE 7 DESCRIBE THREE ADVANTAGES OF PROGRAMMING A PLC WITH A PC

As you already know, many PLCs can be programmed with either a personal computer or a hand-held terminal. The personal computer has several advantages over the hand-held terminal:

•Easier Viewing - The software can usually display more of the program on the screen at one time.

•Program Storage - Programs can easily be saved to fl oppy or hard disk.

•Easier Editing/Entry - The computer keyboard has more keys than a terminal which makes entry and editing of programs easier.

Page 41: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

41

SKILL 3 CREATE AND CONFIGURE A PLC PROJECT USINGTHE SIMATIC MANAGER

Procedure Overview

In order to program a PLC, you must accomplish several tasks. You must create a new project and specify the type of processor you are using, specify the type and number of I/O modules, enter a ladder logic program, save the project to disk, and download the project to the processor. In this procedure you will perform the fi rst step, which is to use the PLC programming software to create a new PLC project and confi gure the processor type and I/O modules used by your trainer.

1. Perform the following substeps to start the PLC programming software.

A. Turn on the PC and monitor and allow Windows to start.

B. Double-click the SIMATIC Manager icon.

The software should open and the SIMATIC Manager main screen should be displayed.

C. If the Step 7 wizard “New Project” Window opens in the SIMATIC Manager, close the “New Project” Window by clicking the [X] in the top right-hand corner of the window.

Page 42: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

42

2. Perform the following substeps to create a new PLC project.

A. Click the New Project/Library button on the SIMATIC Manager’s toolbar.

It is the far left button on the toolbar shown in fi gure 26.

The New Project dialog, shown in fi gure 25, should appear after you click the New Project/Library button.

Figure 25. New Project Dialog

Page 43: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

43

B. Type L2S3xxx into the name fi eld where xxx represents your initials.

C. Click OK to accept the new name and create the project.

The SIMATIC Manager creates the project, and opens the Project Window shown in fi gure 26.

Figure 26. L2S4 Project Window

NEW PROJECT/LIBRARY BUTTON

Page 44: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

44

3. Perform the following substeps to insert a SIMATIC 300 Station object into the project.

The SIMATIC 300 Station object represents a programmable controller that is a part of the project.

Inserting a SIMATIC 300 Station object will allow you to confi gure the hardware for the project.

A. Click Insert on the menu bar to open the Insert menu.

B. Place the cursor over the Station menu item.

The Station submenu should open as shown in fi gure 27.

Figure 27. Station Submenu

C. Click on 2 SIMATIC 300 Station in the submenu.

A SIMATIC 300 Station should appear in the right-hand side of the Project Window.

Page 45: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

45

D. Click the plus sign [+] located to the left of the L2S3 Project object to display its contents.

The SIMATIC 300 Station should appear under the L2S3 Project object, as shown in fi gure 28.

It appears on both sides of the Project Window because the right-hand side displays the contents of the selected item on the left-hand side, which is the Project object L2S3.

Figure 28. SIMATIC 300 Station Object

E. Select the SIMATIC 300(1) Station in the left-hand side of the Project Window by clicking it so that it is highlighted.

The right-hand side of the Project Window should now display a Hard-ware object, as shown in fi gure 29.

The Hardware object will be used to confi gure the processor, power supply, and I/O modules for the project.

Figure 29. Hardware Object

HARDWARE OBJECT

SIMATIC300 STATION

OBJECT

Page 46: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

46

4. Perform the following substeps to confi gure the processor for the project.

A. Double-click the Hardware object in the right-hand side of the Project Window.

The Hardware Confi guration application shown in fi gure 30 should open.

Figure 30. Hardware Confi guration Window

The Hardware Confi guration application is used to confi gure the hardware for each SIMATIC Station object, or PLC, that is a part of the project.

B. Click the Maximize button on the top right-hand corner of the window to expand the Hardware Confi guration application window so that it fi lls the entire screen.

You should notice that the Hardware Confi guration application is a totally separate application that is opened by the SIMATIC Manager when you confi gure hardware for a project.

CATALOGBUTTON

MAXIMIZEBUTTON

Page 47: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

47

C. Click the Catalog button, shown in fi gure 30, or select Catalog from the View menu, to open the Hardware Catalog Window shown in fi gure 31 if it is not already open.

The Catalog Window is used to confi gure the hardware for the project.

Hardware is added to a project by dragging and dropping items from the Hardware Catalog onto either of the Station Windows.

Both Station Windows contain similar information, but the Detailed Station Window will show additional information such as part numbers and I/O addresses for modules added from the hardware catalog.

Figure 31. Hardware Catalog Window

D. Click the plus sign [+] located to the left of the SIMATIC 300 folder in the Hardware Catalog window to open the folder.

CATALOGBUTTON

STATIONWINDOW

SIMATIC300 FOLDER

HARDWARECATALOGWINDOW

DETAILEDSTATIONWINDOW

Page 48: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

48

E. Click the plus sign [+] located to the left of the (RACK- 300) folder to open the folder.

The folder should contain only a rail. You will have to insert the rail before confi guring the rest of the hardware.

Your screen should appear similar to that shown in fi gure 32.

Figure 32. RACK 300 Contents

RAILOBJECT

Page 49: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

49

F. Click and hold on the RAIL object.

G. Drag the RAIL object and drop it in either the top or bottom Station Window of the Hardware Confi guration application.

Your screen should appear similar to that shown in fi gure 33.

Both views of the Station Window show an S7 rail that hardware objects are placed on. The numbers on the left-hand side of each window repre-sent the slot that the hardware occupies.

For easier navigation in the catalog, close the folders after inserting the hardware from the folder.

You can close all of the folders by clicking the Close Folder button shown in fi gure 33.

Figure 33. Inserting a Rail

CPU-300FOLDER

CLOSEFOLDER

Page 50: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

50

H. Click the plus sign [+] to the left of the CPU-300 folder (shown in fi gure 33) in the Hardware Catalog to display a list of folders of available S7-300 processors, shown in fi gure 34.

Figure 34. S7-300 CPUs

Look at your trainer’s CPU. The type of processor is displayed at the top corner of the processor. The part number is displayed on the bottom left hand corner of the processor, as shown in fi gure 35.

Figure 35. Processor Type and Part Number

L+

M

CPU314C-2DPSF

BF

DC5V

FRCE

RUN

STOPPUSH

RUNSTOPMRES

SIEMENS

PROCESSORTYPE

PORTACCESSDOOR

314-6CF02-0AB0

PROCESSORPART NUMBER

Page 51: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

51

I. Click the plus sign [+] to the left of the folder that corresponds to your processor type to open the folder.

A group of objects representing processor models should be displayed.

The objects will be either processor objects listed with a part number, or expandable folders listed with a part number. If your processor part number is listed next to an expandable folder, click the plus to the left of the folder to open it. The folder should contain a processor object listed with a fi rmware version number, i.e. V3.0. You should use either the object listed with the part number, or the object in the folder that is listed with the correct part number or fi rmware version number.

If you are unsure of the fi rmware version of the processor, it should be listed behind the processor’s port access door.

J. Click and hold on the processor object with the part number that corre-sponds to the processor used by your trainer.

K. Drag the object to Slot 2 of the Station Window.

As you drag the object, the Slot 2 fi eld should become highlighted in light green, indicating that Slot 2 is the proper slot for a processor.

If a processor is selected that has an integrated Profi bus-DP interface, the dialog shown in fi gure 36 should appear after the processor is dropped into slot 2.

The address listed on the dialog is the Profi bus-DP address assigned to the processor’s DP interface.

The address 0 is reserved for a PG/PC.

Figure 36. Profi bus Properties Dialog

Page 52: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

52

L. Click OK to accept the settings and close the dialog.

The default MPI address appears after the processor has been added, as shown in fi gure 37.

Your screen should appear similar to that shown in fi gure 37.

Figure 37. Processor Inserted on the Rail

M. Click the Save and Compile button on the toolbar to compile and save the hardware confi guration as a Station object.

The difference between the Save and Compile and Save buttons is that the Compile and Save button also adds any required System Data Blocks (SDBs) to the Blocks folder for the module. The SDBs are located in the System Data Folder in the Project Window.

N. Click the Minimize button shown in fi gure 37 to minimize the Hardware Confi guration application.

It now appears only as a button on the taskbar, as shown in fi gure 37.

If the taskbar buttons are not visible on your monitor, move the cursor to the bottom of the display to make the taskbar appear.

Selecting applications from the taskbar makes it easy to switch between applications when several are open (i.e. SIMATIC Manager, LAD/STL/FBD Program Editor, and the Hardware Confi guration application).

SAVE ANDCOMPILE

MINIMIZEBUTTON

MPIADDRESSCOLUMN

Page 53: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

53

O. Expand all of the objects in the left hand side of the Project Window by clicking the plus signs [+] next to the objects.

P. Click the Blocks folder to select it and display its contents in the right-hand side of the Project Window.

When the project tree is fully expanded, your screen should appear similar to that shown in fi gure 38.

Figure 38. Expanded Project Tree with Programmable Module Object and S7 Pro-gram Object

You should be able to see that the CPU 3XX object has been added under the SIMATIC 300(1) Station object, and that a S7 Program(1) folder has been added under the CPU 3XX Programmable Module object. The objects contained in the Blocks folder are the SDBs added when the hard-ware confi guration was compiled, and the Organizational Block OB1 which holds the main ladder logic program.

You should also be aware that the hardware confi guration is not complete. You still need to confi gure the input and output modules for your trainer.

Q. Display the Hardware Confi guration application by selecting its button from the task bar at the bottom of the screen.

If the task bar is not visible on the monitor, move the cursor to the bottom of the screen to display it.

CPU314-2DP

S7PROGRAM (1)

Page 54: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

54

Because this PLC has integrated inputs and outputs, its I/O appears as part of the CPU’s confi guration in slot 2. Slot 2.2 contains the PLC’s 24 discrete inputs and 16 discrete outputs, while slot 2.3 contains its analog I/O. Slots 2.4 and 2.5 contain the PLC’s advanced count and position functions, which enable the PLC to read pulse and encoder counts from motor drives and control their positioning respectively. The X2 reference shows the PLC’s Profi bus port connection.

When confi guring a modular PLC (or adding additional modules to an inte-grated PLC), additional modules such as power supply and I/O modules are added to the PLC’s confi guration by selecting the module from the Hardware Catalog’s tree directory and dragging it to the slot representing the module’s physical location in the rack. Slot 3 is reserved for Siemens S7300 communication modules (CP-300 in the hardware catalog). Power Supplies and I/O modules are located in the PS-300 and SM-300 (signal module) folders respectively.

Figure 39. Hardware Confi guration and Catalog Folders

STARTINGINPUT

ADDRESS

STARTINGOUTPUT

ADDRESS

SLOT 2.224 DISCRETE INPUTS

16 DISCRETE OUTPUTS

SLOT 2.3ANALOG I/O

SLOT 2.4COUNT

SLOT 2.5POSITION

Page 55: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

55

Notice in fi gure 39 the fi elds for I address and Q address. These are the starting input and output byte addresses of your input and output modules.

The hardware confi guration manager defi nes and reserves these addresses when an integrated PLC, input and/or output modules are added to the PLC’s hardware confi guration. The hardware manager reserves 3 bytes (124, 125, and 126) of input memory and 2 bytes (124 and 125) of output memory for your integrated PLC’s discrete I/O corresponding to one byte for every eight input or output terminals. The hardware manager reserves one to four bytes of memory area for each additional input or output module that is added to the confi guration.

Your PLC’s discrete input and output terminals and their default addresses are both shown in fi gure 40.

Figure 40. Discrete I/O Terminals and Addresses

M

L+

M

CPU314-2DPSF

BF

DC5V

FRCE

RUN

STOPPUSH

RUNSTOPMRES

SIMATICS7-300

SIEMENS

INPUTSI124.0-I124.7

OUTPUTSQ124.0-Q124.7

OUTPUTSQ125.0-Q125.7

INPUTSI125.0-I125.7

01234567

DI+2

IN

01234567

DI+2

OUT

01234567

DI+0

IN

01234567

DI+1 DI+1

01234567

INPUTSI126.0-I126.7

Page 56: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

56

5. Perform the following substeps to modify the default addresses assigned to the input and output terminals.

The addresses assigned to the input and output terminals/modules are the default addresses. Some processors, such as the 314C-2DP, enable the user to modify the terminal/module addresses. In the following substeps, you will modify the default input bytes begin at byte 0 and the output byte at byte 4.

A. Double-click the DI24/DO16 fi eld in the lower station window, shown in fi gure 41.

Figure 41. Selecting the DI24/DO16 Field

SLOT 2.2 DI24/D016

Page 57: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

57

The dialog shown in fi gure 42 should open.

Figure 42. Properties Dialog

B. Click the Addresses tab at the top of the dialog to display the dialog shown in fi gure 43.

Notice that the Inputs Start fi eld is currently grayed or not selectable.

Figure 43. Properties Dialog - Addresses Tab Selected

ADDRESSESTAB

STARTFIELD

SYSTEMSELECTIONCHECKBOX

Page 58: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

58

C. Click the System Default checkbox to de-select it.

The dialog should display System Selection if using STEP 7 Version 5.2 or System Default if using STEP 7 Version 5.3 and higher.

The Inputs Start fi eld should now be selectable, as shown in fi gure 44.

Figure 44. Properties Dialog without System Selection

START FIELDSELECTABLE

Page 59: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

59

D. Type a 0 into the Inputs Start fi eld.

E. Click the Outputs System Default checkbox to deselect it.

The Outputs Start fi eld should now be selectable.

F. Type 4 into the Outputs Start fi eld.

G. Click OK on the dialog to accept the changes and close the dialog.

Notice that the address in the I Address fi eld for the inputs has been changed to 0...2, and the Q address fi eld has been changed to 4..5.

This means that the inputs of this PLC can now be addressed from I0.0 through I2.7 and the outputs can now be addressed from Q4.0 through Q5.7. This is consistent with most of the Siemens S7300 PLCs.

Figure 45. Hardware Confi guration with Modifi ed Addresses.

H. Click the Save and Compile button, shown in fi gure 48, on the toolbar to compile and save the hardware confi guration.

Congratulations, you have successfully confi gured the I/O for an S7 project.

6. Close the Hardware Confi guration application by clicking the large [X] in the top right-hand corner of the application’s window, as shown in fi gure 45.

7. Continue immediately to the next skill.

MODIFIEDADDRESSES

SAVE ANDCOMPILEBUTTON CLOSE BUTTON

Page 60: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

60

SKILL 4 ENTER AND SAVE A BASIC PLC PROGRAM USINGTHE SIMATIC MANAGER

Procedure Overview

Once your PLC project has been created and your hardware has been confi gured, you are ready to enter the ladder logic program. In this procedure, you will learn how to enter a ladder logic program using the Step 7 software. The program contains a number of the logic combinations that you used in LAP 1. After you have entered the ladder logic program, you will verify the program to determine if you had made any mistakes entering the program.

1. Continuing from the last Skill, open the SIMATIC Manager by selecting it from your PC’s taskbar.

The project tree in the left-hand side of the Project Window should be fully expanded.

Your screen should appear similar to that shown in fi gure 46.

Figure 46. SIMATIC Manager

SYSTEM DATA ICON ORGANIZATION BLOCK (OB1) ICON

PROJECT OBJECT

STATION OBJECT

PROGRAMMABLEMODULE OBJECT

PROGRAM OBJECT

SOURCES FOLDER OBJECT

BLOCKS FOLDER OBJECT

Page 61: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

61

If the objects on the right-hand side of the screen of fi gure 49 are different than those that appear on your screen, make sure to expand the project tree fully and select the Blocks folder by double-clicking it.

The objects that are on your screen are:

•L2S3 Project object - The Project object represents all of the programs and data that are a part of the project.

•SIMATIC 300(1) Station object - The Station object represents the confi gu-ration of all of the hardware used by the project.

•CPU 3XX Programmable Module object - The Programmable Module object represents the processor used for the project. If more than one processor is needed for the project, they will all be represented by an object in the project tree.

•S7 Program(1) Program object - The Program object represents all of the software used by the project.

•Sources File Folder object - The Sources folder contains programs in text format that are a part of the project for the processor represented by the Programmable Module object.

•Blocks folder object - The Blocks folder contains all of the data and program blocks that are a part of the project for the processor represented by the Programmable Module object.

•System Data icon - The System Data icon represents the System Data Blocks (SDBs) that were added to the project when the hardware confi guration was compiled and saved. The SDBs keep track off the confi gured I/O addresses for the confi gured hardware.

•OB1 icon - OB1 is the Organization Block that you program. It is the main user developed block of software for an S7 application and is where you will enter your ladder logic programs. It is the block that is scanned by the processor during the scan cycle. Any other software blocks or functions (subroutines) used in the project are called from OB1.

Page 62: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

62

2. Perform the following substeps to open and familiarize yourself with the LAD/STL/FBD Editor.

A. Double-click the OB1 icon located in the right-hand side of the Project Window.

The Properties Organizational Block dialog shown in fi gure 47 should open.

You use this dialog to specify the language used by the program. There are three languages available:• LAD - Ladder Logic is based on a representation of circuit diagrams. The elements of a circuit diagram, e.g. normally open contacts and normally closed contacts, are combined to form networks. A program consists of one of more networks.• STL - Statement List is a text-based programming language with a structure similar to machine code.• FBD - Functional Block Diagram is based on graphic logic symbols. Complex functions such as math functions can be displayed directly in combination with the logic boxes.

Figure 47. Properties-Organizational Block Dialog

B. Select LAD in the Created in Language list box.

You will program OB1 in ladder logic.

Page 63: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

63

C. Click OK on the dialog.

The LAD/STL/FBD Editor should open.

Your screen should appear similar to the one shown in fi gure 48.

Figure 48. LAD/STL/FBD Editor Window

The main components of the LAD/STL/FBD Program Editor are:•Variable Declaration Window - A default Variable Table is displayed in the Variable Declaration window after you generate and open a new code block.•Variable Overview - The Variable Overview window is the left-hand side window of the Variable Declaration window. It lists only the names of vari-ables passed to and from other blocks that are a part of the project.•Variable Detail View - The Variable Detail View lists the same variables as the Overview, but with more detailed information such as data type, address, and comments.

•Code Section - The Code Section window is where you enter your program.•Call Structure - Window The Call Structure window shows the block call hierarchy in the current program. This provides an overview of the blocks being used and how they are called in the program. •Overview Window - The Program Elements and Call Structure window are both displayed in the Overview window. The Overview window can be opened and closed using the Overview on/off button. The Program Elements Window shows the program elements that you can insert in your program. The contents depend on the selected programming language. The Call Struc-ture window displays the projects block structure.

CODE SECTIONOVERVIEWWINDOW

VARIABLEOVERVIEWWINDOW

VARIABLEDECLARATION

WINDOWOVERVIEW

ON/OFF BUTTONVARIABLE

DETAIL VIEWWINDOW

PROGRAMELEMENTSWINDOW

CALLSTRUCTUREWINDOW TAB

PROGRAMELEMENTS

TAB

Page 64: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

64

3. Perform the following substeps to enter the fi rst instruction of the ladder logic program, Normally Open Contact instruction I0.0, into Network 1 of your program.

Figure 49. LAD/STL/FBD Program Editor with Comments

A. Click the plus sign [+] to the left of the Bit Logic folder in the Program Elements window to display its contents.

The Program Elements window contains the instructions that you will place into your ladder logic program.

You should notice the Normally Open (N.O.) Contact instruction and the Normally Closed (N.C.) Contact instruction towards the top of the list.

You can also use toolbar buttons shown in fi gure 49 to place instructions into your program.

BIT LOGICFOLDER

TITLEAREA

CURRENTPATH

NEWNETWORKBUTTON

NORMALLYOPEN CONTACT

BUTTON

NORMALLYCLOSED CONTACT

BUTTON

OUTPUTCOIL

BUTTON

Page 65: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

65

Notice the following buttons on the toolbar:• New Network button - Inserts a new network or rung in the ladder logic program.• N.O. Contact button - Inserts a N.O. Contact instruction in the program.• N.C. Contact button - Inserts a N.C. Contact instruction in the program.• Coil button - Inserts a coil, or output, into the program.

B. Select the current path of Network 1 by clicking on it.

The horizontal path should appear highlighted to show that it is selected.

All ladder logic instructions are entered on networks using Siemens Step 7 software.

C. Click the Normally Open Contact button on the toolbar or double-click the Normally Open Contact in the Bit Logic folder to insert a normally open contact instruction onto the current path of Network 1.

Your screen should appear similar to that shown in fi gure 50.

Figure 50. N.O. Contact Instruction Inserted

CURRENTPATH

Page 66: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

66

D. Click the question marks, ??.?, above the newly entered N.O. Contact instruction to open the address text box.

The question marks should disappear and a text box should appear above the N.O. Contact instruction.

E. Type I0.0 into the text box.

As the letter I is entered, a drop-down list will be displayed as shown in fi gure 51.

The list will be empty unless a symbol table has been entered into the project.

If a symbol table has been entered, all of the symbols available that begin with the fi rst typed letter in the text box will be displayed in the list. The symbol can then be selected from the list.

Figure 51. Drop-Down List Displayed when Entering an Address

Page 67: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

67

F. Press Enter.

The address should be highlighted.

G. Press Enter again.

The address is saved, and the instruction should be highlighted, as shown in fi gure 52.

Figure 52. Newly Inserted Normally Open Contact Instruction

Page 68: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

68

4. Perform the following substeps to delete the Normally Open Contact Instruction I0.0 that was entered onto Network 1.

It may be necessary to delete contacts or coils while editing Networks.

A. Place the cursor over the Normally Open Contact instruction.

B. Right-click the mouse to display a shortcut menu as shown in fi gure 53.

The contact should highlight in green as you right-click the mouse.

Figure 53. Shortcut Menu

C. Select Delete from the shortcut menu to delete the contact.

The contact should be removed from the Network.

The network should appear empty but selected, or highlighted in green.

D. To restore the contact, click the Undo button shown in fi gure 53.

You can also select Undo from the Edit menu.

The Normally Open Contact instruction should appear on the network with the address that was entered in the last step.

UNDO BUTTON

Page 69: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

69

5. Perform the following substeps to enter the Normally Open Contact instruction I0.1 into the fi rst network of the program.

A. Continuing from the last step, the Normally Open Contact instruction I0.0 should be selected, or highlighted, on Network 1.

If it is not highlighted, click it now so that it is highlighted.

B. Click the Normally Open Contact button on your toolbar to insert a N.O. Contact instruction.

A new Normally Open Contact instruction should be inserted as the second instruction on Network 1.

C. Click the question marks, ??.?, above the new N.O. Contact instruction to open the address text box.

The question marks should disappear and a text box should appear above the N.O. Contact instruction.

D. Type I0.1 into the text box.

E. Press Enter twice.

The address is saved and the instruction should be highlighted, as shown in fi gure 54.

Figure 54. Second Instruction Added to Network 1

OUTPUTCOIL

BUTTON

Page 70: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

70

6. Perform the following substeps to add an Output Coil instruction to Network 1.

A. Click the Output Coil button on the toolbar to add an Output Coil to Network 1.

B. Click the question marks, ??.?, above the Output Coil to open the address text box.

The question marks should disappear and a text box should appear above the Output Coil.

C. Type Q4.1 into the text box.

D. Press Enter twice.

After the second Enter, your entry has been entered and the Output Coil instruction should be selected, as shown in fi gure 55.

Figure 55. Network 1 with Output Coil Instruction Inserted

Page 71: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

71

7. Perform the following substeps to add a new network to the program.

A. Continuing from the last step, Network 1 should appear as shown in fi gure 56, with two Normally Open Contact instructions and an Output Coil instruction.

Make sure that the Output Coil is highlighted, or selected.

B. Click the New Network button on the toolbar to insert Network 2 into your program.

A new network, Network 2, should appear on your screen, as shown in fi gure 56.

Figure 56. Network 2 Added to Program

C. Click the Normally Open Contact button on your toolbar to insert a N.O. Contact instruction onto Network 2

D. Click the question marks, ??.?, above the newly entered N.O. Contact instruction to open the address text box

E. Type I0.2 into the text box.

F. Press Enter twice.

G. Click the Normally Open Contact button on your toolbar to insert a N.O. Contact instruction.

H. Click the question marks, ??.?, above the newly entered N.O. Contact instruction to open address text box.

I. Type I0.3 into the text box.

NEWNETWORKBUTTON

Page 72: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

72

J. Press Enter twice.

Your screen should appear similar to the screen in fi gure 57.

Figure 57. Instructions Inserted on Network 2

Page 73: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

73

8. Perform the following substeps to insert a branch and complete Network 2.

A. Click on the current path before the fi rst Normally Open Contact instruc-tion on Network 2.

The space to the left of the fi rst instruction should appear highlighted, as shown in fi gure 58.

Figure 58. Area Before First Instruction Selected

OPEN BRANCHBUTTON

Page 74: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

74

B. Click the Open Branch button shown on fi gure 58 on the toolbar.

A branch should appear at the very left of the current path of Network 2, as shown in fi gure 59.

The branch only works one way. When you add a branch, the branch direction is indicated by the arrows shown in fi gure 59.

Figure 59. Branch Inserted

C. Click the Normally Open Contact button on the toolbar to insert a Normally Open Contact instruction on the branch you just created.

D. Click the question marks, ??.?, over the instruction to open the address text box.

E. Enter I0.4 as the instruction address.

BRANCHARROWS

Page 75: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

75

F. Press Enter twice to enter the address and select the N.O. Contact instruction.

Your screen should appear similar to fi gure 60.

Figure 60. Branch with N.O. Contact Instruction

Page 76: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

76

G. Click the arrows at the end of the branch to select the branch.

H. Click and hold over the arrows.

As you move the cursor, you should notice that a green line is attached to the cursor as shown in fi gure 61. The symbol shown in the fi gure indicates that you are attempting to close the branch in a valid direction.

The symbol won’t appear until the green line is very close to the top current path of Network 2.

Figure 61. Closing the Branch

I. Pull the line up until it touches the main current path of Network 2, between the two Normally Open Contact instructions.

Page 77: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

77

J. Release the mouse button to close the branch.

Your screen should appear similar to that shown in fi gure 62.

Figure 62. Closed Branch

K. Click the current path to the right of the I0.3 Normally Open Contact instruction to select the current path.

L. Click the Output Coil button on the toolbar to insert an Output Coil on Network 2.

M. Click the question marks, ??.?, to open the address text box.

N. Enter Q4.0 in the text box.

O. Press Enter twice to enter the address.

Page 78: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

78

Your screen should appear as shown in fi gure 63.

Figure 63. Completed Network 2

Page 79: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

79

9. Insert the third network of the program as shown in fi gure 64. You may need to use the vertical scroll bar to do this. This time see if you can remember how to select the correct buttons and

press the correct keys to do this. Refer to the previous steps of this skill if necessary.

Figure 64. Finished Ladder Logic Program

Before you can download the OB1 block to the processor, you must save your project to check for possible errors.

VERTICALSCROLLBAR

SAVEBUTTON

Page 80: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

80

10. Click the Save button shown in fi gure 64 to save the OB1 block that you just created.

The Step 7 software checks for errors in the program contained in OB1 before saving it to disk. The software will display a dialog if any of the following types of errors occur:

• An instruction has no address• A Network has no instructions or is incomplete• An unexpected instruction is encountered

The software does not check for I/O addresses that are not used by the hardware. This is because OB1 and the CPU 3XX Programmable Module object are separate objects. Saving OB1 only checks for errors with the ladder logic contained in the block.

If your program contains no errors, the block will be saved and your screen will appear as shown in fi gure 64.

If your program contains errors, the fi le is not saved and a dialog will be displayed that states what error was encountered, as shown in fi gure 65.

Figure 65. Error Dialog Encountered when Saving OB1

Page 81: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

81

When you click OK to clear the dialog, the software indicates where the error was encountered, as shown in fi gure 66.

Figure 66. Program Error

If more than one error is encountered, only one dialog will be displayed. The software will guide you to the fi rst error. If you cannot fi nd any additional errors, the software will display a dialog again when you attempt to Save, until all of the errors have been corrected.

11. Perform the following substeps to save your entire project to disk. You have programmed the main Organizational Block, OB1, but it is just

one part of the project. The rest of the project is organized by the SIMATIC Manager, and includes the hardware confi guration that you created in a previous skill. The entire project will be saved to disk.

A. Close the LAD/STL/FBD Editor by clicking the Close button in the top right-hand corner of the window.

B. Display the SIMATIC Manager by selecting it from your computer’s taskbar if it is not already displayed on the screen.

The SIMATIC Manager should already be open. You had to open it to open the LAD/STL/FBD Editor.

BOX PLACED AROUND MISSING ADDRESS

CLOSE BUTTON

Page 82: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

82

C. Select the L2S3 Project object so that it is highlighted.

In the next substeps, only the portion of the project that is selected will be saved. Make sure to select the whole project.

D. Select Save As from the File menu.

The Save Project As dialog shown in fi gure 67 should open on your screen.

E. Type L2S4xxx, where xxx represents your initials, into the Name: fi eld of the dialog.

Figure 67. Save Project As Dialog

F. Click OK on the Save Project as dialog to save the project. 12. Perform the following substeps to prepare the PLC trainer for use.

A. Verify that the 870-PS7 Portable Mounting Console and 87-IOS are connected.

B. Make sure that the PLC power cable is connected to the PLC and plugged into an outlet.

C. Verify that the PLC power cable’s toggle switch is in the off position.

D. Make sure that the Interface cable is connected from the PC to the PLC.

E. Make sure that all of the 87-IOS Station’s switches are in the off (down) position.

Page 83: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

83

13. Perform the following substeps to power up the PLC trainer.

WARNING

Most PLC applications require an organized startup and shutdown procedure to avoid personal injury and/or damage to the machinery. Be certain to follow these procedures when in the fi eld.

A. Turn the PLC power cable’s toggle switch to the on position.

B. Place the PLC’s Mode Selector switch into the RUN position. 14. Perform the following substeps to reset the PLC. Before downloading a project to the PLC, you should perform a memory

reset on the processor to ensure that no retentive data is still on the CPU.

A. Place the Mode Selector switch in the STOP position.

The green RUN light should turn off and the amber STOP light should turn on.

B. Place the Mode Selector switch in the MRES position and hold it until the STOP light blinks slowly.

C. Release the Mode Selector switch, and immediately return it to the MRES position.

The STOP light should blink quickly.

When it blinks quickly, the memory has been reset.

If the STOP light doesn’t blink quickly, repeat steps A through C.

D. Place the Mode Selector switch into the RUN or RUN-P position. 15. Perform the following substeps to download project L2S4 to your trainer’s

processor.

A. Display the SIMATIC Manager by selecting it from the PC’s taskbar.

B. Click the SIMATIC 300(1) Station object to select it.

The Download button should become active when you select the Station object.

C. Click the Download button on the toolbar to begin downloading project L2S4 to the processor.

A dialog should appear asking if you want to delete the system data in the programmable controller completely.

D. Click Yes on the Download dialog to start the download.

A dialog should appear stating that the processor will be stopped for loading of system data.

E. Click OK.

A dialog will appear indicating “Block OB1 already exists. Do you want to overwrite it?”

Page 84: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

84

F. Click Yes.

A dialog should appear asking if you wish to perform a Warm Restart.

G. Click Yes. 16. Perform the following substeps to go online with the processor and monitor

the operation of your program.

A. Select the Blocks folder in the left-hand side project window by clicking it so that it is highlighted.

B. Double-click the OB1 icon in the right-hand side project window to open the block.

C. Click the Monitor button, or select Monitor from the Debug menu.

You are now online with the processor. It is in RUN mode because you performed a Warm Restart during the last step.

Your screen should appear similar to that shown in fi gure 68.

Figure 68. Online Monitoring of OB1

If any of the Networks appear without the green active lines or broken blue lines, make sure the click the text Network 1 over the fi rst Network to select it, as shown in fi gure 68.

The Step 7 software monitors all of the rungs below the selected rung.

D. Operate the switches on the 87-IOS Station to test the operation of your program.

MONITORBUTTON

SELECT TOMONITOR

ALL NETWORKS

Page 85: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

85

E. Click the Monitor button, or select Monitor from the Debug menu to go offl ine from the processor.

F. Select Operating Mode from the PLC menu.

The Operating Mode dialog shown in fi gure 69 should appear.

Figure 69. Operating Mode Dialog

G. Click the STOP button.

A dialog will appear asking if you are sure.

H. Click Yes to close the dialog and place the processor in STOP mode.

I. Click Close to close the Operating Mode dialog.

J. Continue immediately to the next skill.

Leave the LAD/STL/FBD Editor open.

Page 86: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

86

SKILL 5 EDIT A PLC PROGRAM USING THE SIMATIC MANAGER

Procedure Overview

Once a PLC project has been created, you may fi nd that the program needs to be changed. In this procedure, you will learn how to edit a project fi le using the STEP 7 software. You will use the software to modify, delete, and undelete networks and instructions in the ladder logic section of OB1.

1. Continuing from the last Skill, perform the following steps to delete Network 3 from the ladder logic section of OB1 from project L2S4.

The LAD/STL/FBD Editor for project L2S4 should already be open on your screen.

A. Highlight the text Network 3 at the top of the network as shown in fi gure 70.

You may need to use the Vertical Scrollbar to view Network 3.

Figure 70. Deleting Network 3

CUT BUTTON

VERTICALSCROLLBAR

Page 87: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

87

B. Click the Cut button shown in fi gure 71.

Network 3 should disappear from the screen. 2. Perform the following substeps to delete Network 2.

A. Select Network 2 so that it is highlighted.

B. Select Delete from the Edit menu to delete the network. 3. Perform the following substeps to delete Network 1.

A. Select Network 1 so that it is highlighted.

B. Right-click on the network, and select Delete from the shortcut menu.

There should be no Networks remaining on the screen. 4. Click the Undo button, shown in fi gure 71, or select Undo from the Edit

menu to undelete Network 1. If you make a mistake when entering or editing a ladder logic program, you

can use the Undo button to undo your actions starting with the most recent action.

Your screen should now appear similar to fi gure 71.

Figure 71. LAD/STL/FBD Project Window with Network 1

5. Perform the following substeps to modify Network 1.

A. Highlight the text Network 1 at the top of the network.

B. Click the Cut button to delete the entire network.

There will be no networks left on your screen.

C. Click the New Network button to insert an empty Network 1 into your program.

CUT BUTTON

UNDO BUTTON

Page 88: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

88

D. Click the Normally Open Contact button to insert a Normally Open Contact instruction into your program.

E. Click the Normally Closed Contact button to insert a Normally Closed Contact instruction into your program.

F. Click the Output Coil button to insert an Output Coil at the end of Network 1.

Your program should now appear as shown in fi gure 72.

Figure 72. Network 1 with No Addresses

G. Click the question marks, ??.?, above the fi rst instruction of Network 1 to open the address text box.

H. Type I0.0 to enter the address for the instruction in the text box.

I. Press Enter twice.

The address is accepted, and the text box moves to the next instruction on the network.

J. Type I0.7 for the address of the second instruction.

K. Press Enter twice to accept the address and place the address text box over the Output Coil.

L. Type Q4.0 for the address for the Output Coil.

Page 89: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

89

M. Press Enter twice.

The addresses should all be entered above the instruction, and the Output Coil should be highlighted, similar to that shown in fi gure 73.

Figure 73. Complete Network 1

6. Perform the following substeps to copy Network 1 and add fi ve copies of the Network to the ladder logic program.

A. Right-click on the text Network 1 above the network to display a shortcut menu.

B. Select Copy from the shortcut menu.

C. Right-click in the blank space below Network 1 to display the shortcut menu again.

D. Select Paste from the shortcut menu.

A copy of Network 1 should be pasted into your program. The pasted Network is named Network 2.

Page 90: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

90

E. Repeat substeps C and D four more times until you have pasted fi ve copies of Network 1 into the program.

The program should contain six identical networks.

Your screen should appear similar to that shown in fi gure 74.

You will need to use the vertical scrollbar to view all of the Networks.

Figure 74. Six Identical Networks

7. Perform the following substeps to modify Network 2.

A. Click the address I0.0 above the fi rst instruction of the network to select it.

B. Enter the text I0.1.

C. Press Enter twice to accept the entry.

D. Click the address Q4.0 above the Output Coil to select it.

E. Type Q4.1 for the address of the instruction.

VERTICALSCROLLBAR

Page 91: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

91

F. Press Enter twice to accept the new address.

Rung 2 should now appear as shown in fi gure 75.

Figure 75. Modifi ed Network 2

SAVE BUTTONCLOSE BUTTON

Page 92: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

92

8. Now use your newly acquired editing skills to edit the program so that it appears as shown in fi gure 76.

The program will use inputs I0.0 through I0.5 to run outputs Q4.0 through Q4.5. It also uses input I0.7 as a normally closed Stop button.

Figure 76. Completely Edited Ladder Logic Program

9. Perform the following substeps to save the new project.

A. Click the Save button on the LAD/STL/FBD Editor’s toolbar, shown in fi gure 75, to save OB1.

B. Close the LAD/STL/FBD Editor by clicking the Close button shown in fi gure 75.

C. Display the SIMATIC Manager by selecting it from the PC’s taskbar.

D. Select the SIMATIC 300(1) Station object by clicking it so that it is highlighted.

E. Select Save As from the SIMATIC Manager’s File menu.

The Save As dialog should open.

F. Type L2S5xxx for the project name in the Name fi eld, where xxx repre-sents your initials.

Q4.0I0.0 I0.7

Q4.1I0.1 I0.7

Q4.2I0.2 I0.7

Q4.3I0.3 I0.7

Q4.4I0.4 I0.7

Q4.5I0.5 I0.7

Network 1: Title:

Network 2: Title:

Network 3: Title:

Network 4: Title:

Network 5: Title:

Network 6: Title:

MAIN PROGRAM SWEEP (CYCLE)

Page 93: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

93

G. Click OK on the dialog to save the project and close the dialog.

Editing a confi gured project and saving it with a new name is one way to generate a project without having to confi gure the hardware for the project.

10. Perform the following substeps to reset the PLC. Before downloading a project to the PLC, perform a memory reset on the

processor to ensure that no retentive data is still loaded in the CPU.

A. Place the Mode Selector switch in the STOP position.

The green RUN light should turn off and the amber STOP light should turn on.

B. Place the Mode Selector switch in the MRES position and hold until the STOP light blinks slowly.

C. Release the Mode Selector switch, and immediately return it to the MRES position.

The STOP light should blink quickly.

When it blinks quickly, the memory has been reset.

If the STOP light doesn’t blink quickly, repeat steps A through C.

D. Place the Mode Selector switch into the RUN or RUN-P position. 11. Perform the following steps to download project L2S5 to the processor.

A. Select the SIMATIC 300 Station object by clicking it so that it is high-lighted in the left-hand window of the SIMATIC Manager.

B. Click the Download button.

C. Click Yes to continue.

D. Click OK

E. Click Yes.

F. Click Yes. 12. Perform the following substeps to go online with the processor.

A. Select the Blocks folder in the left-hand side project window by clicking it so that it is highlighted.

B. Double-click the OB1 icon in the right-hand side project window to open the block.

C. Click the Monitor button, or select Monitor from the Debug menu to go online with the processor.

Page 94: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

94

13. Perform the following substeps to test the program.

A. Turn switch 1 of the 87-IOS Station to the on position.

L1 should turn on.

B. Turn on switch 2 of the 87-IOS Station to the on position.

L2 should turn on.

C. Turn on each of the remaining switches (3-6) one at a time.

The respective indicator should turn on in each case.

D. Turn switch 8, which is functioning as a normally closed stop switch in the program, to the on position.

Turning switch 8 on causes Normally Closed Contact instruction I0.7 to turn false. This disables all of the outputs since this instruction is on each rung.

E. Turn all of the switches to the off position. 14. Click the Monitor button to go offl ine from the processor. 15. Perform the following substeps to place your processor in STOP mode.

A. Select Operating Mode from the PLC menu.

B. Click the Stop button on the Operating Mode dialog to place the PLC in Stop mode.

A dialog should appear asking if you are sure.

C. Click Yes on the dialog.

D. Click Close on the Operating Mode dialog to close it. 16. Continue immediately to the next skill to print out a copy of the project.

Page 95: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

95

SKILL 6 GENERATE AND PRINT OUT A LADDER LOGIC REPORTUSING THE SIMATIC MANAGER

Procedure Overview

In this procedure, you will print out a project report. The reports will contain a detailed listing of the hardware that you confi gured for your trainer, and a detailed listing of Organizational Block OB1, your ladder logic program. These reports are used in industry to maintain and/or modify PLC programs.

1. Continuing from the previous Skill, perform the following substeps to generate a report that contains the details of the hardware that you confi gured for your project.

A. Display the SIMATIC Manager by selecting it from the computer’s taskbar.

Once a project has been created, all of the important data can be printed using the print functions of the STEP 7 software.

The contents of objects can be printed both directly from the SIMATIC Manager and by opening the respective object and starting the print procedure. The following parts of a project can be printed directly via the SIMATIC Manager: • Object tree (structure of the project/library) • Object lists (contents of an object folder) • Object contents • Messages

By opening the respective object, the following parts of a project can be printed: • Blocks in Ladder Logic, Statement List, or Function Block Diagram• Symbol table• Hardware Confi guration table • Diagnostic buffer content• Variable table

B. Select Expand All from the View menu to expand the project tree.

The option is Expand All if using STEP 7 Version 5.2, or Show All Levels if using STEP 7 Version 5.3 and higher.

C. Select the Station object SIMATIC 300(1).

Page 96: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

96

D. Select Print from the File menu.

A submenu should appear, as shown in fi gure 77, with the options of printing the Object List or the Object Contents.

Figure 77. Print Submenu

If you choose Print Object List, a list of the components contained in the right-hand window will be printed.

If an object, such as OB1, appears in the right hand window, and Print Object Contents is selected, a detailed listing of the program contained in the object will be printed.

Depending on the object selected in the left-hand window, Print Object Contents may or may not be active.

PRINTSUBMENU

Page 97: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

97

E. Select Print>Object Contents from the File menu.

The dialog shown in fi gure 78 should appear.

Figure 78. Print Dialog

F. Select the settings on the dialog to match those shown in fi gure 78.

G. Click OK to print the selections.

The software will print a detailed listing of the hardware confi gured for your project.

Look over the printout to see what information is contained in a printout for a station object.

2. Perform the following substeps to print a ladder logic report.

A. Click the Blocks Folder object in the left-hand window to select it and display its contents in the right-hand window.

B. Click the OB1 object in the right-hand window to select it.

C. Select Print>Object Contents from the File menu.

A detailed listing of OB1 will be printed.

The print out begins with the default Variable Table listing at the top, followed by the actual ladder logic contents of OB1.

This is the same printout that you will obtain if you open the LAD/STL/FBD Editor by double-clicking OB1, and select Print from the File menu.

You have now printed a hardware listing and a ladder logic listing of your project.

Page 98: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

98

3. Close the SIMATIC Manager by clicking the [X] in the top right-hand corner of the window.

4. Close the LAD/STL/FBD Editor by clicking the [X] in the top right-hand corner of the window.

5. Perform the following substeps to power down the trainer.

A. Turn off the PC and monitor.

B. Remove power from the trainer.

Page 99: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

99

SEGMENT 3 SELF REVIEW

1. The types of data that are part of a project include: Hardware confi guration data and parameters for the CPU and any addition modules used by the project, Confi guration data for network communications, and ______ ______.

2. An S7 project stores programs and data in ________ _______.

3. The Project object contains all of the ________ and ________ that are a part of the project.

4. The Station object represents the ________ confi guration of the project.

5. The personal computer has several advantages over the hand-held terminal: easier viewing, ______ storage, and easier editing/entry.

6. \The computer keyboard has more keys than a terminal which makes entry and ______ of programs easier.

Page 100: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

100

SEGMENT 4PLC PROGRAM ANALYSIS

OBJECTIVE 8 DESCRIBE HOW AN INPUT DEVICE CAN REFERENCE MULTIPLE INPUT INSTRUCTIONS

One of the advantages of a PLC is that it permits many instructions to be controlled by one input and it doesn’t matter how many of these are Normally Open Contact or Normally Closed Contact instructions. This is accomplished by using the same input address for all of the instructions.

As an example, fi gure 79 shows a program with one input device, PB1, control-ling four input instructions. When PB1 is not pressed, input I0.0 if off and all input instructions with the address I0.0 are in their normal state, off. In this case, the Normally Open Contact instructions on Networks 1, 2, and 3 are false. The Normally Closed Contact instruction that uses I0.0 as the address on Network 4 is true.

Figure 79. Multiple Input Instructions Referenced to One Input Device

PB1

I0.0 Q4.0Q4.0I0.0

LAMP L1

Q4.1I0.0

Q4.2I0.0

Q4.3I0.0

Q4.1

Q4.2

Q4.3

LAMP L2

LAMP L3

LAMP L4

Network 1: Title:

Network 2: Title:

Network 3: Title:

Network 4: Title:

Page 101: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

101

When PB1 is pressed, as shown in fi gure 80, all three Normally Open Contact instructions that use address I0.0 are true. This makes Networks 1, 2, and 3 true. The Normally Closed Contact instruction on Network 4 is false, so Network 4 is false.

Figure 80. Three Input Instructions Energized at the Same Time

Network 1: Title:

Network 2: Title:

Network 3: Title:

Network 4: Title:

Page 102: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

102

OBJECTIVE 9 DESCRIBE HOW THE INPUT DEVICE LOGIC AFFECTS INPUT INSTRUCTION LOGIC

PLCs are different than hard-wired circuits in that the input device and the input instruction do not have to use the same logic. For example, in fi gure 81, PB1 has a set of normally open contacts that control a Normally Closed Contact instruc-tion. When PB1 is pressed, its contacts are closed. This in turn causes the Normally Closed Contact instruction with address I0.0 to turn false.

Figure 81. Normally Open Contacts Controlling a Normally Closed Contact In-struction

But what if the opposite logic is used, and PB1 has normally closed contacts that control a Normally Open Contact instruction, as shown in fi gure 82.

Figure 82. Normally Closed Contacts Controlling a Normally Open Contact In-struction

I0.0 Q4.0

Q4.0I0.0

N.O. CONTACTS N.C. CONTACTS

LAMP L1Network 1: Title:

I0.0 Q4.0

Q4.0I0.0

N.C. CONTACTS N.O. CONTACTS

LAMP L1Network 1: Title:

Page 103: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

103

Figure 82 shows that the input device’s normally closed contacts cause Normally Open Contact instruction I0.0 to be held true. This means the output is on when PB1 is not pressed. Pressing PB1, as shown in fi gure 83, causes Normally Open Contact instruction I0.0 to turn false and turn off the output.

Figure 83. PB1 Pressed, Output Off

This is the same effect we got using the logic shown in fi gure 81. This shows there are two methods of getting the same input logic: select the type of input device contacts or select the type of input instruction.

I0.0 Q4.0

Q4.0I0.0LAMP L1

Network 1: Title:

Page 104: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

104

OBJECTIVE 10 DESCRIBE HOW A PLC CONTROLS MULTIPLE OUTPUTS AT THE SAME TIME

There are two ways to have more than one output controlled with the same input logic. The fi rst method is to branch the outputs, as shown in fi gure 84. This is similar to the hard-wired approach.

Figure 84. Branch Outputs

The second method is to place each output on a separate network and use multiple input instructions with the same address, as shown in fi gure 85.

Figure 85. Simultaneous Control of Multiple output Instructions

Q4.0I0.0

Q4.1

Network 1: Title:

Q4.0I0.0

Q4.1I0.0

Q4.2I0.0

Network 1: Title:

Network 2: Title:

Network 3: Title:

Page 105: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

105

Activity 1. Control of Multiple Outputs

Procedure Overview

In this procedure, you will test the operation of two programs to demonstrate how multiple outputs can be turned on at the same time. This will also show how multiple input instructions can reference the same input device and have different logic.

1. Perform the following substeps to prepare the PLC trainer for use.

A. Verify that the Portable Mounting Console and 87-IOS are connected.

B. Make sure that the PLC power cable is connected to the PLC and plugged into an outlet.

C. Verify that the PLC power cable’s toggle switch is in the off position.

D. Make sure that the Interface cable is connected from the PC to the PLC.

E. Make sure that all of the 87-IOS Station’s switches are in the off (down) position.

2. Perform the following substeps to power up the PLC trainer.

WARNING

Most PLC applications require an organized startup and shutdown procedure to avoid personal injury and/or damage to the machinery. Be certain to follow these procedures when in the fi eld.

A. Turn the PLC power cable’s toggle switch to the on position.

B. Place the PLC’s Mode Selector switch into the RUN position. 3. Perform the following substeps to reset the PLC. Before downloading a project to the PLC, perform a memory reset on the

processor to ensure that no retentive data is still loaded in the CPU.

A. Place the Mode Selector switch in the STOP position.

B. Place the Mode Selector switch in the MRES position and hold until the STOP light blinks slowly.

C. Release the Mode Selector switch, an immediately return it to the MRES position.

The STOP light should blink quickly.

When it blinks quickly, the memory has been reset.

If the STOP light doesn’t blink quickly, repeat substeps A through C.

D. Place the Mode Selector switch into the RUN or RUN-P position.

Page 106: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

106

4. Double-click the SIMATIC Manager Icon to Start the PLC programming software.

If a Project Window opens in the SIMATIC Manager, close the Project Window by clicking the [X] in the top right corner of the window.

5. Perform the following substeps to create a new PLC project.

A. Click the New Project/Library button on the SIMATIC Manager’s toolbar.

The New Project/Library button is used to create a new project.

The New Project dialog should open.

B. Name the project L2A1Axxx where xxx represents your initials on the New Project dialog.

C. Click OK on the New Project dialog to create the project.

The SIMATIC Manager should appear on the screen with only the L2A1A project object present.

In the next substeps, the Station object will be uploaded from the processor.

The Upload will contain all of the hardware confi guration, blocks, and data that are currently in the processor.

Uploading the Station object allows a new project to be created without having to manually confi gure the hardware.

Page 107: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

107

D. Select Upload Station to PG... from the PLC menu as shown in fi gure 86.

The option is Upload Station if using STEP 7 Version 5.2, or Upload Station to PG... if using STEP 7 Version 5.3 and higher.

Figure 86. Selecting Upload from the PLC Menu

Page 108: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

108

The Select Node Address dialog shown in fi gure 87 should appear on the monitor.

Figure 87. Select Node Address Dialog

The dialog is used to display all of the active nodes connected to the PC.

E. Click the View button on the dialog to display a list of active nodes on the MPI network as shown in fi gure 88.

The dialog should show an entry for MPI address 2.

Figure 88. Displaying the MPI Nodes

Page 109: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

109

F. Select the entry in the Enter Connection to Target Station window so that it is highlighted as shown in fi gure 88.

G. Click OK on the dialog to begin uploading the confi guration to the PC.

The Upload to PG dialog shown in fi gure 89 should appear as the confi gu-ration is uploading.

Figure 89. Upload to PG Dialog

Your screen should appear similar to that shown in fi gure 90 after the upload has completed.

Figure 90. Uploaded Station

UPLOADEDSTATION OBJECT

Page 110: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

110

H. Fully expand the project tree by selecting Expand All or Show All Levels from the View menu.

I. Click the Blocks folder to select it and display the OB1 object in the right-hand project window.

This OB1 Block is the Block that was last downloaded to the processor.

J. Right-click on the OB1 block and select Delete from the shortcut menu.

A dialog will appear to warn that the action cannot be undone.

K. Click Yes on the dialog to delete the OB1 block.

The block should be removed from the right-hand project window.

L. Right-click on the Blocks folder and select Insert New Object > Organi-zational Block from the shortcut menu as shown in fi gure 91.

Figure 91. Inserting OB1

SHORTCUTMENU

Page 111: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

111

The Properties - Organizational Block dialog shown in fi gure 92 should appear.

Figure 92. Properties – Organizational Block Dialog

Make sure that OB1 is listed in the Name fi eld and that LAD is selected as the programming language.

M. Click OK on the dialog to create OB1.

OB1 should now appear in the right-hand side project window.

Another way to start with an empty OB1 block is to open OB1 and delete the contents.

N. Double-click the OB1 object in the right-hand project window to open the LAD/STL/FBD Editor.

The LAD/STL/FBD Editor should open.

Page 112: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

112

6. Enter the ladder logic shown in fi gure 93 into OB1.

Figure 93. Branch Outputs

7. Select Save from the fi le menu to save OB1 and check for syntax errors. 8. Perform the following substeps to download the project to the PLC’s

processor.

A. Display the SIMATIC Manager by selecting it from the PC’s taskbar.

B. Click the SIMATIC 300 Station object to select it.

C. Click the Download button to download the project to the processor.

A dialog should appear asking if you want to delete the system data in the programmable controller completely.

D. Click Yes.

E. Click OK.

F. Click Yes.

G. Click Yes.

H. Click Yes. 9. Display the LAD/STL/FBD Editor by selecting it from the PC’s taskbar. 10. Click the Monitor button to go online with the PLC. 11. Test your program by turning switch 1 of the 89-IOS Station to the on

position. 89-IOS Station indicators L1 and L2 should turn on because switch 1 causes

Normally Open Contact instruction I0.0 to turn on. 12. Turn switch 1 of the 89-IOS Station to the off position. 13. Repeat steps 11 and 12 to become more familiar with the operation of the

PLC program. 14. Click the Monitor button to go offl ine from the processor.

Q4.0I0.0

Q4.1

Network 1: Title:

Page 113: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

113

15. Perform the following substeps to create project L2A1A.

A. Display the LAD/STL/FBD Editor by selecting it from the PC’s taskbar.

B. Delete the ladder logic in OB1.

C. Display the SIMATIC Manager by selecting it from the PC’s taskbar.

Select the L2A1A Project object by clicking it so that it is highlighted.

It must be selected so that the entire project is saved.

D. Select Save As from the File menu.

The Save Project As dialog should open.

E. Enter L2A1Bxxx where xxx represents your initials for the project name.

F. Click OK on the dialog to accept the name and create the project.

Project L2A1B is created.

Project L2A1B has been created with the same hardware confi guration as L2A1A. Saving a confi gured project with a different name and then editing the ladder logic is one way to create a new project without having to reconfi gure the hardware.

G. Fully expand the project tree by clicking the pluses [+] next to the objects in the left-hand Project Window.

H. Click the Blocks folder to select it and display the OB1 object in the right project window.

I. Double-click the OB1 object in the right project window to open the LAD/STL/FBD Editor.

The LAD/STL/FBD Editor should open.

J. Click Network 1 (the text) and press the keyboard’s delete key to delete the network.

Figure 94. Simultaneous Control of Multiple Output Instructions

16. Enter the ladder logic shown in fi gure 94 into OB1.

Q4.0I0.0

Q4.1I0.0

Q4.2I0.0

Network 1: Title:

Network 2: Title:

Network 3: Title:

Page 114: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

114

17. Select Save from the File menu to check the ladder logic for syntax errors and to save the ladder logic entered in the OB1 block.

18. Click the Download button on the LAD/STL/FBD Editor’s toolbar to download OB1 to the processor.

Downloading using the LAD/STL/FBD Editor will only download OB1 to the processor.

The hardware confi guration was downloaded earlier when project L2A1A was downloaded to the processor.

19. Click the Monitor button to go online with the processor. The processor should already be in the RUN mode. 20. Test your program by turning switch 1 of the 87-IOS Station to the on

position. 87-IOS Station indicators 1 and 2 should turn on because switch SW1 causes

Normally Open Contact instruction I0.0 to turn on. 21. Turn switch SW1 of the 89-IOS Station to the off position. 22. Repeat steps 20 and 21 to become more familiar with the operation of the

PLC program. 23. Click the Monitor button to go offl ine from the processor. 24. Print out a copy of both ladder logic programs L2A1A and L2A1B and place

them in your portfolio. 25. Close the LAD/STL/FBD Editor by clicking the [X] in the top right-hand

corner of the window. 26. Close the SIMATIC Manager by clicking the [X] in the top right-hand corner

of the window. 27. Perform the following substeps to power down the trainer.

A. Turn off the PC and monitor.

B. Turn off the PLC trainer.

Page 115: BASIC PLC PROGRAMMING · PDF file · 2017-01-03... you can easily learn other numbering systems. Every numbering system has a base or radix. ... 2 using the four-digit decimal number

B25014-AA02UEN BASIC PLC PROGRAMMINGCopyright © 2012 Amatrol, Inc.

115

SEGMENT 4 SELF REVIEW

1. One of the advantages of a PLC is that it permits many instructions to be controlled by one ______ and it doesn’t matter how many of these are Normally Open Contact or Normally Closed Contact instructions.

2. PLCs are different than hard-wired circuits in that the input device and the input instruction do not have to use the same ______.

3. There are two methods of getting the same input logic: select the type of input device contacts or select the type of input ________.

4. One method to have more than one output controlled with the same input logic is to _____ the outputs.

5. Another method to have more than one output controlled with the same input logic is to place each output on a separate network and use ________ input instructions with the same address.