Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 12 of 29

1772 Mini PLC-2/05 Processor (Cat. No. 1772-LS, LSP) Programming and Operations Manual, pages 111 to 120

Pages 111 to 120 of 289

The original document is the PDF (1.4 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 1772-LSP

Page 111

Chapter 11 Data Transfer File Instructions

Figure 11.1 Types of Counter Indexing externally indexed file instructions internally indexed file instructions

Word-to-File Move 200 Counter Addr: Position: 001 FIle Length: 007 Word Addr: 110 File R: 500- 506

200 DM 15

File-to-Word Move 200 Counter Addr: Position: 001 FIle Length: 007 File A: 400- 406 Word Addr: 110

200 DM 15

File-to-File Move 200 Counter Addr: Position: 001 FIle Length: 007 File A: 400- 406 File R: 500- 506 Rate Per Scan 007

200 EN 17 200 DM 15

Externally Indexed An externally indexed counter must be controlled by other rungs of your program. The counter address is used to identify the file instruction. The counter address holds the accumulated value. The accumulated value of the counter points to the file’s position value. The position value is the accumulated value and it represents the specific word location within the file. The preset value of the counter represents the length of the file. Another characteristic of the externally indexed file instruction is that it only has a done bit. This is bit 15. The done bit is automatically entered from the counter address. It is set when the operation is complete and remains set as long as the rung condition is true. Internally Indexed Internally indexed means that the counter is internally incremented by the instruction itself. No outside control is required. You assign an address to the counter. In Figure 11.1 notice that a value for rate per scan is needed. The rate per scan defines the number of words which are operated upon during one scan. For example, suppose you have a file that contains twelve words. If you assign the value of 004 for the rate per scan that means that the instruction executes four words per scan at a time. Therefore, the entire operation is completed in three consecutive scans.

11-2

Page 112

Chapter 11 Data Transfer File Instructions

An internally indexed file instruction has a done bit and an enable bit. The done bit is bit 15 and the enable bit is bit 17. These bits are automatically entered from the counter address. The enable bit is set when the rung logic goes from a false to true transition; the done bit is set when the file instruction is completed.

Modes of Operation

There are three modes of operation based on the rate per scan. They are: complete distributed complete incremental The following three sections describe each mode of operation. Complete Mode In the complete mode, the rate per scan is equal to the file length value and the entire file is operated upon in one scan. For example, if there are 12 words in your file and your rate per scan value is 12 then all 12 words are operated upon during one scan. For each false-to-true transition of the rung condition, the instruction is enabled, the accumulated value of the file counter is internally indexed from the first to the last word of the file. As the accumulated value points to each word, the operation defined by the file instruction is performed. After the instruction has operated on the last word, the done bit (bit 15) is. When the rung condition goes false, both the done and enable bits are reset and the counter resets to position 001. If the rung was enabled for only one scan, the done bit would come on during that scan and remain set for one additional scan. Distributed Complete Mode In the distributed complete mode, the rate per scan is less than the file length value and the entire file is operated over several program scans. For example, if there are twelve words in your file and your rate per scan value is three, then three words are operated upon during each scan. Therefore, it takes four consecutive scans to execute the entire file instruction operation.

11-3

Page 113

Chapter 11 Data Transfer File Instructions

For each true rung condition, the instruction is enabled. The number of words equal to the rate per scan is operated upon during one scan. The process is repeated over a number of consecutive scans until the entire file has been operated upon. Once the file instruction is enabled it remains enabled for the number of scans necessary to complete the operation. The rung could become repeatedly false and true during this time without interrupting the operation of the instruction. At the time of completion, if the rung is true, the enable bit (bit 17) and the done bit (bit 15) are both set. If the rung is false, the enable bit is reset after the last group of words is operated upon. At the same time, the done bit is set and stays set for one scan. During the next scan the done bit is reset, and the counter is reset to position 001. Incremental Mode In the incremental mode, the rate per scan is equal to 0. This means that upon each false-to-true transition one word is operated upon per scan, then the counter increments to the next position. When the rung is true the enable bit (bit 17) is set. After the last word in the file has been operated upon, the done bit (bit 15) is set. When the rung goes false, the done and enable bits are reset (after the last word has been operated upon), and the counter is reset to position 001. If the rung remains true for more than one scan, the operation does not repeat. The operation only occurs in the scan in which the false-to-true transition occurs. To change from one mode to another, use Table 11.A to determine the values. Table 11.A Changing Modes To change

11-4

Enter the Rate per Scan Value

Complete to Distributed Complete

001 thru 006

Distributed Complete to Incremental

000

Distributed Complete to Complete

007

Incremental to Complete

007

Page 114

Chapter 11 Data Transfer File Instructions

Data Monitor Display

Once you establish your file data, you’ll want to edit, load, or monitor your file data. To do these functions the processor has a data monitor mode. This mode lets you access your file in three ways; either by displaying binary, hexadecimal, or ASCII values (Figure 11.2) Figure 11.2 Data Monitor Display Header

Counter Addr: 200 File A: 400- 406

File Section

POSITION 001 002 003 004 005 006 007

Command Buffer

Header

Counter Addr: 200 File A: 400- 406

File Section

POSITION 001 002 003 004 005 006 007

Command Buffer

Header

Counter Addr: 200 File A: 400- 406

File Section

POSITION 001 002 003 004 005 006 007

Command Buffer

BINARY DATA MONITOR FILE TO FILE MOVE POSITION: 001 FILE A DATA 00010010 01010111 00000111 00100001 00001000 01111001 00000010 10000001 00011001 10000010 10010111 00010101 01010111 01100001 Data: 0010010

File Length: 007 File R: 500- 506

FILE R DATA 00010010 01010111 00000111 00100001 00001000 01111001 00000001 01100010 00011001 10000010 10010111 00010101 01010111 01100001 01010111

HEXADECIMAL DATA MONITOR FILE TO FILE MOVE POSITION: 001 FILE A DATA 1257 0721 0879 0281 1982 9715 5761 Data: 1257

ASCII DATA MONITOR FILE TO FILE MOVE POSITION: 001 FILE A DATA DC2 W ! BEL <Y BS STX 81 82 EM NAK 97 <A W Data: 1257

File Length: 007 File R: 500- 506

FILE R DATA 1257 0721 0879 0162 1982 9715 5761

File Length: 007 File R: 500- 506 FILE R DATA DC2 W ! BEL <Y BS SDH <B 82 EM NAK 97 <A W

11-5

Page 115

Chapter 11 Data Transfer File Instructions

The binary data monitor display lets you manipulate one word at a time by displaying each bit using binary digits. The hexadecimal monitor display lets you manipulate 4 digits which represents word values. The ASCII monitor display converts 4 digits to the ASCII code. The industrial terminal can automatically convert data from one number system to the other when the alternate display is selected. You can print this display directly from the CRT to a data terminal by following these steps: Table 11.B Monitor Functions Function

Key Sequence

Mode

Description

Display

[DISPLAY][0]

Any

Displays binary data monitor.

Print

[DISPLAY][0] [RECORD]

Any

Prints first 20 lines of binary data monitor.

Display

[DISPLAY][1]

Any

Displays hexadecimal data monitor.

Print

[DISPLAY][1] [RECORD]

Any

Prints first 20 lines of hexadecimal data monitor.

Display

[DISPLAY][2]

Any

Displays ASCII data monitor.

Print

[DISPLAY][2] [RECORD]

Any

Prints first 20 lines of ASCII data monitor.

Three sections divide the data monitor display. They are identified as (Figure 11.2): Header: located at the top of the screen and contains information pertaining to its corresponding file instruction. For example: counter, file, word addresses, and file length. File Section: located in the center of the screen and displays the data stored in a file. The column labeled POSITION refers to each word’s position in the file. FILE A DATA represents the original file, and FILE R DATA represents the new file. Command Buffer: located at the bottom center of the screen and is used to enter or change file data. It is always displayed in the program mode.

11-6

Page 116

Chapter 11 Data Transfer File Instructions

Use the following illustration as you read about each file instruction. Key Sequence

FILE 10

FILE 11

FILE 12

1770-T3 Display

Instruction Notes

File-To-File Move Counter Addr: 030 Position: 001 File Length: 001 File A: 110-110 File R: 110-110 Rate Per Scan: 001

030 EN 17

Output instruction.

030 DN 15

Counter is internally incremented by the instruction.

Word-To-File Move Counter Addr: 030 Position: 001 File Length: 001 Word Address: 010 110-110 File R:

030 DN 15

Output instruction.

File-To-Word Move Counter Addr: Position: File Length: File A: Word Address:

030 DN 15

030 001 001 110-110 010

Modes: Complete, distributed, and incremental.

Requires 5 words of user program.

Counter must be externally indexed by user program. Data is transferred every scan that rung is true. Requires 4 words of user program. Same as word-to-file.

IMPORTANT: Numbers shown are default values. Numbers in shaded areas must be replaced by user-entered values. The number of 0 default address digits initially displayed (3 or 4) will depend on the size of the data table.

Here is an explanation of each value: This Value:

Stores the:

Counter Address

Address of the instruction's file position in the accumulated value area of the data table

Position

Current word being operated upon (accumulated value of the counter)

File Length

Number of words in the file (preset value of the counter)

File A

Starting address of the source file

File R

Starting address of the destination file

Word Address

Address of the source word or destination word outside of the file

Rate Per Scan

Number of data words moved per scan

11-7

Page 117

Chapter 11 Data Transfer File Instructions

Before You Begin Put the processor in the program mode. You may have to expand your data table to provide additional space for files. To do this:

[SEARCH]

There is no change in the screen display.

50

DATA TABLE CONFIGURATION NUMBER OF 128-WORD D.T. BLOCKS NUMBER OF INPUT/OUTPUT RACKS NUMBER OF T/C (If applicable) DATA TABLE SIZE

01 2 40 128

The following chart will help you adjust the data table size of your processor. Enter

Data Table Size

01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23

128 256 384 512 640 768 896 1024 1152 1280 1408 1536 1664 1792 1920 2048 2176 2304 2432 2560 2688 2816 2944

After you adjust the data table, press [CANCEL COMMAND] and continue. Important: Other industrial terminal commands are summarized in appendix C. 11-8

Page 118

Chapter 11 Data Transfer File Instructions

File to File Move

Purpose: Duplicates and transfers the source file to the destination file address you identified. The source file remains intact. Programmed as an output instruction; requires five words of the user program area. The counter is incremented internally by the instruction. ATTENTION: The counter address for the file-to-file move instruction should be reserved for that instruction. Do not manipulate the counter accumulated or preset word. Changes to these values could result in unpredictable machine operation or a run-time error. Damage to equipment and/or injury to personnel could occur. When the rung becomes: True - The data is transferred from the source file to your designated file at the specified rate per scan. False - no action is taken. Keystrokes: You enter a file to file move by performing the following steps.

[FILE] 10

The screen does not change. File-To-File Move 030 Counter Addr: Position: 001 File Length: 001 File A: 110-110 File R: 110-110 Rate Per Scan: 001

030 EN 17 030 DN 15

Parameters: Notice that the cursor is now on the first digit of the counter address. Also, the display shows all default values.

11-9

Page 119

Chapter 11 Data Transfer File Instructions

Insert the following values. The cursor moves automatically through the file instruction. The values are: COUNTER ADDR - 200 POSITION - 001 FILE LENGTH - 007 FILE A - 400 FILE R - 500 RATE PER SCAN - 007

200

File-To-File Move Counter Addr: 200 Position: 001 File Length: 001 File A: 110-110 File R: 110-110 Rate Per Scan: 001

030 EN 17 030 DN 15

Now the cursor is on the first digit of the file length.

007

File-To-File Move Counter Addr: 200 Position: 001 File Length: 007 File A: 110- 116 File R: 110-110 Rate Per Scan: 007

030 EN 17 030 DN 15

The cursor moved to the first digit of file A.

400

11-10

File-To-File Move Counter Addr: 200 Position: 001 File Length: 007 File A: 400- 406 110- 116 File R: Rate Per Scan: 007

030 EN 17 030 DN 15

Page 120

Chapter 11 Data Transfer File Instructions

The cursor moved to the first digit of file R.

500

File-To-File Move Counter Addr: 200 Position: 001 File Length: 007 File A: 400- 406 File R: 500- 506 Rate Per Scan: 0 07

030 EN 17 030 DN 15

Finally, the cursor is on the first digit of the rate per scan.

007

File-To-File Move Counter Addr: 200 Position: 001 File Length: 007 File A: 400- 406 File R: 500- 506 Rate Per Scan: 007

030 EN 17 030 DN 15

You can now proceed to add data to your file. Position your cursor on the words file to file move. Use the arrow keys to move your cursor. File-To-File Move Counter Addr: 200 Position: 001 File Length: 007 File A: 400- 406 File R: 500- 506 Rate Per Scan: 007

030 EN 17 030 DN 15

11-11