Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 5 of 29

1772 Mini PLC-2/05 Processor (Cat. No. 1772-LS, LSP) Programming and Operations Manual, pages 41 to 50

Pages 41 to 50 of 289

The original document is the PDF (1.4 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Allen-Bradley 1772-LSP

Page 41

Chapter 4 Memory Organization

Memory Areas

Memory is divided into three major sections: data table, user program and a message storage area. The areas store input status, output status, your program instructions and messages. We describe these areas in detail so you can gain programming flexibility using your processor.

Data Table The first part of memory is the data table (Figure 4.2). The processors are factory configured for 128 words. Figure 4.3 shows memory structure with a factory configured data table. The specific concepts throughout this publication refer to a factory configured data table. Figure 4.2 Memory Structure

Data Table

Main Program User Program Subroutine Message Storage Area

10151-I

4-3

Page 42

Chapter 4 Memory Organization

Figure 4.3 Data Table Organization, Factory Configured Total Decimal Words

8

8

Bit Address

Word Address

Decimal Words Per Area

Processor Work Area No. 1

000

00

007 010

17 00

017 020

17 00

026 027 030

17

077 100

17 00

107 110

17 00

117 120

17 00

Output Image Table 16

8 Bit/Word Storage

24

64

72

8

40

8

Reserved

1

2

Timer/Counter Accumulated Values (AC) (or Bit/Word Storage)

Processor Work Area No. 2 Input Image Table

80

8 Bit/Word Storage

88

128

1 2 3 4 5 6

4-4

8

40

2944

2816

3072

128

Timer/Counter Preset Values (PR) (or Bit/Word Storage) Expanded Data Table and/or User Program

3

4

00

FactoryConfigured Data Table 6

Maximum Size of Data Table

5

127 130

17 00

177 200

17 00

5577 17

User Program End of Memory

May not be used for accumulated values. Not available for bit/word storage. Bits in this word are used by the processor. Unused timer/counter memory words can reduce data table size and increase user program area. May not be used for preset values. Do not use word 127 for block transfer data storage. Can be decreased to 48 words.

10148-I

Page 43

Chapter 4 Memory Organization

The data table area is a major part of memory. It is divided into six sections which includes the input and output image tables. (These two areas were described in chapter 2). The processor controls and utilizes words stored in the data table. The input devices coupled with the control logic from your program determines the status of the output devices. Input devices are limit switches, pushbutton switches, pressure switches, etc. Output devices are solenoids, motor starters, alarms, etc. Transfer of input data from input devices and the transfer of output data to output devices occur during I/O scan. If the status of the output instruction changes in the program then the on or off status of the output devices update during the I/O scan to reflect the change. To use the data table, you must understand the following: The processor initially reserves the first 128 words in the memory for the data table. You can decrease the data table size to 48 words in two word increments. You can increase the data table size to 256 words in two word increments. Then you can increase the data table size in blocks of 128 words. When the data table is set to 256 words, you can program up to 104 timer/counter instructions. You can change the data size from 48 words to 2,944 words using the 1770-T3 terminal. Data Table Expansion Using the 1770-T3 industrial terminal, you can adjust the data table size to be anywhere from 48 words to 2944 words. Expanding the data table provides additional timers/counters and space for files (see chapter 8 for timers/counters and chapter 10 for file information), but it also proportionally reduces the program storage and memory areas. Expansion is in increments of two words until a table of 256 is reached and then in increments of 128 words. Important: When using the data table expansion capability, allow sufficient room for both data table and user program.

4-5

Page 44

Chapter 4 Memory Organization

To expand your data table do this:

SEARCH

The word SEARCH appears in the lower left hand corner of the screen.

50

DATA TABLE CONFIGURATION NUMBER OF 128-WORD D.T. BLOCKS NUMBER OF INPUT/OUTPUT RACKS NUMBER OF T/C (if applicable) DATA TABLE SIZE

01 2 40 128

The following chart helps you adjust the data table size for your processor: Enter

Data Table Size

01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23

128 256 384 512 640 768 896 1024 1152 1280 1408 1536 1664 1792 1920 2048 2176 2304 2432 2560 2688 2816 2944

After you adjust the data table, press [CANCEL COMMAND]. Important: Other industrial terminal commands are summarized in appendix C.

4-6

Page 45

Chapter 4 Memory Organization

Data Table Areas The following areas make up the data table. They are: processor work area no. 1 output image table bit/word storage (020-027) timer/counter accumulated values and internal storage processor work area no. 2 input image table bit/word storage (120-127) timer/counter preset values and internal storage Chapter 1 describes the input and output image tables. The following sections describe the remaining areas. Processor Work Areas Purpose: The processor uses these 16 words for its internal control functions. Description: There are two processor work areas. They are located at addresses 000-007 and 100-107. You cannot access these data table words. Their word addresses are not available for addressing. Important: The term address is defined in chapter 6. Remember, all addresses are in octal values. Accumulated Values and Internal Storage Purpose: Stores accumulated values of timer or counter instructions. This area also stores data by words and/or bits from your program instructions (addresses 030-077). Description: Each timer or counter instruction uses two words of data table. one word is stored in the accumulated value area, the other is the preset value area. When the accumulated value equals the preset value (AC=PR), a status bit is set and can be examined to turn on or off an output device. Preset Values and Internal Storage Purpose: Stores preset values (PR) of timer or counter instructions. This area also stores data by words and/or bits from your program (addresses 130-177). Description: The preset value is the number of timed intervals or events to be counted. The preset value is 100 octal words above the accumulated word. Therefore, a timer/counter having an address of 030 automatically has its preset value stored at address 130.

4-7

Page 46

Chapter 4 Memory Organization

User Program The second major part of memory is the user program (Figure 4.2). It is divided into two areas: main ladder diagram program subroutine area The user program area begins at the end of the data table. Main Program Purpose: The program is a group of ladder diagram and functional block instruction used to control an application. Description: A program is a list of instructions that guides the processor. These instructions can examine or change the status of bits in the memory of the processor. The status of these bits determines the operation of output devices. The program specifies the things you want done in your application and the conditions that must be met before those things are done. For example, if you want a solenoid energized when a limit switch is closed, you would specify: Condition: Action:

If limit switch is closed Energize solenoid

Programming logic differs from relay logic in an important way. Programming logic is only concerned with whether or not conditions have been met. These conditions may be open or closed input or output devices. We must have a continuous or unbroken path of true logic conditions for an action to be taken. The number of conditions is not important. There can be none, one, or many conditions preceding an output action. When the path of conditions is continuous, we say that the rung is true. When the path of conditions is not continuous, we say the rung is false. Subroutine Area Purpose: Used to jump to a defined ladder diagram area. This allows you to perform ladder diagram subroutines. Description: The subroutine area is between the main program and the message store areas. This area acts as the end of program statement for the main program. It allows storage of small programs that are to be accessed periodically. Subroutine areas are not scanned unless you program the processor to jump to this area. A maximum of eight subroutines can be programmed in the subroutine area. Each subroutine begins with a label instruction and (when you want to exit to your main program) ends with a return instruction. 4-8

Page 47

Chapter 4 Memory Organization

Message Storage Area The third major part of memory is the message storage area (Figure 4.2). You can print out messages in hard copy form. You can store up to 70 messages using the 1770-T3 industrial terminal, or 198 messages using the 1770- T3 terminal with the 1770-RG module. Message storage follows the end statement of your program and is limited by the number of unused words remaining in memory. Each word stores two message characters. A character is any alpha or numerical figure (this includes blank spaces). Messages are written to display current data table information such as the number of parts rejected in a production run for a particular time period. you can write your program to display messages when a pushbutton switch is activated. Address 027 controls messages 1-6. You designate control words which control your messages in groups of 8. Your control word must be arranged in consecutive order. Report generation (see chapter 17) is a function of your message control words. Reserve bit addresses 02710 thru 02717 for this automatic report generation function to determine status of this function. These bit addresses should not be used for any other functions if you want to achieve maximum flexibility within your program.

Chapter Summary

We described detailed concepts of memory organization and its structure. The next chapter explains how the processor scans the program.

4-9

Page 48

Chapter

5

Scan Theory

Chapter Objectives

In this chapter you will read about: scan function scan time

Scan Function

The processor controls the status of output devices or instructions in accordance with program logic. Every instruction in your program requires execution time. These times vary greatly depending upon the instruction, the amount of data to be operated on, and whether the instruction is true or false. As a review from chapter 1, there are two types of scans (Figure 5.1): I/O scan (775µs without forcing: 1 ms with forcing) Program scan (15ms/K of user memory)

5-1

Page 49

Chapter 5 Scan Theory

Figure 5.1 Scan Sequence

Output Image Table

Output Terminals

Copy output image table status into output terminal circuits. I/O Scan

Input Image Table

Input Terminals

Copy input terminal status into input image table

Program Statement

Program Scan

Execute each program rung in sequence, writing into bits in the data table, including the output image table.

11597

5-2

Page 50

Chapter 5 Scan Theory

On power-up, the processor begins the scan sequence with the I/O scan. Data from output image table is written to the output modules. Data from the input modules is read into the input image table. Next, the processor scans the program statement by statement: 1.

For each condition, the processor checks, or “reads,” the image table to see if the condition has been met.

2.

If the set of conditions has been met, the processor writes a one into the bit location in the output image table corresponding to the output terminal to be energized. On the other hand, if the set of conditions has not been met, the processor writes a zero into that bit location, indicating that the output terminal should not be energized.

Important: When your processor is in the remote test mode, all outputs are held off. When your processor is in the run/program mode, all outputs are controlled by the user program.

Average Scan Time

Average scan time is the average amount of time it takes the processor to monitor and update input and outputs, and to execute instructions in the program. The scan is performed serially; first the I/O image table is updated, (other parts of the data table are not scanned), then the user program is scanned. There are two ways to measure average scan time: Append the rungs in Figure 5.2 to your program. Figure 5.2 Average Scan Time Rung 1

Rung 2

031

Rung 3

14

031 14 031

032 G 000

Store 1 G 010

Rung 4

Rung 5

14 031 14

Rung 6

031 CTU PR 999 AC 000 031 CTU PR 999 AC 000 032 RTO 0.1 PR 999 AC 000 Store Store 2 3 : : 000 . 000 032 RTR PR 999 AC 000 032 RTR PR 999 AC 000

5-3