Page 231 - Programmable Logic Controllers, Fifth Edition - Mobile version
P. 231
Word File File File File Word
Word-to-file move File-to-file move File-to-word move
Figure 10-8 Moving data using file instructions.
Integer Table
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word File
N7:30 N7:30/ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #N7:30
N7:31/ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Length = 8
N7:32/ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
N7:33/ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
N7:34/ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
N7:35/ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
N7:36/ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
N7:37/ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 N7:37
Radix: Binary Table: N7: Integer
Figure 10-9 SLC 500 word and file address.
comparison, or conversion of data. Most PLC manufac- The basic operation of the FAL instruction is similar
turers display file instructions in block format on the pro- in all functions and requires the following parameters and
gramming terminal screen. Figure 10-9 compares the SLC PLC-5 addresses to be entered in the instruction:
500 controller word and file addressing. The addressing
formats can be summarized as follows: Control
• The address that defines the beginning of a file or • Is the first entry and the address of the control struc-
group of words starts with the pound sign #. ture in the control area (R) of processor memory.
• The # prefix is omitted in a single word or element • The processor uses this information to run the
address. instruction.
• Address N7:30 is a word address that represents a • The default file for the control file is data file 6.
single word: word number 30 in integer file 7. • The control element for the FAL instruction must be
• Address #N7:30 represents the starting address of unique for that instruction and may not be used to
a group of consecutive words in integer file 7. The control any other instruction.
length is eight words, which is determined by the • The control element is made up of three words.
instruction where the file address is used. • The control word uses four control bits: bit 15
The file arithmetic and logic (FAL) instruction is (enable bit), bit 13 (done bit), bit 11 (error bit), and
used to copy data from one file to another and to do file bit 10 (unload bit).
math and file logic. This instruction is available on Allen- • For ControlLogix the control address would be a tag
Bradley PLC-5 and ControlLogix platforms. An example such as control_1 with a data type of control.
of the FAL instruction is shown in Figure 10-10.
Length
FAL • Is the second entry and represents the file length.
File Arith/Logical • This entry will be in words, except for the floating-
EN
Control point file, for which the length is in elements. (A
Length DN floating-point element consists of two words.)
Position
Mode • The maximum length possible is 1000 elements.
Destination ER Enter any decimal number from 1 to 1000.
Expression
• For ControlLogix the number would be a double
Figure 10-10 File Arithmetic/Logical (FAL) instruction. integer (DINT).
212 Chapter 10 Data Manipulation Instructions
pet73842_ch10_207-233.indd 212 03/11/15 4:02 PM