Page 362 - Programmable Logic Controllers, Fifth Edition - Mobile version
P. 362
of an array must be of the same data type (e.g., BOOL,
Data Type - INT[5]
SINT, or INT). An array occupies a contiguous block of Array - Temp
controller memory. Arrays are similar to tables of val- Temp[0] 297
ues. The use of arrayed data types offers the fastest data Temp[1] 200
throughput (output) from a ControlLogix processor. Be- Temp[2] 180
cause arrays are numerically sequenced tags of the same Temp[3] 120
data type that occupy a contiguous memory location, Temp[4] 100
large amounts of data can be retrieved efficiently. Arrays
can be built using 1, 2 or 3 dimensions, as illustrated in Figure 15-25 Memory layout for a one-dimensional array.
Figure 15-24, to represent the data they are intended to
contain.
A single tag within the array is one element. The ele- layout for a 1-dimensional (one column of values)
ment may be a basic data type or a structure. The ele- array created to hold five temperatures. The tag name
ments start with 0 and extend to the number of elements is Temp and the array consists of 5 elements numbered
minus 1. Figure 15-25 is an example of the memory 0 through 4.
Memory and Project Organization Part 1 343
pet73842_ch15_333-394.indd 343 03/11/15 7:33 PM