The text of a manual · part 9 of 55
Hand-Held Terminal (Catalog Number 1747-PT1) User Manual: 4 - Data File Organization and Addressing, pages 57 to 66
Pages 57 to 66 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 57
Chapter
4
Data File Organization and Addressing This chapter discusses the following topics: • data file organization and addressing • indexed addressing (SLC 5/02 processors) • file instructions (using the file indicator #) • creating and deleting data • program constants • M0-M1 files, G files (SLC 5/02 processors with specialty I/O modules)
Data File Organization
Data files contain the status information associated with external I/O and all other instructions you use in your main and subroutine ladder program files. In addition, these files store information concerning processor operation. You can also use the files to store “recipes” and lookup tables if needed.
Data Files residing in the processor memory 0
Output image
1
Input image
2
Status
3
Bit
4
Timer
5
Counter
6
Control
Data Files associated with Specialty I/O modules (SLC 5/02 processors) M0 and M1 files These data files reside in the memory of the specialty I/O module. Their function depends on the particular specialty I/O module. In most cases, you can address these files in your ladder program.
7
Integer
8
Reserved
9
See Note below
These data files are the software equivalent of DIP switches.
Bit, Timer, Counter, Control, or Integer, assigned as needed
G files are accessed and edited offline under the I/O Configuration function. The information is passed on to the specialty I/O module when you enter the Run or Test mode.
10–255
G files
Note: Data file 9 can be used for network transfer on the DH-485 network. Non-SLC 500 devices are able to read and write to this file. Data file 9 can be used as an ordinary data file if the processor is not on a network. Designate this file as Integer or Bit when using the network transfer function. This file is also called “Common Interface File 485CIF” or “PLC–2 compatibility file.”
4–1
Page 58
Chapter 4 Data File Organization and Addressing
Data File Types For the purposes of addressing, each data file type is identified by a letter (identifier) and a file number. File numbers 0 through 7 are the default files, created for you. If you need additional storage, you can create files by specifying the appropriate identifier and a file number from 9 to 255. This applies to Bit, Timer, Counter, Control, and Integer files only. Refer to the tables below: Data file types, identifiers, and numbers File Type Output Input Status Bit Timer Counter Control Integer
Addressing Data Files
Identifier O I S B T C R N
File Number
User–Defined Files
0 1 2 3 4 5 6 7
File Type
Identifier
File Number
Bit Timer Counter Control Integer
B T C R N
9–255
Data files contain elements. As shown below, some data files have 1-word elements, some have 3-word elements. You will be addressing elements, words, and bits. Output and Input files have 1-word elements, with each element specified by slot and word number: 15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
Element O:1.0 O:1.1 O:1.2
Elements in Timer, Counter, and Control files consist of 3 words: 15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
Word 0 1 2
Status, Bit, and Integer files have 1-word elements: 15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
Addresses are made up of alpha-numeric characters separated by delimiters. Delimiters include the colon, slash, and period.
4–2
Page 59
Chapter 4 Data File Organization and Addressing
Typical element, word, and bit addresses are shown below: File Type
File Number Element
File Number
File Type
N7:15
Element
File Type
Word
T4:7.ACC
Element Delimiter
An element address
Element Bit
B3:64/15
Word Delimiter
Element Delimiter
File Number
Element Delimiter
A word address
Bit Delimiter
A bit address
The address format varies, depending on the file type. This is explained in the following sections, beginning with file 2, the status file, and following with files 0, 1, 3, 4, 5, 6, and 7.
Data File 2 – Status The status file is explained in chapter 27. You can address various bits and words as follows: Format
S:e/b
Explanation S
Status file
:
Element delimiter e
Element number
/
Bit delimiter b
Bit number
Ranges from 0 to 15 in a SLC 5/01 or fixed controller, 0-32 in a SLC 5/02. These are 1-word elements. 16 bits per element.
Bit location within the element. Ranges from 0 to 15.
Examples: S:1/15
Element 1, bit 15. This is the “first pass” bit, which you can use to initialize instructions in your program.
S:3
Element 3. The lower byte of this element is the current scan time. The upper byte is the watchdog scan time.
4–3
Page 60
Chapter 4 Data File Organization and Addressing
Data Files 0 and 1 – Outputs and Inputs Bits in file 0 are used to represent external outputs. Bits in file 1 are used to represent external inputs. In most cases, a single 16-bit word in these files will correspond to a slot location in your controller, with bit numbers corresponding to input or output terminal numbers. Unused bits of the word are not available for use. I/O Addressing for a Controller with Fixed I/O: In the figure below, a fixed I/O controller has 24 inputs and 16 outputs. An expansion rack has been added. Slot 1 of the rack contains a module having 6 inputs and 6 outputs. Slot 2 contains a module having 8 outputs. The figure shows how these outputs and inputs are arranged in data files 0 and 1. For these files, the element size is always 1 word. The table on the following page explains the addressing format for outputs and inputs. Note that the format specifies e as the slot number and s as the word number. When you are dealing with file instructions, refer to the element as e.s (slot and word), taken together. Slot
Inputs Outputs
0 1 2
24 6 None
Slot Numbers 0
1
2
I/O
I/O
I/O
16 6 8
Data File 0 – Output Image 15 14 13 12 11 10
9
8
7
6
5
Slot 1 outputs (0–5)
Expansion rack
3
2
1
0
X
Slot 0 outputs (0–15)
Fixed I/O Controller
4
O:0
INVALID
Slot 2 outputs (0–7)
O:1 X
INVALID
O:2
Data File 1 – Input Image 15 14 13 12 11 10 Slot 0 inputs (0–15) Slot 0 inputs (16–23)
8
7
6
5
4
3
2
X
1
0 I:0
INVALID
Slot 1 inputs (0–5)
INVALID
X
4–4
9
X
I:0.1 X
See Addressing “Examples,” next page.
I:1
Page 61
Chapter 4 Data File Organization and Addressing
Assign I/O addresses to fixed I/O controllers as shown in the table below: Format
Explanation O
Output
I
Input
:
Element delimiter Slot number (decimal)
e fixed I/O controller: 0 left slot of expansion rack: 1 right slot of expansion rack: 2
O:e.s/b .
Word delimiter. Required only if a word number is necessary as noted below.
s
Word number
/
Bit delimiter b
Terminal number
I:e.s/b
Required if the number of inputs or outputs exceeds 16 for the slot. Range: 0 – 255 (range accommodates multi-word “specialty cards”)
Inputs: 0 to 15 Outputs: 0 to 15
Examples (applicable to the controller shown on page 4-4): O:0/4 O:2/7 I:1/4 I:0/15 I:0.1/7
Controller output 4 (slot 0) Output 7, slot 2 of the expansion rack Input 4, slot 1 of the expansion rack Controller input 15 (slot 0) Controller input 23 (bit 07, word 1 of slot 0)
Word addresses: O:1 I:0 I:0.1
Output word 0, slot 1 Input word 0, slot 0 Input word 1, slot 0
Default Values: Your programming device will display an address more formally. For example, when you assign the address I:1/4, the HHT shows it as I1:1.0/4 (Input file, file #, slot 1, word 0, terminal 4).
4–5
Page 62
Chapter 4 Data File Organization and Addressing
I/O Addressing for a Modular Controller: With modular controllers, slot number 0 is reserved for the processor module (CPU). Slot 0 is invalid as an I/O slot. The figure below shows a modular controller configuration consisting of a 7-slot rack interconnected with a 10-slot rack. Slot 0 contains the CPU. Slots 1 through 10 contain I/O modules. The remaining slots are saved for future I/O expansion. The figure indicates the number of inputs and outputs in each slot and also shows how these inputs and outputs are arranged in the data files. For these files, the element size is always 1 word. Slot Numbers
0
1
2
3
4
5
6
Power CPU Supply
7
8
9
10
I/O
I/O
I/O
I/O
Power Supply I/O
I/O
I/O
I/O
I/O
I/O
Future Expansion
Modular controller using a 7–slot rack interconnected with a 10–slot rack. Data File 0 – Output Image 15 14 13 12 11 10
Slot
Inputs Outputs
Slot 1 outputs (0–5)
1 2 3 4 5 6 7 8 9 10
6 32 None 8 None 16 16 8 None None
Slot 3 outputs (0–15)
6 None 16 8 32 None None None 16 16
Slot 4 outputs (0–7)
9
8
7
6
5
4
3
2
0
INVALID
O:1
X
O:3 INVALID
O:4 X
Slot 5, word 0 outputs (0–15) Slot 5, word 1 outputs (0–15) Slot 9 outputs (0–15) Slot 10 outputs (0–15)
O:5 O:5.1 O:9
X
O:10
Data File 1 – Input Image 15 14 13 12 11 10 Slot 1 inputs (0–5)
9
8
7
6
5
4
3
2
INVALID
INVALID
I:2.1 I:4
Slot 6 inputs (0–15)
I:6 X
Slot 7 inputs (0–15) Slot 8 inputs (0–7)
0
I:2 X
Slot 2, word 1 inputs (0–15) Slot 4 inputs (0–7)
1
I:1
Slot 2, word 0 inputs (0–15)
INVALID
See Addressing “Examples,” next page.
4–6
1
I:7 I:8
Page 63
Chapter 4 Data File Organization and Addressing
The table below explains the addressing format for outputs and inputs. Note that the format specifies e as the slot number and s as the word number. When you are dealing with file instructions, refer to the element as e.s (slot and word), taken together. Format
Explanation O
Output
I
Input
:
Element delimiter
O:e.s/b e
Slot number (decimal)
I:e.s/b
.
Word delimiter. Required only if a word number is necessary as noted below.
s
Word number
/
Bit delimiter b
Terminal number
Modular Processor: Slot 0, adjacent to the power supply in the first rack, applies to the processor module (CPU). Succeeding slots are I/O slots, numbered from 1 to a maximum of 30.
Required if the number of inputs or outputs exceeds 16 for the slot. Range: 0 – 31
Inputs: 0 to 15 Outputs: 0 to 15
Examples (applicable to the controller shown on page 4-6): O:3/15 O:5/0 O:10/11 I:2.1/3 I:7/8
Output 15, slot 3 Output 0, slot 5 Output 11, slot 10 Input 3, slot 2, word 1 Input 8, slot 7
Word addresses: O:5 O:5.1 I:8
Output word 0, slot 5 Output word 1, slot 5 Input word 0, slot 8
Default Values: Your programming device will display an address more formally. For example, when you assign the address O:5/0, the HHT shows it as O0:5.0/0 (Output file, file #, slot 5, word 0, terminal 0).
4–7
Page 64
Chapter 4 Data File Organization and Addressing
Data File 3 – Bit File 3 is the bit file, used primarily for bit (relay logic) instructions, shift registers, and sequencers. The maximum size of the file is 256 1-word elements, a total of 4096 bits. You can address bits by specifying the element number (0 to 255) and the bit number (0 to 15) within the element. You can also address bits by numbering them in sequence, 0 to 4095. You can also address elements of this file. 15 14 13 12 11 10
9
8
7
6
5
4
3
2
1
0
Element B3:0 B3:1
Bit 14, Element 3 Address B3:3/14.
B3:2 B3:3
Can also be expressed as bit 62. Address B3/62.
Bit 0, Element 252 Address B3:252/0. Can also be expressed as bit 4032. Address B3/4032.
B3:252 B3:253 B3:254 B3:255
Format
Bf:e/b
Bf/b
Explanation B
Bit type file f
File number. Number 3 is the default file. A file number between 10 – 255 can be used if additional storage is required.
:
Element delimiter e
Element number
/
Bit delimiter b
Bit number
B f /
Same as above. Same as above. Same as above.
b
Bit number
Examples
B3:3/14 Bit 14, element 3
Ranges from 0 to 255. These are 1-word elements. 16 bits per element.
B3:252/0 Bit 0, element 252
Bit location within the element. Ranges from 0 to 15.
B3:9 Bits 0–15, element 9
Numerical position of the bit within the file. Ranges from 0 to 4095.
B3/62 Bit 62 B3/4032 Bit 4032
Your programming device may display addresses slightly different than what you entered on the HHT. The HHT and APS always display the Bf/b format in XIO, XIC, and OTE instructions.
4–8
Page 65
Chapter 4 Data File Organization and Addressing
Data File 4 – Timers Timers are 3-word elements. Word 0 is the control word, word 1 stores the preset value, and word 2 stores the accumulated value. This is illustrated below: Timer Element 15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
Word
Internal Use
EN TT DN
0
Preset Value PRE
1
Accumulated Value ACC
2
Addressable Bits
Addressable Words
EN = Bit 15 Enable TT = Bit 14 Timer Timing DN = Bit 13 Done
PRE = Preset Value ACC = Accumulated Value
Bits labeled “Internal Use” are not addressable. Assign timer addresses as follows: Format
Explanation
Tf:e
Example:
T4:0
T
Timer f
File number. Number 4 is the default file. A file number between 10 – 255 can be used if additional storage is required.
:
Element delimiter e
Element number
Ranges from 0 to 255. These are 3-word elements. See figure above.
Element 0, timer file 4.
Address bits and words by using the format Tf:e.s/b where Tf:e is explained above, and: . is the word delimiter s indicates subelement / is the bit delimiter b indicates bit T4:0/15 T4:0/14 T4:0/13
Enable bit Timer timing bit Done bit
T4:0.1 or T4:0.PRE T4:0.2 or T4:0.ACC T4:0.1/0 T4:0.2/0
Preset value of the timer Accumulated value of the timer
Bit 0 of the preset value Bit 0 of the accumulated value
4–9
Page 66
Chapter 4 Data File Organization and Addressing
Data File 5 – Counters Counters are 3-word elements. Word 0 is the control word, word 1 stores the preset value, and word 2 stores the accumulated value. This is illustrated below:
Counter Element 15 14 13 12 11 10 9 CU CD DN OV UN UA
8
7 6
5
4
3 2
1
Internal Use
0
Addressable Bits
Word
CU = Count up enable PRE = Preset CD = Count down enable ACC = Accum DN = Done bit OV = Overflow bit UN = Underflow bit UA = Update accum. value (HSC in fixed controller only)
0
Preset Value PRE
1
Accumulated Value ACC
2
Addressable Words
Bits labeled “Internal Use” are not addressable. Assign counter addresses as follows: Format
Cf:e
Example:
Explanation C
Counter f
File number. Number 5 is the default file. A file number between 10 – 255 can be used if additional storage is required.
:
Element delimiter e
Element number
C5:0
Ranges from 0 to 255. These are 3-word elements. See figure above.
Element 0, counter file 5.
Address bits and words by using the format Cf:e.s/b where Cf:e is explained above, and; . is the word delimiter s indicates subelement / is the bit delimiter b indicates bit C5:0/15 C5:0/14 C5:0/13 C5:0/12 C5:0/11 C5:0/10 C5:0.1 C5:0.2 C5:0.1/0 C5:0.2/0
4–10
Count up enable bit Count down enable bit Done bit Overflow bit Underflow bit Update accum. bit (HSC in fixed controller only) or or
C5:0.PRE Preset value of the counter C5:0.ACC Accumulated value of the counter Bit 0 of the preset value Bit 0 of the accumulated value