The text of a manual · part 11 of 55
Hand-Held Terminal (Catalog Number 1747-PT1) User Manual: 4 - Data File Organization and Addressing, pages 77 to 84
Pages 77 to 84 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 77
Chapter 4 Data File Organization and Addressing
M0 and M1 Data Files – Specialty I/O Modules
M0 and M1 files are data files that reside in specialty I/O modules only. There is no image for these files in the processor memory. The application of these files depends on the function of the particular specialty I/O module. For some modules, the M0 file is regarded as a module output file and the M1 file is regarded as a module input file. In any case, both M0 and M1 files are considered read/write files by the SLC 5/02 processor. M0 and M1 files can be addressed in your ladder program and they can also be acted upon by the specialty I/O module – independent of the processor scan. It is important that you keep the following in mind in creating and applying your ladder logic: Important: During the processor scan, M0 and M1 data can be changed by the processor according to ladder diagram instructions addressing the M0 and M1 files. During the same scan, the specialty I/O module can change M0 and M1 data, independent of the rung logic applied during the scan.
Addressing M0–M1 Files The addressing format for M0 and M1 files is below: Mf:e.s/b Where
M f e s b
= = = = = module file type (0 or 1) slot (1-30) word (0 to max. supplied by module) bit (0-15)
Restrictions on Using M0-M1 Data File Addresses M0 and M1 data file addresses can be used in all instructions except the OSR instruction and the instruction parameters noted below: Instruction
Parameter (uses file indicator #)
BSL, BSR
File (bit array)
SQO, SQC, SQL
File (sequencer file)
LFL, LFU
LIFO (stack)
FFL, FFU
FIFO (stack)
4–21
Page 78
Chapter 4 Data File Organization and Addressing
Monitoring Bit Instructions Having M0 or M1 Addresses When you monitor a ladder program in the Run or Test mode, the following bit instructions, addressed to an M0 or M1 file, are indicated as false regardless of their actual true/false logical state. Mf:e.s ] [ b
Mf:e.s ]/[ b
Mf:e.s ( ) b
Mf:e.s (L) b
Mf:e.s (U) b f = file (0 or 1) When you are monitoring the ladder program in the Run or Test mode, the HHT display does not show these instructions as being true when the processor evaluates them as true.
If you need to show the state of the M0 or M1 addressed bit, you can transfer the state to an internal processor bit. This is illustrated below, where an internal processor bit is used to indicate the true/false state of a rung. B3 ] [
EQU
B3 ] [ 0
1
EQUAL Source A
N7:12
Source B
N7:3
M0:3.0 ( ) 1
This rung will not show its true rungstate because the EQU instruction is always shown as true and the M0 instruction is always shown as false. B3 ] [
EQU
B3 ] [ 0
1
EQUAL Source A
N7:12
Source B
N7:3
B3 ( ) 2 M0:3.0 ( ) 1
OTE instruction B3/2 has been added to the rung. This instruction shows the true or false state of the rung.
4–22
Page 79
Chapter 4 Data File Organization and Addressing
Transferring Data Between Processor Files and M0 or M1 Files As pointed out earlier, the processor does not contain an image of the M0 or M1 file. As a result, you must edit and monitor M0 and M1 file data via instructions in your ladder program. For example, you can copy a block of data from a processor data file to an M0 or M1 data file or vice versa using the COP instruction in your ladder program. The COP instructions below copy data from a processor bit file and integer file to an M0 file. Suppose the data is configuration information affecting the operation of the specialty I/O module. S:1 ] [ 15 First scan bit. It makes this rung true only for the first scan after entering the Run mode.
COP COPY FILE Source Dest Length
#B3:0 #M0:1.0 16
COP COPY FILE Source #N7:0 Dest #M0:1.16 Length 27
The COP instruction below copies data from an M1 data file to an integer file. This technique is used to monitor the contents of an M0 or M1 data file indirectly, in a processor data file. COP COPY FILE Source Dest Length
#M1:4.3 #N10:0 6
4–23
Page 80
Chapter 4 Data File Organization and Addressing
Access Time During the program scan, the processor must access the specialty I/O card to read/write M0 or M1 data. This access time must be added to the execution time of each instruction referencing M0 or M1 data. The following table shows approximate access times per instruction or word of data for the SLC 5/02 processors. Access Time per Bit Instruction or Word of Data
Access Time per Multi–Word Instruction
SLC 5/02 Series B
1.93 ms
1.58 ms plus 0.67 ms per word
SLC 5/02 Series C
1.16 ms
0.95 ms plus 0.40 ms per word
Processor
M0:2.1 M0:2.1 M1:3.1 ( ) ] [ ]/[ 10 1 1 If you are using a Series B processor, add 1.93 ms to the program scan time for each bit instruction addressed to an M0 or M1 data file. If you are using a Series C processor, add 1.16 ms. COP COPY FILE Source Dest Length
#B3:0 #M0:1.0 34
If you are using a Series B processor, add 1.58 ms plus 0.67 ms per word of data addressed to the M0 or M1 file. This adds 24.36 ms to the scan time of the COP instruction. If you are using a Series C processor, add 0.95 ms plus 0.40 ms per word. This adds 14.55 ms to the scan time of the COP instruction.
4–24
Page 81
Chapter 4 Data File Organization and Addressing
Minimizing the Scan Time You can keep the processor scan time to a minimum by economizing on the use of instructions addressing the M0 or M1 files. For example, XIC instruction M0:2.1/1 is used in rungs 1 and 2 of figure 1 below, adding approximately 2 ms to the scan time if you are using a Series B processor. In the equivalent rungs of figure 2, XIC instruction M0:2.1/1 is used only in rung 1, reducing the scan time by approximately 1 ms. 1
M0:2.1 ] [ 1
2
B3 ] [ 12
B3 ( ) 10 B3 ( ) 14
M0:2.1 ] [ 1
Figure 1. XIC instructions in rungs 1 and 2 are addressed to the M0 data file. Each of these instructions adds approximately 1 ms to the scan time (Series B processor).
1
M0:2.1 ] [ 1
2
B3 ] [ 12
B3 ( ) 10 B3 ( ) 14
B3 ] [ 10
Figure 2. These rungs provide equivalent operation to those of figure A by substituting XIC instruction B3/10 for XIC instruction M0:2.1/1 in rung 2. Scan time is reduced by approximately 1 ms (Series B processor).
The following figure illustrates another economizing technique. The COP instruction addresses an M1 file, adding approximately 4.29 ms to the scan time if you are using a Series B processor. Scan time economy is realized by making this rung true only periodically, as determined by clock bit S:4/8 (clock bits are discussed in chapter 27). A rung such as this might be used when you want to monitor the contents of the M1 file, but monitoring need not be on a continuous basis.
S:4/8 causes the #M1:4.3 file to update the #N10:0 file every 2.56 seconds.
S:4 ] [ 8
B11 [OSR] 0
COP COPY FILE Source Dest Length
#M1:4.3 #N10:0 6
4–25
Page 82
Chapter 4 Data File Organization and Addressing
Capturing M0–M1 File Data The first and second figures in the last section illustrate a technique allowing you to capture and use M0 or M1 data as it exists at a particular time. In the first figure, bit M0:2.1/1 could change state between rungs 1 and 2. This could interfere with the logic applied in rung 2. The second figure avoids the problem. If rung 1 is true, bit B3/10 takes a snapshot of this condition, and remains true in rung 2, regardless of the state of bit M0:2.1/1 during this scan. In the second example of the last section, a COP instruction is used to monitor the contents of an M1 file. When the instruction goes true, the 6 words of data in file #M1:4.3 is captured as it exists at that time and placed in file #N10:0.
Specialty I/O Modules with Retentive Memory Certain specialty I/O modules retain the status of M0-M1 data after power is removed. See your specialty I/O module user’s manual. This means that an OTE instruction having an M0 or M1 address remains on if it is on when power is removed. A “hold-in” rung as shown below will not function as it would if the OTE instruction were non-retentive on power loss. If the rung is true at the time power is removed, the OTE instruction latches instead of dropping out; when power is again applied, the rung will be evaluated as true instead of false. B3 ] [ 0
M0:2.1 ( ) 1
M0:2.1 ] [ 1
!
ATTENTION: When used with a speciality I/O module having retentive outputs, this rung can cause unexpected start–up on powerup.
You can achieve non-retentive operation by unlatching the retentive output with the first pass bit at powerup: S:1 ] [ 15
M0:2.1 (U) 1
B3 ] [
M0:2.1 ( ) 1
0 M0:2.1 ] [ 1
4–26
This rung is true for the first scan after powerup to unlatch M0:2.1/1.
Page 83
Chapter 4 Data File Organization and Addressing
G Data Files – Specialty I/O Modules
Some specialty I/O modules use G (confiGuration) files (indicated in the specialty I/O module user’s manual). These files can be thought of as the software equivalent of DIP switches. The content of G files is accessed and edited offline under the I/O Configuration function. You cannot access G files under the Monitor File function. Data you enter into the G file is passed on to the specialty I/O module when you download the processor file and enter the Run or Test mode. The following figure illustrates the three G file data formats that you can select on the HHT. Word addresses begin with the file identifier G and the slot number you have assigned to the specialty I/O module. In this case, the slot number is 1. Four words have been created (addresses G1:0 through G1:3). Important: Word 0 of the G file is configured automatically by the processor according to the particular specialty I/O module. Word 0 is read only.
4–word G file, I/O slot 1, decimal format address G1:0 G1:1 G1:2 G1:3
DEC data xxxx 0 0 0
4–word G file, I/O slot 1, hex/bcd format address G1:0 G1:1 G1:2 G1:3
HEX/BCD data xxxx 0000 0000 0000
4–word G file, I/O slot 1, binary format address G1:0 G1:1 G1:2 G1:3
BIN
15 xxxx 0000 0000 0000 data xxxx xxxx 0000 0000 0000 0000 0000 0000
0 xxxx 0000 0000 0000
4–27
Page 84
Chapter 4 Data File Organization and Addressing
Editing G File Data Data in the G file must be edited according to your application and the requirements of the specialty I/O module. You edit the data offline under the I/O configuration function only. With the decimal and hex/bcd formats, you edit data at the word level: • G1:1 = 234 (decimal format) G1:1 = 00EA (hex/bcd format) • With the binary format, you edit data at the bit level: G1/19 = 1 Important: Word 0 of the G file is configured automatically by the processor according to the particular specialty I/O module. Word 0 cannot be edited.
4–28