The text of a manual · part 59 of 70
SLC 500 Instruction Set Reference Manual, pages 581 to 590
Pages 581 to 590 of 694
The original document is the PDF (7.2 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 1747-L514
Page 581
Appendix
C
Memory Usage
This appendix provides: • instruction words for the Fixed, SLC 5/01, SLC 5/02, SLC 5/03, SLC 5/04, and SLC 5/05 processor. • examples on how to estimate the total memory usage of your system.
Memory Usage Overview
If you want to use a
See page
Fixed or SLC 5/01 processor
C-2
SLC 5/02 processor
C-7
SLC 5/03 processor
C-13
SLC 5/04 or SLC 5/05 processor
C-13
SLC 500 controllers have the following user memory capacities.
Table C.1 Processor Memory Capacity Type of Processor
User Memory Capacity
Fixed and SLC 5/01
1,024 instruction words
SLC 5/02
4,096 instruction words
SLC 5/03 8k
4,096 words
SLC 5/03, SLC 5/04, SLC 5/05 16k
12,288 words(1)
SLC 5/04, SLC 5/05 32k SLC 5/04, SLC 5/05 64k
28,672 words(1) 61,440 words(1)
(1)
When your ladder program is larger than 12k words, you must split your program into two files. A main (file 2) and at least one subroutine for(3 to 255) is required.
The following definitions apply when figuring your memory usage. • fixed, SLC 5/01, and SLC 5/02: 1 instruction word = 4 data words = 8 bytes • SLC 5/03, SLC 5/04, and SLC 5/05: 1 instruction word = 1 data word
1
Publication 1747-RM001G-EN-P - November 2008
Page 582
C-2
Memory Usage
The number of words used by an instruction is indicated in the following table. Since the program is compiled by the programmer, it is only possible to establish estimates for the instruction words used by individual instructions. The calculated memory usage will normally be greater than the actual memory usage, due to compiler optimization.
Fixed and SLC 5/01 Processors
Table C.2 SLC 500 Fixed and SLC 5/01 List of Instructions Mnemonic
Memory Usage (user words)
Name
Instruction Type
Page
ADD
1.5
Add
Math
4-5
AND
1.5
And
Data Handling
5-20
BSL
2.00
Bit Shift Left
Application Specific
7-4
BSR
2.00
Bit Shift Right
Application Specific
7-4
CLR
1.00
Clear
Math
4-12
COP
1.50
File Copy
Data Handling
5-13
CTD
1.00
Count Down
Basic
2-14
CTU
1.00
Count Up
Basic
2-13
DCD
1.50
Decode 4 to 1 of 16
Data Handling
5-10
DDV
1.00
Double Divide
Math
4-11
DIV
1.50
Divide
Math
4-9
EQU
1.50
Equal
Comparison
3-2
FLL
1.50
Fill File
Data Handling
5-13
FRD
1.00
Convert from BCD
Data Handling
5-5
GEQ
1.50
Greater Than or Equal
Comparison
3-4
GRT
1.50
Greater Than
Comparison
3-3
HSC
1.00
High-speed Counter
High-speed Counter
2-15
IIM
1.50
Immediate Input with Mask
Program Flow Control
6-8
IOM
1.50
Immediate Output with Mask
Program Flow Control
6-9
JMP
1.00
Jump to Label
Program Flow Control
6-2
JSR
1.00
Jump to Subroutine
Program Flow Control
6-3
LBL
0.50
Label
Program Flow Control
6-2
LEQ
1.50
Less Than or Equal
Comparison
3-3
LES
1.50
Less Than
Comparison
3-3
MCR
0.50
Master Control Reset
Program Flow Control
6-6
MEQ
1.50
Masked Compare for Equal
Comparison
3-4
MOV
1.50
Move
Data Handling
5-17
MUL
1.50
Multiply
Math
4-8
MVM
1.50
Masked Move
Data Handling
5-18
Publication 1747-RM001G-EN-P - November 2008
Page 583
Memory Usage
C-3
Table C.2 SLC 500 Fixed and SLC 5/01 List of Instructions (Continued) Mnemonic
Memory Usage (user words)
Name
Instruction Type
Page
NEG
1.50
Negate
Data Handling
5-24
NEQ
1.50
Not Equal
Comparison
3-2
NOT
1.00
Not
Data Handling
5-23
OR
1.50
Or
Data Handling
5-21
OSR
1.00
One-shot Rising
Basic
2-5
OTE
0.75
Output Energize
Basic
2-4
OTL
0.75
Output Latch
Basic
2-4
OTU
0.75
Output Unlatch
Basic
2-4
RES
1.00
Reset
Basic
2-20
RET
0.50
Return from Subroutine
Program Flow Control
6-3
RTO
1.00
Retentive Timer
Basic
2-11
SBR
0.50
Subroutine
Program Flow Control
6-3
SQC
2.00
Sequencer Compare
Application Specific
7-6
SQO
2.00
Sequencer Output
Application Specific
7-6
SUB
1.50
Subtract
Math
4-5
SUS
1.50
Suspend
Program Flow Control
6-8
TND
0.50
Temporary End
Program Flow Control
6-7
TOD
1.00
Convert to BCD
Data Handling
5-2
TOF
1.00
Timer Off-delay
Basic
2-10
TON
1.00
Timer On-delay
Basic
2-9
XIC
1.00
Examine If Closed
Basic
2-3
XIO
1.00
Examine If Open
Basic
2-3
XOR
1.50
Exclusive Or
Data Handling
5-22
Publication 1747-RM001G-EN-P - November 2008
Page 584
C-4
Memory Usage
Estimating Total Memory Usage of Your System Using a Fixed or SLC 5/01 Processor
__________
1. Calculate the total instruction words used by the instructions in your program and enter the result. Refer to the table on page C-2.
__________
2. Multiply the total number of rungs by 0.375 and enter the result.
__________
3. Multiply the total number of data words (excluding the status field and I/O data words) by 0.25 and enter the result.
__________
4. Add 1 word for each data table file and enter the result
__________
5. Multiply the highest numbered program file used by 2 and enter the result.
__________
6. Multiply the total number of I/O data words by 0.75 and enter the result.
__________
7. Multiply the total number of I/O slots, used or unused, by 0.75 and enter the result.
__________
8. To account for processor overhead, enter 65 if you are using a fixed controller, enter 67 if you are using a 1747-L511 or 1747-L514.
Total: __________
9. Total steps 1 through 8. This is the estimated total memory usage of your application system. Remember, this is an estimate, actual compiled programs may differ by ±12%. 10. If you wish to determine the estimated amount of memory remaining in the processor you have selected, do the following: If you are using a fixed controller or 1747-L511, subtract the total from 1024. If you are using a 1747-L514, subtract the total from 4096. The result of this calculation will be the estimated total memory remaining in your selected processor.
TIP
Publication 1747-RM001G-EN-P - November 2008
The calculated memory usage may vary from the actual compiled program by ±12%.
Page 585
Memory Usage
C-5
Fixed Controller Memory Usage Example
L20B Fixed I/O Controller 42
XIC and XIO
42 x 1.00
=
42.00
10
OTE instructions
10 x 0.75
=
7.50
10
TON instructions
10 x 1.00
=
10.00
1
CTU instruction
1 x 1.00
=
1.00
1
RES instruction
1 x 1.00
=
1.00
Instruction Usage
61.50
21 rungs
21 x 0.375
=
7.87
37 data words
37 x 0.250
=
9.25
User Program Total
78.62
2
I/O data words
2 x 0.75
=
1.50
1 slot
1 x 0.75
=
0.75
Overhead
65.00
I/O Configuration Total
67.25
Estimated total memory usage:
145.87 (round to 146)
1024 - 146 = 878 instruction words remaining in the processor
Publication 1747-RM001G-EN-P - November 2008
Page 586
C-6
Memory Usage
SLC 5/01 Processor Memory Usage Example
1747-L514 processor, 30-slot configuration, (15) 1746-IA16, (10) 1746-OA8, (1) 1747-DCM full configuration, (1) 1746-NI4, (1) 1746-NIO4I 50
XIC and XIO
50 x 1.00
= 50.00
15
OTE instructions
15 x 0.75
= 11.25
5
TON instructions
5 x 1.00
= 5.00
3
GRT instructions
3 x 1.50
= 4.50
1
SCL instruction
1 x 1.75
= 1.75
1
TOD instruction
1 x 1.00
= 1.00
3
MOV instructions
3 x 1.50
= 4.50
10
CTU instructions
10 x 1.00
= 10.00
10
RES instructions
10 x 1.00
= 10.00
Instruction Usage
98.00
30 rungs
30 x 0.375
= 11.25
10 0 data words
100 x 0.250
= 25.00
10 is highest data table file number
10 x 1.00
= 10.00
4 is highest program file number
4 x 2.00
= 8.00
User Program Total
163.50
49
I/O data words
49 x 0.75
= 36.75
30 slot
30 x 0.75
= 22.50
Overhead
67.00
I/O Configuration Total
126.25
Estimated total memory usage:
289.75 (round to 290)
4096 - 290 = 3806 instruction words remaining in the processor
Publication 1747-RM001G-EN-P - November 2008
Page 587
Memory Usage
C-7
The number of instruction words used by an instruction is indicated in the following table. Since the program is compiled by the programmer, it is only possible to establish estimates for the instruction words used by individual instructions. The calculated memory usage will normally be greater than the actual memory usage, due to compiler optimization.
SLC 5/02 Processor
Table C.3 SLC 5/02 List of Instructions Mnemonic
Memory Usage (user words)
Name
Instruction Type
Page
ADD
1.5
Add
Math
4-5
AND
1.5
And
Data Handling
5-20
BSL
2.00
Bit Shift Left
Application Specific
7-4
BSR
2.00
Bit Shift Right
Application Specific
7-4
CLR
1.00
Clear
Math
4-12
COP
1.50
File Copy
Data Handling
5-13
CTD
1.00
Count Down
Basic
2-14
CTU
1.00
Count Up
Basic
2-13
DCD
1.50
Decode 4 to 1 of 16
Data Handling
5-10
DDV
1.00
Double Divide
Math
4-11
DIV
1.50
Divide
Math
4-9
1.50
Equal
Comparison
3-2
FFL
1.50
FIFO Load
Data Handling
5-26
FFU
1.50
FIFO Unload
Data Handling
5-26
FLL
1.50
Fill File
Data Handling
5-13
FRD
1.00
Convert from BCD
Data Handling
5-5
GEQ(1)
1.50
Greater Than or Equal
Comparison
3-4
GRT(1)
1.50
Greater Than
Comparison
3-3
IID
1.25
I/O Interrupt Disable
Interrupt
11-32
IIE
1.25
I/O Interrupt Enable
Interrupt
11-32
IIM
1.50
Immediate Input with Mask
Program Flow Control
6-8
INT
0.50
Interrupt Subroutine
Interrupt
11-34
IOM
1.50
Immediate Output with Mask
Program Flow Control
6-9
JMP
1.00
Jump to Label
Program Flow Control
6-2
JSR
1.00
Jump to Subroutine
Program Flow Control
6-3
LBL
0.50
Label
Program Flow Control
6-2
LEQ(1)
1.50
Less Than or Equal
Comparison
3-3
LES(1)
1.50
Less Than
Comparison
3-3
EQU
(1)
Publication 1747-RM001G-EN-P - November 2008
Page 588
C-8
Memory Usage
Table C.3 SLC 5/02 List of Instructions (Continued) Mnemonic
Memory Usage (user words)
Name
Instruction Type
Page
LIM
1.50
Limit Test
Comparison
3-5
LFL
1.50
LIFO Load
Data Handling
5-28
LFU
1.50
LIFO Unload
Data Handling
5-28
MCR
0.50
Master Control Reset
Program Flow Control
6-6
MEQ(1)
1.50
Masked Comparison for Equal
Comparison
3-4
MOV
1.50
Move
Data Handling
5-17
MSG
34.75
Message
Communication
12-5
MUL
1.50
Multiply
Math
4-8
MVM
1.50
Masked Move
Data Handling
5-18
NEG
1.50
Negate
Data Handling
5-24
NEQ(1)
1.50
Not Equal
Comparison
3-2
NOT
1.00
Not
Data Handling
5-23
OR
1.50
Or
Data Handling
5-21
OSR
1.00
One-shot Rising
Basic
2-5
OTE
0.75
Output Energize
Basic
2-4
OTL
0.75
Output Latch
Basic
2-4
OTU
0.75
Output Unlatch
Basic
2-4
PID
23.25
Proportional Derivative
PID
9-3
REF
0.50
Refresh
Program Flow Control
6-10
RES
1.00
Reset
Basic
2-20
RET
0.50
Return from Subroutine
Program Flow Control
6-3
RPI
1.25
Reset Pending Interrupt
Interrupt
11-34
RTO
1.00
Retentive Timer
Basic
2-11
SBR
0.50
Subroutine
Program Flow Control
6-3
SCL
1.75
Scale Data
Math
4-15
SQC
2.00
Sequencer Compare
Application Specific
7-6
SQL
2.00
Sequencer Load
Application Specific
7-12
SQO
2.00
Sequencer Output
Application Specific
7-6
SQR
1.25
Square Root
Math
4-12
STD
0.50
Selectable Timer Interrupt Disable Interrupt
11-16
STE
0.50
Selectable Timer Interrupt Enable
Interrupt
11-16
STS
1.25
Selectable Timer Interrupt Start
Interrupt
11-17
SUB
1.50
Subtract
Math
4-5
SUS
1.50
Suspend
Program Flow Control
6-8
Service Comms
Communication
12-3
SVC
Publication 1747-RM001G-EN-P - November 2008
Page 589
Memory Usage
C-9
Table C.3 SLC 5/02 List of Instructions (Continued) Mnemonic
Memory Usage (user words)
Name
Instruction Type
Page
TND
0.50
Temporary End
Program Flow Control
6-7
TOD
1.00
Convert to BCD
Data Handling
5-2
TOF
1.00
Timer Off-delay
Basic
2-10
TON
1.00
Timer On-delay
Basic
2-9
XIC(1)
1.00
Examine If Closed
Basic
2-3
XIO(1)
1.00
Examine If Open
Basic
2-3
XOR
1.50
Exclusive Or
Data Handling
5-22
(1)
These instructions take zero execution time if they are preceded by conditions that guarantee the state of the rung. Rung logic is solved left to right. Branches are solved top to bottom.
Publication 1747-RM001G-EN-P - November 2008
Page 590
C-10
Memory Usage
Estimating Total Memory Usage of Your System Using a SLC 5/02 Processor
__________
1. Calculate the total instruction words used by the instructions in your program and enter the result. Refer to the table on page -7.
__________
2. Multiply the total number of rungs by 0.375 and enter the result.
__________
3. If you are using a 1747-L524 and have enabled the Single Step Test mode, multiply the total number of rung by 0.375 and enter the result.
__________
4. Multiply the total number of data words (excluding the status file and I/O data words by 0.25 and enter the result.
__________
5. Add 1 word for each data table file used and enter the result.
__________
6. Multiply the highest numbered program file used by 2 and enter the result.
__________
7. Multiply the total number of I/O data words by 0.75 and enter the result.
__________
8. Multiply the total number of I/O slots, used or unused, by 0.75 and enter the result.
__________
9. To account for processor overhead, enter 204
Total: __________
10. Total steps 1 through 9. This is the estimated total memory usage of your application system. Remember, this is an estimate, actual compiled programs may differ by ±12%. 11. If you wish to determine the estimated amount of memory remaining in the processor you have selected, do the following: If you are using a 1747-L524, subtract the total from 4096. The result of this calculation will be the estimated total memory remaining in your selected processor.
TIP
Publication 1747-RM001G-EN-P - November 2008
The calculated memory usage may vary from the actual compiled program by ±12%.