SlideShare a Scribd company logo
EMEC245
Industrial Control Systems II
Advanced PLC’s and PAC’s
Indirect and Indexed Addresses (SLC500 and
LogixPro)
Includes arrays (ControlLogix)
Chapter 09
3
Valid Addressing Modes
 There are four basic modes or types of
addressing in the SLC500 series PLC’s
 Direct
 Indexed direct
 Indirect
 Indexed indirect
4
Direct Addressing
 Data is stored in the specified address.
 This mode is what we have been using for
all of our work in the course.
 Examples:
 N7:3
 T4:9.PRE
 R6:3.POS
 F8:7
 B3:6/2
 C5:8.ACC
Memory Address Data Value
N7:0 52
N7:1 128
N7:2 346
N7:3 510
N7:4 14
5
Indirect Addressing
 The address in the instruction serves as a
reference point and does not point directly
to the data location. In other words: the
instructions memory address contains the
address of a memory location.
Memory
Address
Data
Values
2210 52
2211 128
2212 345
2213 510
2214 343
Memory
Address
Data
Values
343 54
344 71
345 633
346 85
347 500
Address = 2212 Data = 633
6
Indirect Addressing
 An address can be specified as indirect by
replacing the file number, element number
or sub-element number with another word
address.
 The indirect address is always enclosed in
square brackets [ ].
 N7:[N7:0] is an example of an indirect
address.
 The word level address in the square brackets
is queried for a value. The queried value then
becomes the file, element or sub-element
portion of the indirect address.
7
Indirect Address
Examples
 N7:[N7:0]
 If a value of 43 is stored in N7:0, the indirect
address N7:[N7:0] is indirectly referencing
N7:43
 B3:[T4:0.ACC]
 If the value of 12 is stored in the accumulator
of T4:0, the indirect address B3:[T4:0.ACC] is
indirectly referencing B3:12
 F[N7:3]:[N26:12]
 If a value of 18 is stored in N7:3 and a value
of 4 is stored in N26:12, the indirect address
F[N7:3]:[N26:12] is indirectly referencing
F18:4
8
 Guidelines for specifying indirect
addresses:
 The
 file number
 word number (element + sub-element)
 bit number
can be addressed indirectly
 The substitute address must be a word-
level address.
 Enter the substitute address in square
brackets [ ].
Indirect Addressing
9
 The table shows some additional examples
of indirect addressing:
Indirect Addressing
Valid Address Variable Explanation
N7:[C5:7.ACC] Word number The word number of N7 is
being specified by the value
stored in the accumulator of
C5:7
B3:0/[R6:4.POS] Bit number The bit number of B3:0 is
being specified by the value
stored in the position word of
R6:4
N[N7:0]:[N22:1] File and word
number
The file number is stored in
N7:0 and the word number is
stored in N22:1
I:[N10:0].1/1 Slot number The slot number is stored in
N10:0
10
Indirect Addressing
When using indirect addressing, the data file
(memory location) being referenced must
exist. Data files (memory) is not
dynamically created or expanded. In other
words, the memory is not dynamically
allocated to fit the size of the data.
IMPORTANT
11
Indirect Addressing
 Indirect addressing allows for the
 creation of less complex ladder logic
 preservation of memory
 use of an array like structure
 Indirect addressing can be used for
applications such as cycling through a
recipe file in a multiple batch operation.
12
 Example application of Indirect
Addressing:
 Data collection is an application for indirect
addressing such as, keeping a record of
temperature at prescribed times and over a
given period of time.
 Using recipes in systems that require different
parameters depending upon the product being
produced.
Discuss the LogixPro Batch Process Recipe
Example
Indirect Example
13
 An indexed address is an addressing mode
for referencing a memory location that is
the original memory address plus a value
that is stored in an index register.
 The content of the index register is added
to the original address to obtain the final
memory location (offset).
 Indexed addressing is useful for accessing
elements of an array of data. The base
address stays the same, but the value of
the index register is incremented.
Indexed Addressing
14
 The table shows an example of an indexed
address:
Indexed Addressing
Memory
Address
Data
Value
N7:33 52
N7:34 578
N7:35 79
N7:36 427
N7:37 56
N7:38 4
N7:39 131
Base address = N7:22
Index or Offset = 15
Data = 56
N7:22 → (Word 22 + 15) = N7:37
15
 An address is specified as being “indexed”
by placing the “#” character in front of the
address.
 When the program encounters an address
of this form, the processor takes the
element (word) number of the address
and adds to it the value stored in the
index register.
 The index register is in the
SLC500/LogixPro Processor Status file at:
S:24
Indexed Addressing
16
 The actual address is the Base address
plus the value stored in the index register.
 Example:
 #N7:10
 Here, the element (word) number of the direct
address (the base address) is 10.
 If S:24 has a value of 25 stored in it, the value of 25
is added to the base address element number; in this
case 10.
 The address that #N7:10 with S:24 = 25 is
referencing is N7:35.
 N7:10 + S:24 or N7:10 + 25 = N7:35
Indexed Addressing
17
 When the processor resolves an Indexed
Indirect address it first resolves the
indirect portion of the address and then
adds the offset from the index register
S:24 to create the final address.
 What makes the addressing mode
powerful is that S:24 is a dynamic
address. It can be read and written to on-
the-fly.
Indexed Indirect
Addressing
18
 An address can be specified as a
combination of indirect and indexed
addressing.
 Example:
 #N7:[N10:3]
 If a value of 20 is stored in N10:3 and a value of 10
is stored in S:24, then the indexed indirect address
#N7:[N10:3] is referencing N7:30
 That is, N7:[N10:3] is indirectly referencing N7:20
and #N7:[N10:3] is indexed by 10 producing
N7:20 + 10 = N7:30
Indexed Indirect
Addressing
LogixPro does not support this mode of addressing
19
 Guidelines for specifying indexed
addresses:
 The offset value stored in S:24 can be positive
or negative.
 The offset value should not cause the base
address to cross a file boundary.
 If an instruction uses more than one indexed
address, the processor uses the same index
value on each of the indexed addresses.
 The value of the index register should be set
immediately before enabling the instruction
that uses an indexed address.
Indexed Indirect
Addressing
20
 Guidelines for specifying indexed
addresses:
 Indexed addressing does not work with
Timers, Counters or the Control File.
 Indexed addressing is invalid for any file type
that used multiple words.
 Some instructions modify the value of the
index register so that they can function
properly. The Sequencer and the Bit Shift
instructions, talked about later in this course,
is an example of instructions that use and
modify the value of S:24.
Indexed Indirect
Addressing
Monitoring Indexed
Addresses
 The value of the
indexed address
will not display
when it is being
monitored.
 The code snippet
shown assumes
that:
 S:24 = 5
 N7:3 = 123
 N7:8 = 456
When the MOV instruction is executed
the indexed address #N7:3 is evaluated
to N7:8 and the value of the indexed
address will be stored and displayed in
the direct address of N10:3. Also note in
the ADD instruction that the value stored
in the indexed address is added to the
zero of C5:0.ACC.
Arrays
ControlLogix
23
 The ControlLogix processors do not use
indexed or indirect addressing. The
ControlLogix processors use arrays.
 Arrays – An array is a tag that holds multiple
values of the same data type.
 Your textbook defines an array as: “a data
structure that allocates a contiguous block of
memory to store a specific data type as a table
of values.
ControlLogix Arrays
24
 Arrays are specified as having dimensions.
They can be:
 1-dimensional
 2-dimensional
 3-dimensional
ControlLogix Arrays
ControlLogix Arrays
ControlLogix Arrays
Tag Name Data Type
Dimension
0
Dimension
1
Dimension
2
Total # of
Elements
one_d_array DINT[7] 7 0 0 7
two_d_array DINT[4,5] 4 5 0 20
three_d_array DINT[2,3,4] 2 3 4 24
Creating an Array
Enter a tag name
Click this button
to open the
Select Data Type
Dialog box
Creating and Array
Select the data
type, then
enter the
number of
elements for
each
dimension.
Use Dim0 for a
1-dimensional
array, Dim0
and Dim1 for a
2-dimensional
array and
Dim0, Dim1
and Dim2 for a
3-dimensional
array.
Creating an Array
This Select Data
Type dialog box
shows a DINT
data type
configured as a
3-dimensional
array. Note how
the array
elements are
designated in
the Data Types:
box.
ControlLogix Arrays
   
 
396,2
396,25
5
5




esultRMOVAfter
Array
ArrayterPoinArray
terPoin
Menu Application
 This example copies 1-of-4 user
selected recipes to the batch
parameters of a batch process.
 The COP instruction shown will copy
the content of 4-words from a two-
dimensional array referenced in the
source, to a one-dimensional array in
the destination. (The COP will be
discussed in the next unit).
 The source tag is referencing a two-
dimensional array:
Recipe[RecipeNumber, 0]. Note that
the first dimension of the array is a
tag. This tag stores the value of the
recipe number selected by a user and
is used to point to 1-of-4 of the
recipes.
 If the user selects recipe number 2, the
data stored in Recipe[2,0],
Recipe[2,1], Recipe[2,2] and
Recipe[2,3] will be copied to:
BatchRecipe[0] through BatchRecipe[3]
respectively.
0
1
2
3

More Related Content

DOCX
6 mini circuitos minamplificadores y regulador de tencion
PPTX
Maquinas sincronas
PDF
8051 serial communication
PPTX
Motor dc
PPTX
Principios básicos de la reversibilidad de los motores de C/C
DOCX
Introduction to 8085 & it's description(includes basic lab experiments)
PPT
Logical instruction of 8085
6 mini circuitos minamplificadores y regulador de tencion
Maquinas sincronas
8051 serial communication
Motor dc
Principios básicos de la reversibilidad de los motores de C/C
Introduction to 8085 & it's description(includes basic lab experiments)
Logical instruction of 8085

What's hot (18)

PDF
Report on visiting 132/33 kv substation teliarganj allahabad
PPTX
Introduction to microprocessor
PPTX
Internal architecture-of-8086
PPTX
Hysterisis Motor
PPT
Instruction set-of-8085
PDF
Still electric fork truck forklift r20 16 series service repair manual
PPT
Diodo de potencia
PPT
Elektropneumatik 120201022644-phpapp01
PPTX
Pemasangan(penghawa dingin)
PPTX
Litar pengguna
PDF
BAB 1 pengenalan SISTEM HIDRAULIK .pdf
DOCX
Interfacing of data converters & io devices
PPTX
Synchronous motor drive
PPT
10 8086 instruction set
PDF
Sesion multiplexores y demultiplexores
PPTX
8086 Architecture.pptx
PPTX
timing_diagram_of_8085.pptx
PDF
Power Electronics Chopper (dc – dc converter)
Report on visiting 132/33 kv substation teliarganj allahabad
Introduction to microprocessor
Internal architecture-of-8086
Hysterisis Motor
Instruction set-of-8085
Still electric fork truck forklift r20 16 series service repair manual
Diodo de potencia
Elektropneumatik 120201022644-phpapp01
Pemasangan(penghawa dingin)
Litar pengguna
BAB 1 pengenalan SISTEM HIDRAULIK .pdf
Interfacing of data converters & io devices
Synchronous motor drive
10 8086 instruction set
Sesion multiplexores y demultiplexores
8086 Architecture.pptx
timing_diagram_of_8085.pptx
Power Electronics Chopper (dc – dc converter)
Ad

Similar to 01 indirect indexed_addressing_and_arrays_sp15 (20)

PPTX
01 control logix_arrays_sp17
PPT
Lecture 06
PPT
Computer organization and Architecture-UDOM
PPT
Advanced computer architect lesson 3 and 4
DOCX
PPTX
module 3 instruction set and control unit
PPTX
Addressing Modes
PPTX
micro chapter 3jjgffffyeyhhuyerfftfgggffgjj
PPTX
addressing modes of microcontrooller 8051
PDF
Program execution, straight line sequence and branching
PPTX
ITEC582-Chapter 13-CO-UNIT-1-IMPORT.pptx
PPTX
ITEC582-Chapter 13-usefull-Computer.pptx
DOCX
Addressing modes Breifly
PPTX
8051 Addressing modes
PPT
Addressing modes
PPT
Computer Organization and Architecture2.ppt
PPTX
Addressing Modes.pptx
PPT
microprocessor and microcontroller notes ppt
PPTX
ADDRESSING MODE
PPTX
Unit-1_Processor_Basic Cpu_Organization.pptx
01 control logix_arrays_sp17
Lecture 06
Computer organization and Architecture-UDOM
Advanced computer architect lesson 3 and 4
module 3 instruction set and control unit
Addressing Modes
micro chapter 3jjgffffyeyhhuyerfftfgggffgjj
addressing modes of microcontrooller 8051
Program execution, straight line sequence and branching
ITEC582-Chapter 13-CO-UNIT-1-IMPORT.pptx
ITEC582-Chapter 13-usefull-Computer.pptx
Addressing modes Breifly
8051 Addressing modes
Addressing modes
Computer Organization and Architecture2.ppt
Addressing Modes.pptx
microprocessor and microcontroller notes ppt
ADDRESSING MODE
Unit-1_Processor_Basic Cpu_Organization.pptx
Ad

More from John Todora (20)

PPTX
04 scaling analog_datal_sp17
PPTX
03 analog control_sp17
PPTX
Comparison instructions, AB, Siemens and AB CCW
PPTX
Lab02 review
PPTX
Subroutines rev01 fa16
PPTX
Move mask moves_rev01_fa16
PPTX
Math cl ccw_siemens_rev01_fa16
PPTX
ControlLogix Counters FA16
PPTX
Lab02 lead in
PPTX
ControlLogix Timers FA16
PPTX
02 chapter02 fa16
PPTX
01 introduction to_plc-pac_rev01_fa16
PPTX
07 chapter07 loop_diagrams
PPTX
06 chapter06 binary_logic_systems_Rev02
PPTX
04 chapter04 specification_forms
PPTX
03 chapter03 lists_indexes_databases
PPTX
02 chapter02 p&ids_and_symbols_split_animations
PPTX
01 chapter01 process_flow_diagram
PPTX
00 introduction
PPTX
EMEC130 P&ID Symbol Primer
04 scaling analog_datal_sp17
03 analog control_sp17
Comparison instructions, AB, Siemens and AB CCW
Lab02 review
Subroutines rev01 fa16
Move mask moves_rev01_fa16
Math cl ccw_siemens_rev01_fa16
ControlLogix Counters FA16
Lab02 lead in
ControlLogix Timers FA16
02 chapter02 fa16
01 introduction to_plc-pac_rev01_fa16
07 chapter07 loop_diagrams
06 chapter06 binary_logic_systems_Rev02
04 chapter04 specification_forms
03 chapter03 lists_indexes_databases
02 chapter02 p&ids_and_symbols_split_animations
01 chapter01 process_flow_diagram
00 introduction
EMEC130 P&ID Symbol Primer

Recently uploaded (20)

PDF
Computing-Curriculum for Schools in Ghana
PDF
Yogi Goddess Pres Conference Studio Updates
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Lesson notes of climatology university.
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Complications of Minimal Access Surgery at WLH
PDF
Classroom Observation Tools for Teachers
PPTX
Cell Structure & Organelles in detailed.
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Anesthesia in Laparoscopic Surgery in India
Computing-Curriculum for Schools in Ghana
Yogi Goddess Pres Conference Studio Updates
Pharmacology of Heart Failure /Pharmacotherapy of CHF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Lesson notes of climatology university.
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
O7-L3 Supply Chain Operations - ICLT Program
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Complications of Minimal Access Surgery at WLH
Classroom Observation Tools for Teachers
Cell Structure & Organelles in detailed.
Abdominal Access Techniques with Prof. Dr. R K Mishra
A systematic review of self-coping strategies used by university students to ...
2.FourierTransform-ShortQuestionswithAnswers.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
VCE English Exam - Section C Student Revision Booklet
Anesthesia in Laparoscopic Surgery in India

01 indirect indexed_addressing_and_arrays_sp15

  • 1. EMEC245 Industrial Control Systems II Advanced PLC’s and PAC’s
  • 2. Indirect and Indexed Addresses (SLC500 and LogixPro) Includes arrays (ControlLogix) Chapter 09
  • 3. 3 Valid Addressing Modes  There are four basic modes or types of addressing in the SLC500 series PLC’s  Direct  Indexed direct  Indirect  Indexed indirect
  • 4. 4 Direct Addressing  Data is stored in the specified address.  This mode is what we have been using for all of our work in the course.  Examples:  N7:3  T4:9.PRE  R6:3.POS  F8:7  B3:6/2  C5:8.ACC Memory Address Data Value N7:0 52 N7:1 128 N7:2 346 N7:3 510 N7:4 14
  • 5. 5 Indirect Addressing  The address in the instruction serves as a reference point and does not point directly to the data location. In other words: the instructions memory address contains the address of a memory location. Memory Address Data Values 2210 52 2211 128 2212 345 2213 510 2214 343 Memory Address Data Values 343 54 344 71 345 633 346 85 347 500 Address = 2212 Data = 633
  • 6. 6 Indirect Addressing  An address can be specified as indirect by replacing the file number, element number or sub-element number with another word address.  The indirect address is always enclosed in square brackets [ ].  N7:[N7:0] is an example of an indirect address.  The word level address in the square brackets is queried for a value. The queried value then becomes the file, element or sub-element portion of the indirect address.
  • 7. 7 Indirect Address Examples  N7:[N7:0]  If a value of 43 is stored in N7:0, the indirect address N7:[N7:0] is indirectly referencing N7:43  B3:[T4:0.ACC]  If the value of 12 is stored in the accumulator of T4:0, the indirect address B3:[T4:0.ACC] is indirectly referencing B3:12  F[N7:3]:[N26:12]  If a value of 18 is stored in N7:3 and a value of 4 is stored in N26:12, the indirect address F[N7:3]:[N26:12] is indirectly referencing F18:4
  • 8. 8  Guidelines for specifying indirect addresses:  The  file number  word number (element + sub-element)  bit number can be addressed indirectly  The substitute address must be a word- level address.  Enter the substitute address in square brackets [ ]. Indirect Addressing
  • 9. 9  The table shows some additional examples of indirect addressing: Indirect Addressing Valid Address Variable Explanation N7:[C5:7.ACC] Word number The word number of N7 is being specified by the value stored in the accumulator of C5:7 B3:0/[R6:4.POS] Bit number The bit number of B3:0 is being specified by the value stored in the position word of R6:4 N[N7:0]:[N22:1] File and word number The file number is stored in N7:0 and the word number is stored in N22:1 I:[N10:0].1/1 Slot number The slot number is stored in N10:0
  • 10. 10 Indirect Addressing When using indirect addressing, the data file (memory location) being referenced must exist. Data files (memory) is not dynamically created or expanded. In other words, the memory is not dynamically allocated to fit the size of the data. IMPORTANT
  • 11. 11 Indirect Addressing  Indirect addressing allows for the  creation of less complex ladder logic  preservation of memory  use of an array like structure  Indirect addressing can be used for applications such as cycling through a recipe file in a multiple batch operation.
  • 12. 12  Example application of Indirect Addressing:  Data collection is an application for indirect addressing such as, keeping a record of temperature at prescribed times and over a given period of time.  Using recipes in systems that require different parameters depending upon the product being produced. Discuss the LogixPro Batch Process Recipe Example Indirect Example
  • 13. 13  An indexed address is an addressing mode for referencing a memory location that is the original memory address plus a value that is stored in an index register.  The content of the index register is added to the original address to obtain the final memory location (offset).  Indexed addressing is useful for accessing elements of an array of data. The base address stays the same, but the value of the index register is incremented. Indexed Addressing
  • 14. 14  The table shows an example of an indexed address: Indexed Addressing Memory Address Data Value N7:33 52 N7:34 578 N7:35 79 N7:36 427 N7:37 56 N7:38 4 N7:39 131 Base address = N7:22 Index or Offset = 15 Data = 56 N7:22 → (Word 22 + 15) = N7:37
  • 15. 15  An address is specified as being “indexed” by placing the “#” character in front of the address.  When the program encounters an address of this form, the processor takes the element (word) number of the address and adds to it the value stored in the index register.  The index register is in the SLC500/LogixPro Processor Status file at: S:24 Indexed Addressing
  • 16. 16  The actual address is the Base address plus the value stored in the index register.  Example:  #N7:10  Here, the element (word) number of the direct address (the base address) is 10.  If S:24 has a value of 25 stored in it, the value of 25 is added to the base address element number; in this case 10.  The address that #N7:10 with S:24 = 25 is referencing is N7:35.  N7:10 + S:24 or N7:10 + 25 = N7:35 Indexed Addressing
  • 17. 17  When the processor resolves an Indexed Indirect address it first resolves the indirect portion of the address and then adds the offset from the index register S:24 to create the final address.  What makes the addressing mode powerful is that S:24 is a dynamic address. It can be read and written to on- the-fly. Indexed Indirect Addressing
  • 18. 18  An address can be specified as a combination of indirect and indexed addressing.  Example:  #N7:[N10:3]  If a value of 20 is stored in N10:3 and a value of 10 is stored in S:24, then the indexed indirect address #N7:[N10:3] is referencing N7:30  That is, N7:[N10:3] is indirectly referencing N7:20 and #N7:[N10:3] is indexed by 10 producing N7:20 + 10 = N7:30 Indexed Indirect Addressing LogixPro does not support this mode of addressing
  • 19. 19  Guidelines for specifying indexed addresses:  The offset value stored in S:24 can be positive or negative.  The offset value should not cause the base address to cross a file boundary.  If an instruction uses more than one indexed address, the processor uses the same index value on each of the indexed addresses.  The value of the index register should be set immediately before enabling the instruction that uses an indexed address. Indexed Indirect Addressing
  • 20. 20  Guidelines for specifying indexed addresses:  Indexed addressing does not work with Timers, Counters or the Control File.  Indexed addressing is invalid for any file type that used multiple words.  Some instructions modify the value of the index register so that they can function properly. The Sequencer and the Bit Shift instructions, talked about later in this course, is an example of instructions that use and modify the value of S:24. Indexed Indirect Addressing
  • 21. Monitoring Indexed Addresses  The value of the indexed address will not display when it is being monitored.  The code snippet shown assumes that:  S:24 = 5  N7:3 = 123  N7:8 = 456 When the MOV instruction is executed the indexed address #N7:3 is evaluated to N7:8 and the value of the indexed address will be stored and displayed in the direct address of N10:3. Also note in the ADD instruction that the value stored in the indexed address is added to the zero of C5:0.ACC.
  • 23. 23  The ControlLogix processors do not use indexed or indirect addressing. The ControlLogix processors use arrays.  Arrays – An array is a tag that holds multiple values of the same data type.  Your textbook defines an array as: “a data structure that allocates a contiguous block of memory to store a specific data type as a table of values. ControlLogix Arrays
  • 24. 24  Arrays are specified as having dimensions. They can be:  1-dimensional  2-dimensional  3-dimensional ControlLogix Arrays
  • 26. ControlLogix Arrays Tag Name Data Type Dimension 0 Dimension 1 Dimension 2 Total # of Elements one_d_array DINT[7] 7 0 0 7 two_d_array DINT[4,5] 4 5 0 20 three_d_array DINT[2,3,4] 2 3 4 24
  • 27. Creating an Array Enter a tag name Click this button to open the Select Data Type Dialog box
  • 28. Creating and Array Select the data type, then enter the number of elements for each dimension. Use Dim0 for a 1-dimensional array, Dim0 and Dim1 for a 2-dimensional array and Dim0, Dim1 and Dim2 for a 3-dimensional array.
  • 29. Creating an Array This Select Data Type dialog box shows a DINT data type configured as a 3-dimensional array. Note how the array elements are designated in the Data Types: box.
  • 30. ControlLogix Arrays       396,2 396,25 5 5     esultRMOVAfter Array ArrayterPoinArray terPoin
  • 31. Menu Application  This example copies 1-of-4 user selected recipes to the batch parameters of a batch process.  The COP instruction shown will copy the content of 4-words from a two- dimensional array referenced in the source, to a one-dimensional array in the destination. (The COP will be discussed in the next unit).  The source tag is referencing a two- dimensional array: Recipe[RecipeNumber, 0]. Note that the first dimension of the array is a tag. This tag stores the value of the recipe number selected by a user and is used to point to 1-of-4 of the recipes.  If the user selects recipe number 2, the data stored in Recipe[2,0], Recipe[2,1], Recipe[2,2] and Recipe[2,3] will be copied to: BatchRecipe[0] through BatchRecipe[3] respectively. 0 1 2 3