The text of a manual · part 15 of 59
Mini-PLC-2/02, 2/16, 2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual: 7 - Memory Organization
Pages 107 to 118 of 490, from Mini-PLC-2/02, 2/16, 2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual
The original document is the PDF (2.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-LW /LWD, Allen-Bradley 1772-LWP, Allen-Bradley 1772-LX / LXP and Allen-Bradley 1772-LZP
Page 107
7
Chapter
Memory Organization
Chapter Objectives
This chapter discusses: hardware and its relationship to your program memory and its components This chapter provides detailed concepts of the memory’s organization and its structure. Understanding these concepts aids you in programming your processor.
Introduction
Before we explain memory organization and its structure, read the following definitions: Bit - the smallest unit of information that memory is capable of retaining Byte - a group of 8 consecutive bits (00-0708 or 10-1708) Word - a group of 16 consecutive bits (00-1708) Bits
17
16
15
14
13
12
11
10
07
Byte (upper)
06
05
04
03
02
01
00
Byte (lower) Word
10346-I
In the program, the input or output instruction address is associated with a specific I/O terminal. See chapter 5 for more information.
7-1
Page 108
Chapter 7 Memory Organization
Memory Areas
Memory is divided into three major areas: data table, user program, and message storage area. These areas store input status, output status, and program instructions and messages. Data Table The first part of memory is the data table (Figure 7.1). The processors are factory configured for 128 words. Figure 7.2 shows memory structure with a factory configured data table. The specific concepts throughout this publication refer to a factory configured data table. Figure 7.1 Simplified Memory Structure
Data Table
Main Program User Program Subroutine Message Storage Area
7-2
10151-I
Page 109
Chapter 7 Memory Organization
Figure 7.2 Data Table Factory Configured for 2-Slot Addressing Total Decimal Words
8
Decimal Words Per Area
8
Word Address
Processor Work Area No. 1
Bit Address 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 7 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
8 Timer/Counter Preset Values (PR) (or Bit/Word Storage)
3
4
00
FactoryConfigured Data Table 6
5
127 130
17 00
177 200
17 00
128
40
Mini-PLC-2/02 Mini-PLC-2/16 Mini-PLC-2/17
1920 3968 7808
1792 3840 7680
Expanded Data Table and/or User Program
3577 17 7577 17 17177 17
Mini-PLC-2/02 Mini-PLC-2/16 Mini-PLC-2/17
Mini-PLC-2/02 Mini-PLC-2/16 Mini-PLC-2/17
2048 4096 7936
128 128 128
User Program
3777 17 7777 17 17377 17
Mini-PLC-2/02 Mini-PLC-2/16 Mini-PLC-2/17
1 2 3 4 5 6 7
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. Do not use for bit/word storage.
10148-I
7-3
Page 110
Chapter 7 Memory Organization
Figure 7.3 Data Table Configured for 1-Slot Addressing
Total Decimal Words
Decimal Words Per Area
8
8
Word Address
Bit Address 000 00
Processor Work Area No. 1
007 17 010 00
Output Image Table Rack 1 6 16
8
017 17 020 00
Output Image Table Rack 2 1 1 24
8
Reserved
2
7
64
40
Timer Counter Accumulated Values (AC) (or Bit Word Storage) 3
72
8
Processor Work Area No. 2
026 17 027 030 00 077 17 100 00
Configured for 1-Slot Addressing Data Table 5
107 17 110 00
Input Image Table Rack 1 6 80
8
88
8
Input Image Table Rack 2 6
128
40
Timer Counter Preset Values (PR) (or Bit Word Storage)
Mini-PLC-2/02 Mini-PLC-2/16 Mini-PLC-2/17
1920 3968 7808
1792 3840 7680
Expanded Data Table and/or User Program
Mini-PLC-2/02 Mini-PLC-2/16 Mini-PLC-2/17
2048 4096 7936
128 128 128
User Program
1 2 3 4 5 6 7
7-4
117 17 120 00 4
127 17 130 00 177 17 200 00 3577 17 7577 17 17177 17
Mini-PLC-2/02 Mini-PLC-2/16 Mini-PLC-2/17
3777 17 7777 17 17377 17
Mini-PLC-2/02 Mini-PLC-2/16 Mini-PLC-2/17
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. Do not use word 127 for block transfer data storage. Can be decreased to 48 words. Used with 1-slot addressing. You cannot put an output or block transfer module in rack 2, I/O group 7 when using 1-slot addressing. You can put an input module in rack 2, I/O group 7.
10349–I
Page 111
Chapter 7 Memory Organization
Figure 7.4 Data Table Configured for 1/2-Slot Addressing Word Address
Total Decimal Words
Decimal Words Per Area
8
8
Processor Work Area No. 1
16
8
Output Image Table Rack 1
24
8
Output Image Table Rack 2 1 Reserved 2 6
32
8
Output Image Table Rack 3
40
8
64
24
Output Image Table Rack 4 Timer/Counter Accumulated Values (AC) 3 (or Bit/Word Storage)
72
8
Processor Work Area No. 2
Bit Address 000 00 007 17 010 00 017 17 020 00 026 17 027 030 00 037 17 040 00 047 00 050 00 077 17 100 00
Configured for 1/2-Slot Addressing Data Table 5
107 17 110 00
Input Image Table Rack 1 80
8
88
8
Input Image Table Rack 2
96
8
Input Image Table Rack 3
8
Input Image Table Rack 4
24
Timer/Counter Preset Values (PR) (or Bit/Word Storage)
104
128 Mini-PLC-2/02 Mini-PLC-2/16 Mini-PLC-2/17
1920 1792 3968 3840 7808 7680
Mini-PLC-2/02 Mini-PLC-2/16 Mini-PLC-2/17
2048 4096 7936
128 128 128
117 17 120 00 4
127 17 130 00 137 17 140 00 147 00 150 00
Expanded Data Table and/or User Program
177 17 200 00 3577 17 7577 17 17177 17
Mini-PLC-2/02 Mini-PLC-2/16 Mini-PLC-2/17
User Program
3777 17 7777 17 17377 17
Mini-PLC-2/02 Mini-PLC-2/16 Mini-PLC-2/17
May not be used for accumulated values. Not available for bit/word storage. Bits in this word are used by the processor. 3 Unused timer/counter memory words can reduce data table size and increase user program area. 4 Do not use word 127 for block transfer data storage. 5 Can be decreased to 48 words. 6 You cannot put an output or block transfer module in rack 2, I/O Group 7 when using 1/2-slot addressing. You can put an input module in rack 2, I/O group 7. 1 2
10350–I
7-5
Page 112
Chapter 7 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 2 describes the input and output image tables. The following sections describe the remaining areas. Processor Work Areas There are two processor work areas. They are located at addresses 000 00 to 007 17 and 100 00 to 107 17. The processor uses these 16 words for its internal control functions. You cannot address these data table words. Bit/Word Storage There are two bit/word storage areas (providing you are not using 1-slot addressing). They are located at addresses 020-026 and 120-127. Diagnostic Word: Word 027 Bits in word 027 are used by the processor for internal control functions. This Bit:
Stores this Information:
00
(Battery low) - set when the battery is low.
01
(EEPROM) - set indicates that EEPROM transferred at power-up. This bit is always reset (0) when the processor powers down
02
(STI too long) - set indicates subroutine execution time plus program transition time exceed service time.
03
Reserved.
04 05 06
7-6
07
Reserved for Data Highway - set when the processor is connected to the line and actively communicating with the Data Highway.
10-15
Used in Report Generation for message request bits
16
Report Generation Busy bit
17
Report Generation Done bit
Page 113
Chapter 7 Memory Organization
Adjusting the Data Table
You can adjust the size of a data table at any time during programming or editing. Using the 1770-T3 terminal, you can expand the data table in steps of two words from 48 words to 256 words and then in steps of 128 words to 1,920 words for a Mini-PLC-2/02, 3,968 words for a Mini-PLC-2/16 or 7,808 words for a Mini-PLC-2/17. You can expand the data table to accommodate the full I/O capacity of the processor. Expanding the data table provides more timer/counters or up to 488 timers/counters maximum and space for files (see chapter 11). Expanding the data table reduces the size of the user program and memory storage area. You should allow sufficient room for both data table and user program. To use the data table to its fullest capacity, remember the following: The processor initially reserves the first 128 words in the memory for the data table. You can adjust the data table size in two word increments to 256 words. 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. If a block transfer instruction in your program addresses a module in rack 2 and you have a 1770-T3 series A or B terminal, you cannot decrease the size of the data table but you can increase it. You can use the two GET method for performing block transfers in rack 2 (see chapter 18).
Expanding the Data Table To expand your data table to any size between 48 and 128 words, do this: Between 48 and 128 Words 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 available) DATA TABLE SIZE
01 2 040 0128
This illustration shows a factory-configured data table. The numbers shown are default values. Numbers must be replaced by user-entered values. Enter the number of timer/counters equivalent to the size of the data table (Table 7.A).
7-7
Page 114
Chapter 7 Memory Organization
Table 7.A The Data Table Sizes Between 48 and 256 Words Number of Timers and Counters
Data Table Size
Number of Timers and Counters
Data Table Size
Number of Timers and Counters
Data Table Size
000
0048
001 002 003 004 005
0050 0052 0054 0056 0058
036 037 038 039 040
0120 0122 0124 0126 0128
071 072 073 074 075
0190 0192 0193 0196 0198
006 007 008 009 010
0060 0062 0064 0068
041 042 043 044 045
0130 0132 0134 0136 0138
076 077 078 079 080
0200 0202 0204 0206 0208
011 012 013 014 015
0070 0072 0074 0076 0078
046 047 048 049 050
0140 0142 0144 0146 0148
081 082 0873 084 085
0210 0212 0214 0216 0218
016 017 018 019 020
0080 0082 0084 0086 0088
051 052 053 054 055
0150 0152 0154 0156 0158
086 087 088 089 090
0220 0222 0224 0026 0228
021 022 023 024 025
0090 0092 0094 0096 0098
056 057 058 059 060
0160 0162 0164 0166 0168
091 092 093 094 095
0230 0232 0234 0236 0238
026 027 028 029 030
0100 0102 0104 0106 0108
061 062 063 064 065
0170 0172 0174 0176 0178
096 097 098 099 100
0240 0242 0244 0246 0248
031 032 033 034 035
0110 0112 0114 0116 0118
066 067 068 069 070
0180 0182 0184 0186 0188
101 102 103 104
0250 0252 0254 0256
For 92 words, enter 022. 022
DATA TABLE CONFIGURATION NUMBER OF 128-WORD D. T. BLOCKS NUMBER OF INPUT/OUTPUT RACKS NUMBER OF T/C (if available) DATA TABLE SIZE
7-8
01 2 022 0092
Page 115
Chapter 7 Memory Organization
Three things happen to the display. The cursor returns to the NUMBER OF 128–WORD D.T. BLOCKS. NUMBER OF T/C changes to 022. DATA TABLE SIZE becomes 92.
Expanding the Data Table Between 130 and 256 Words 02
To expand your data table to any size between 130 and 256 words, do this: DATA TABLE CONFIGURATION NUMBER OF 128-WORD D. T. BLOCKS NUMBER OF INPUT/OUTPUT RACKS NUMBER OF T/C (if available) DATA TABLE SIZE
01 2 104 0258
Three things happen to the data table configuration: The cursor jumps to the Number of T/C. Number of T/C changes to 104. Data table size becomes 256. Enter the number of timer/counters equivalent to the desired size of the data table (Table 7.A). 065
DATA TABLE CONFIGURATION NUMBER OF 128-WORD D. T. BLOCKS NUMBER OF INPUT/OUTPUT RACKS NUMBER OF T/C (if available) DATA TABLE SIZE
021 2 165 0178
Three things happen to the data table configuration: The cursor returns to the NUMBER OF 128–WORD D.T. BLOCKS. NUMBER OF T/C changes to 065. DATA TABLE SIZE becomes 178. If you want to increase the data table size to 256 words, press 02 and then CANCEL COMMAND. If you want to increase the data table size beyond 256 words, remember the data table increases in steps of 128 words. See Table 7.B.
7-9
Page 116
Chapter 7 Memory Organization
Table 7.B The Data Table Sizes Between 384 and 7,808 words Enter
Data Table Size
Enter
Data Table Size
The Mini-PLC-2/02 has this number of data table blocks. 3 4 5 6 7 8 9
384 512 640 768 896 1024 1152
10 11 12 13 14 15
1280 1408 1536 1664 1792 1920
The Mini-PLC-2/16 has this additional number of data table blocks. 16 17 18 19 20 21 22 23
2048 2176 2304 2432 2560 2688 2816 2944
24 25 26 27 28 29 30 31
3072 3200 3328 3456 3584 3712 3840 3968
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
4096 4229 4352 4480 4608 4736 4864 4992 5120 5248 5376 5504 5632 5760 5888
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
6016 6144 6272 6400 6528 6656 6784 6912 7040 7168 7296 7424 7552 7680 7808
After you have adjusted the data table, press CANCEL COMMAND and we will continue.
7-10
Page 117
Chapter 7 Memory Organization
User Program
The second major part of memory is the user program (Figure 7.1). It is divided into two areas: This Area:
Stores this:
main program
The program is a group of ladder diagram instructions that control an application 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 your output devices. When you write a program, you specify the things you want done in your application and the conditions that must be met before those things should be done.
subroutine area
This area stores small programs that are periodically accessed. The subroutine area is not scanned unless you program the processor to jump to this area (which is located in the memory between the main program and the message store areas). This area acts as the end of program statement for the main program.
The user program area begins at the end of the data table.
Message Storage
The third major part of memory is the message storage area (Figure 7.1). You are able to print messages in hard copy. You can store up to 70 messages using the 1770-T3 terminal, or 198 messages using the 1770-RG module and an RS-232-C device. 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 alphanumeric characters. A character is any alpha or numerical figure (this includes blank spaces).
7-11
Page 118
Chapter 7 Memory Organization
Examining the Memory If you want to examine the memory layout:
SEARCH The word SEARCH appears in the lower left hand corner of the screen. 54
Memory Layout Display Mini-PLC-2/17 Mini-PLC-2/16 Data Table Size 128 words
Data Table Size 128 words
User Program Area 0001 words
User Program Area 0001 words
User Message Area 0000 words Unused Memory Available 3967 words
User Message Area 0000 words Unused Memory Available 7807 words
Mini-PLC-2/02 Data Table Size 128 words User Program Area 0001 words User Message Area 0000 words Unused Memory Available 1919 words
This illustrates the memory layout display for a 128 word data table. Even if there are no messages or programs in the memory, the END statement is there and it requires one word. Adding the number of words in the four areas equals the memory size (decimal).
7-12