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

The text of a manual · part 53 of 55

Hand-Held Terminal (Catalog Number 1747-PT1) User Manual: C - Memory Usage, Instruction Execution Times

Pages 455 to 466 of 486, from Hand-Held Terminal (Catalog Number 1747-PT1) User Manual

The original document is the PDF (1.5 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-PT1

Page 455

Appendix

A–B

C

Memory Usage, Instruction Execution Times This appendix covers the following topics: • memory usage • instruction execution times for the fixed and SLC 5/01 processors • instruction execution times for the SLC 5/02 processor series A and B • instruction execution times for the SLC 5/02 processor series C and later

Memory Usage

SLC 500 controllers have the following user memory capacities: Type of Processor

Type of Controller

User Memory Capacity

Fixed I/O Controllers Fixed and SLC 5/01

1024 instruction words Modular Controllers 1747–L511

SLC 5/02

Modular Controllers 1747–L524

4096 instruction words

Definition: 1 instruction word = 4 data words = 8 bytes. The number of instruction words used by the individual instructions 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 is normally greater than the actual memory usage, due to compiler optimization.

C–1

Page 456

Appendix C Memory Usage, Instruction Execution Times

Fixed and SLC 5/01 Processors

C–2

Instruction Words for the Fixed and SLC 5/01 Processors Instruction

Instruction Words (approx)

ADD AND

1.5 1.5

BSL BSR

2 2

CLR COP CTD CTU

1 1.5 1 1

DCD DDV DIV

1.5 1 1.5

EQU

1.5

FLL FRD

1.5 1

GEQ GRT

1.5 1.5

HSC

1

IIM IOM

1.5 1.5

JMP JSR

1 1

LBL LEQ LES

0.5 1.5 1.5

Instruction

Instruction Words (approx)

MCR MEQ MOV MUL MVM

0.5 1.5 1.5 1.5 1.5

NEG NEQ NOT

1.5 1.5 1

OR OSR OTE OTL OTU

1.5 1 0.75 0.75 0.75

RES RET RTO

1 0.5 1

SBR SQC SQO SUB SUS

0.5 2 2 1.5 1.5

TND TOD TOF TON

0.5 1 1 1

XIC XIO XOR

1 1 1.5

Page 457

Appendix C Memory Usage, Instruction Execution Times

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 .375 and enter the result. 3. Multiply the total number of data words (excluding the status file and I/O data words) by .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 .75 and enter the result. 7. Multiply the total number of I/O slots, used or unused, by .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. Important: The calculated memory usage may vary from the actual compiled program by ±12%.

C–3

Page 458

Appendix C Memory Usage, Instruction Execution Times

Example: L20B Fixed I/O Controller 42 XIC and XIO 10 OTE instructions 10 TON instructions 1 CTU instruction 1 RES instruction Instruction Usage

42 x 1.00 = 42.00 10 x 0.75 = 7.50 10 x 1.00 = 10.00 1 x 1.00 = 1.00 1 x 1.00 = 1.00 61.50

21 rungs 37 data words User Program Total

21 x.375 = 37 x.250 =

7.87 9.25 78.62

2 I/O data words 1 slot Overhead I/O Configuration Total

2 x 0.75 = 1 x 0.75 =

1.50 0.75 65.00 67.25

Estimated total memory usage:

145.87 (round to 146)

1024 – 146 = 878 instruction words remaining in the processor

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 15 OTE instructions 5 TON instructions 3 GRT instructions 1 SCL instruction 1 TOD instruction 3 MOV instructions 10 CTU instructions 10 RES instructions Instruction Usage

50 x 1.00 = 50.00 15 x 0.75 = 11.25 5 x 1.00 = 5.00 3 x 1.50 = 4.50 1 x 1.75 = 1.75 1 x 1.00 = 1.00 3 x 1.50 = 4.50 10 x 1.00 = 10.00 10 x 1.00 = 10.00 98.00

30 rungs 30 x 0.375 = 11.25 100 data words 100 x 0.25 = 25.00 10 is highest data table file number 10 x 1 = 10.00 4 is highest program file number 4 x 2 = 8.00 User Program Total 163.50 49 I/O data words 30 slot Overhead I/O Configuration Total Estimated total memory usage:

49 x 0.75 = 36.75 30 x 0.75 = 22.50 67.00 126.25 289.75 (round to 290)

4096 – 290 = 3806 instruction words remaining in processor

C–4

Page 459

Appendix C Memory Usage, Instruction Execution Times

Instruction Execution Times for the Fixed and SLC 5/01 Processors

Execution Time in Microseconds (approx.)

Instruction

False

Instruction

True

ADD AND

12 12

122 87

BSL BSR

12 12

144 + 24 per word 134 + 24 per word

CLR COP CTD CTU

12 12 12 12

40 45 + 21 per word 111 111

DCD DDV DIV

12 12 12

80 650 400

EQU➀

12

60

FLL FRD

12 12

37 +14 per word 223

GEQ➀ GRT➀

12 12

60 60

HSC

12

60

IIM IOM

12 12

372 475

JMP JSR

12 12

38 46

LBL LEQ➀ LES➀

2 12 12

2 60 60

Execution Time in Microseconds (approx.) False

True

MCR MEQ➀ MOV MUL MVM

10 12 12 12 12

10 75 20 230 115

NEG NEQ➀ NOT

12 12 12

110 60 66

OR OSR OTE OTL OTU

12 12 18 19 19

87 34 18 19 19

RES RET RTO

12 12 12

40 34 140

SBR SQC SQO SUB SUS

2 12 12 12 12

2 225 225 125 12

TND TOD TOF TON

12 12 12 12

32 200 140 135

XIC➀ XIO➀ XOR

4 4 12

4 4 87

For the rung example at the right: 1) If instruction 1 is false, instructions 2, 3, 4, 5, 6, 7 take zero execution time. Execution time = 4 + 18 = 22 microseconds. 2) If instruction 1 is true, 2 is true, and 6 is true, then instructions 3, 4, 5, 7 take zero execution time. Execution time = 4 + 4 + 4 + 18 = 30 microseconds. 1

2 ][

8

6 ][

3

][

()

7 ][

][

4 ][ 5 ][

➀

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.

C–5

Page 460

Appendix C Memory Usage, Instruction Execution Times

SLC 5/02 Processor

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.

Instruction Words for the SLC 5/02 Processor

C–6

Instruction

Instruction Words (approx)

Instruction

Instruction Words (approx)

ADD AND

1.5 1.5

JMP JSR

1 1

BSL BSR

2 2

CLR COP CTD CTU

1 1.5 1 1

LBL LEQ LES LFL LFU LIM

0.5 1.5 1.5 1.5 1.5 1.5

DCD DDV DIV

1.5 1 1.5

EQU

1.5

FFL FFU FLL FRD

1.5 1.5 1.5 1

MCR MEQ MOV MSG MUL MVM

0.5 1.5 1.5 34.75 1.5 1.5

NEG NEQ NOT

1.5 1.5 1

GEQ GRT

1.5 1.5

OR OSR OTE OTL OTU

1.5 1 0.75 0.75 0.75

PID

23.25

HSC

1

IID IIE IIM INT IOM

1.25 1.25 1.5 0.5 1.5

Instruction

Instruction Words (approx)

REF RES RET RPI RTO

0.5 1 0.5 1.25 1

SBR SCL SQC SQL SQO SQR

0.5 1.75 2 2 2 1.25

STD STE STS SUB SUS SVC

0.5 0.5 1.25 1.5 1.5 0.5

TND TOD TOF TON

0.5 1 1 1

XIC XIO XOR

1 1 1.5

Page 461

Appendix C Memory Usage, Instruction Execution Times

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 C–6. 2. Multiply the total number of rungs by .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 rungs by .375 and enter the result. 4. Multiply the total number of data words (excluding the status file and I/O data words) by .25 and enter the result. 5. Add 1 word for each data table file used and enter the result.

C–7

Page 462

Appendix C Memory Usage, Instruction Execution Times

Instruction Execution Times for the SLC 5/02 Processor Series A or B

Instruction (Series A or B SLC 5/02)

C–8

Execution Time in Microseconds (approx.) False

True

Instruction (Series A or B SLC 5/02)

Execution Time in microseconds (approx.) False

True

MSG MUL MVM

80 12 12

300➁ 234 119

NEG NEQ➀ NOT

12 12 12

114 64 70

84 654 404

OR OSR OTE OTL OTU

12 12 18 19 19

91 34 18 19 19

12

64

PID

150

6000

FFL FFU

85 85

REF

6

FLL FRD

12 12

250 250 + 18 x position value 41 + 14 per word 227

GEQ➀ GRT➀

RES RET RPI RTO

12 12 12 12

400 + 300 per word 44 34 400 144

12 12

64 64

IID IIE IIM INT IOM

12 12 12 0 12

65 70 552 0 767

SBR SCL SQC SQL SQO SQR

2 12 12 60 12 12

6 800 229 225 229 270

JMP JSR

12 12

38 46

LBL LEQ➀ LES➀ LFL LFU LIM

2 12 12 85 85 12

6 64 64 250 300 75

STD STE STS SUB SUS SVC

6 6 12 12 12 6

15 15 120 129 12 400

MCR MEQ➀ MOV

10 12 12

10 79 24

TND TOD TOF TON

12 12 12 12

36 204 144 139

XIC➀ XIO➀ XOR

4 4 12

4 4 91

ADD AND

12 12

126 91

BSL BSR

12 12

148 + 24 per word 138 + 24 per word

CLR COP CTD CTU

12 12 12 12

44 49 + 21 per word 115 115

DCD DDV DIV

12 12 12

EQU➀

For the rung example below: 1) If instruction 1 is false, instructions 2, 3, 4, 5, 6, 7 take zero execution time. Execution time = 4 + 18 = 22 microseconds. 2) If instruction 1 is true, 2 is true, and 6 is true, then instructions 3, 4, 5, 7 take zero execution time. Execution time = 4 + 4 + 4 + 18 = 30 microseconds. 1

2 ][

8

6 ][

3

][

()

7 ][

][

4 ][ 5 ][

➀

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.

➁

This only includes the amount of time needed to “set up” the operation requested. It does not include the time it takes to service the actual communications.

Page 463

Appendix C Memory Usage, Instruction Execution Times

Instructions Having Indexed Addresses For each operand having an indexed address, add 50 microseconds to the execution time for a true instruction. For example, if a MOV instruction has an indexed address for both the source and destination, the execution time when the instruction is true is 24 + 50 + 50 = 124 microseconds.

Instructions Having M0 or M1 Data File Addresses For each bit or word instruction, add 1928 microseconds to the execution time. For each multiple-word instruction, add 1583 microseconds plus 667 microseconds per word. M0:2.1 ] [ 1

M1:3.1 ]/[ 1

M0:2.1 ( ) 10

MOV MOVE Source

M1:10.7

Dest

N7:10

Example COP COPY FILE Source #B3:0 Dest #M0:1.0 Length 34

For the multi–word instruction above, add 1583 microseconds plus 667 microseconds per word. In this example, 34 words are copied from #B3:0 to M0:1.0. Add 1583 + (667 x 34) = 24261 microseconds to the execution time listed on page C–8. This comes to 763 (calculated from page C–8 table) plus 24261 = 25024 microseconds total, or 25.0 milliseconds.

C–9

Page 464

Appendix C Memory Usage, Instruction Execution Times

Instruction Execution Times for the SLC 5/02 Processor Series C and Later The SLC 5/02 series C processor performance is on the average 40% faster than that of the SLC 5/02 series B processor. The table below lists the instruction execution times for the SLC 5/02 series C processor.

Instruction (Series C SLC 5/02)

Execution Time in Microseconds (approx.) False

True

Instruction (Series C SLC 5/02)

Execution Time in Microseconds (approx.) False

True

MSG MUL MVM

48 7 7

180➁ 140 71

NEG NEQ➀ NOT

7 38 7

68 38 42

50 392 242

OR OSR OTE OTL OTU

7 7 11 11 11

55 20 11 11 11

38

38

PID

90

3600

FFL FFU

51 51

REF

4

FLL FRD

7 7

150 150 + 11 x position value 25 + 8 per word 136

GEQ➀ GRT➀

RES RET RPI RTO

7 7 7 30

240 + 180 per word 26 20 240 86

38 38

38 38

IID IIE IIM INT IOM

7 7 7 0 7

39 42 340 0 465

SBR SCL SQC SQL SQO SQR

1 7 36 36 36 7

4 480 137 135 137 162

JMP JSR

7 7

23 28

LBL LEQ➀ LES➀ LFL LFU LIM

1 38 38 51 51 7

4 38 38 150 180 45

STD STE STS SUB SUS SVC

4 4 7 7 7 4

9 9 72 77 7 240

MCR MEQ➀ MOV

6 7 7

6 47 14

TND TOD TOF TON

7 7 36 36

22 122 86 83

XIC➀ XIO➀ XOR

2.4 2.4 7

2.4 2.4 55

ADD AND

7 7

76 55

BSL BSR

36 36

89 + 14 per word 83 + 14 per word

CLR COP CTD CTU

7 7 7 7

26 29 + 13 per word 69 69

DCD DDV DIV

7 7 7

EQU➀

C–10

For the rung example below: 1) If instruction 1 is false, instructions 2, 3, 4, 5, 6, 7 take zero execution time. Execution time = 2.4 + 11 = 13.4 microseconds. 2) If instruction 1 is true, 2 is true, and 6 is true, then instructions 3, 4, 5, 7 take zero execution time. Execution time = 2.4 + 2.4 + 2.4 + 11 = 18.2 microseconds. 1

2 ][

8

6 ][

3

][

()

7 ][

][

4 ][ 5 ][

➀

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.

➁

This only includes the amount of time needed to “set up” the operation requested. It does not include the time it takes to service the actual communications.

Page 465

Appendix C Memory Usage, Instruction Execution Times

Example: 1747-L524 series C 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 15 OTE instructions 5 TON instructions 3 GRT instructions 1 SCL instruction 1 TOD instruction 3 MOV instructions 10 CTU instructions 10 RES instructions Instruction Usage

50 x 1.00 = 50.00 15 x 0.75 = 11.25 5 x 1.00 = 5.00 3 x 1.50 = 4.50 1 x 1.75 = 1.75 1 x 1.00 = 1.00 3 x 1.50 = 4.50 10 x 1.00 = 10.00 10 x 1.00 = 10.00 98.00

30 rungs 30 x 0.375 = 11.25 100 data words 100 x 0.25 = 25.00 10 is highest data table file number 10 x 1 = 10.00 4 is highest program file number 4 x 2 = 8.00 User Program Total 163.50 49 I/O data words 30 slot Overhead I/O Configuration Total Estimated total memory usage:

49 x 0.75 = 36.75 30 x 0.75 = 22.50 204.00 263.25 426.75 (round to 427)

4096 – 427 = 3669 instruction words remaining in processor

C–11

Page 466

Appendix C Memory Usage, Instruction Execution Times

Instructions Having Indexed Addresses For each operand having an indexed address, add 30 microseconds to the execution time for a true instruction. For example, if a MOV instruction has an indexed address for both the source and destination, the execution time when the instruction is true is 14 + 30 + 30 = 74 microseconds.

Instructions Having M0 and M1 Data File Addresses For each bit or word instruction, add 1157 microseconds to the execution time. For each multiple-word instruction, add 950 microseconds plus 400 microseconds per word. M0:2.1 ] [ 1

M1:3.1 ]/[ 1

M0:2.1 ( ) 10

MOV MOVE Source

M1:10.7

Dest

N7:10

Example COP COPY FILE Source #B3:0 Dest #M0:1.0 Length 34

For the multi–word instruction above, add 950 microseconds plus 400 microseconds per word. In this example, 34 words are copied from #B:3.0 to M0:1.0. Add 950 + (400 x 34) = 14550 microseconds to the execution time listed on page C–10. This comes to 471 (calculated from page C–10 table) plus 14550 = 15021 microseconds total, or 15.0 milliseconds.

C–12