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

The text of a manual · part 36 of 59

Mini-PLC-2/02, 2/16, 2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual: 19 - Data Transfer Instructions, pages 293 to 301

Pages 293 to 301 of 490, from Mini-PLC-2/02, 2/16, 2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual

The original document is the PDF (2.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-LW /LWD, Allen-Bradley 1772-LWP, Allen-Bradley 1772-LX / LXP and Allen-Bradley 1772-LZP

Page 293

Chapter

19

Data Transfer File Instructions

Chapter Objectives

This chapter describes the data transfer file instructions: File-to-File Move Word-to-File Move File-to-Word Move Figure 19.1 Types of File Instructions

Key Sequence

1770-T3 Display

FILE 10

FILE-TO-FILE MOVE COUNTER ADDR: 030 001 POSITION: 001 FILE LENGTH: 110- 110 FILE A: 110- 110 FILE R: RATE PER SCAN: 001

030 EN 17

WORD-TO-FILE MOVE COUNTER ADDR: 030 001 POSITION: 001 FILE LENGTH: 110 FILE A: 110- 110 FILE R:

030 DN 15

FILE-TO-WORD MOVE COUNTER ADDR: 030 001 POSITION: 001 FILE LENGTH: 110- 110 FILE A: WORD ADDRESS: 010

030 DN 15

FILE 11

FILE 12

Instruction Notes

030 DN 15

Output Instruction Modes Complete, Distributed, and Incremental Counter is internally incremented by the instruction. Requires 5 words of user program. Output Instruction 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

A file is a group of consecutive data table words used to store information. A file can be between 1 and 999 words in length. The address of word 1 defines the address of the file. When displayed, the words of a file are designated consecutively by positions 001-999 according to the length of the file.

19-1

Page 294

Chapter 19 Data Transfer File Instruction

The word address defines: the location in the data table to which or from which the data will be moved. this word address can be manipulated by ladder diagram logic

File-to-File Move Instruction

This instruction copies a source file and transfers it to the destination file address. It is programmed as an output instruction and requires 5 words of the user program area. The source file remains intact. The counter is incremented internally by the instruction. Internally Indexed Counter An internally indexed counter is incremented by the instruction itself. No outside control is required. You assign an address to the counter. An internally indexed file instruction has a done bit (15) and an enable bit (17). These two 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. When you look at Figure 19.2, notice that a value for rate per scan is needed. The rate per scan defines the number of words that are operated upon during one scan and is determined by the mode of operation.

19-2

Page 295

Chapter 19 Data Transfer File Instuction

Figure 19.2 Types of Counter Indexing 200 CTU PR 007 AC 000 WORD TO FILE MOVE COUNTER ADDR: 200 001 POSITION: Externally indexed file instruction

FILE LENGTH:

007

WORD ADDR: FILE R:

110 500-506

200 EN 15

201 CTU PR 007 AC 000 201 FILE TO WORD MOVE DN COUNTER ADDR: 201 15 POSITION: 001 Externally indexed file instruction

Internally indexed file instruction

FILE LENGTH: FILE R: WORD ADDR:

007 400-406 110

FILE TO FILE MOVE COUNTER ADDR: 202 001 POSITION: 007 FILE LENGTH: FILE A: 400-406 FILE R: 500-506 RATE PER SCAN: 007

202 EN 17

202 DN 15

Complete Mode of Operation 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 each false-to-true transition of the rung condition, the instruction is enabled and 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 set.

19-3

Page 296

Chapter 19 Data Transfer File Instruction

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 of Operation In the distributed complete mode, the rate per scan is less than the file length value and the entire file is transferred over several program scans. 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 will be completed in three consecutive scans. 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 transferred. Once the file instruction is enabled it remains enabled for the number of scans necessary to complete the operation, regardless of the rung condition. 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 of Operation 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.

19-4

Page 297

Chapter 19 Data Transfer File Instuction

Table 19.A Modes of Operation Mode of Operation

R = Rate Per Scan

Number of Words Operated Upon

Complete

R = File Length

Entire file per scan

Distributed complete

0<R< File Length

R words per scan

Incremental

R=0

One word per rung transition

ATTENTION: The counter address for the File-to-File Move instruction should be reserved for that instruction only. Do not manipulate the counter accumulated or preset word. Changes to these values could result in unexpected machine operation with damage to equipment and/or injury to personnel.

When the rung becomes: True False

The data is transferred from the source file to the destination file at the specified rate per scan. No action is taken.

Here is an explanation of each value: This Value:

Stores This:

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 file (preset value of the counter).

File A

Starting address of the source file.

File R

Starting address of the destination file.

19-5

Page 298

Chapter 19 Data Transfer File Instruction

Keystrokes Enter a File-to-File Move instruction by performing the following steps.

BLOCK XFER 0

SEARCH

592

FILE

Block Transfer 0 appears in the lower left corner of the screen, above the processor’s current programming mode.

The word SEARCH appears in the lower left corner of the Industrial Terminal Screen. Puts the processor in the remote mode.

The word FILE appears in the lower left corner of the Industrial Terminal Screen. FILE TO FILE MOVE COUNTER ADDR: 030 POSITION: 001 FILE LENGTH: 001 FILE A: 110- 110 FILE R: 110- 110 RATE PER SCAN: 001

10

030 EN 17 030 DN 15

Notice that the cursor is now on the first digit of the counter address. Also, the display shows all default values. You must expand the data table to insert the following values. Follow the procedure in chapter 7. Then, your cursor will move automatically through the File-To-File Move instruction. The instructions values are: COUNTER ADDR 200 POSITION 001 FILE LENGTH 007 FILE A 400 FILE R 500 RATE PER SCAN 007

19-6

Page 299

Chapter 19 Data Transfer File Instuction

200

FILE TO FILE MOVE COUNTER ADDR: 030 POSITION: 001 FILE LENGTH: 001 FILE A: 110- 110 FILE R: 110- 110 RATE PER SCAN: 001

200 EN 17 200 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: 001 FILE A: 110- 116 FILE R: 110- 116 RATE PER SCAN: 007

200 EN 17 200 DN 15

The cursor moved to the first digit of file A.

400

FILE TO FILE MOVE COUNTER ADDR: 200 POSITION: 001 FILE LENGTH: 007 FILE A: 400- 406 FILE R: 110- 116 RATE PER SCAN: 007

200 EN 17 200 DN 15

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: 007

200 EN 17 200 DN 15

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

19-7

Page 300

Chapter 19 Data Transfer File Instruction

FILE TO FILE MOVE COUNTER ADDR: 200 POSITION: 001 FILE LENGTH: 007 FILE A: 400- 406 FILE R: 500- 506 RATE PER SCAN: 007

007

200 EN 17 200 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. For this example, we will use the hexadecimal data monitor display. The screen does not change.

COUNTER ADDR: 200 FILE A: 400-406

1

POSITION 001 002 003 004 005 006 007

HEXDECIMAL DATA MONITOR FILE TO FILE MOVE POSITION: 001 FILE LENGTH: 007 FILE R: 500- 506 FILE A DATA 0000 0000 0000 0000 0000 0000 0000

FILE R DATA 0000 0000 0000 0000 0000 0000 0000

DATA: 0000

We will now enter data in position 001 of file A.

COUNTER ADDR: 200 FILE A: 400-406

1257

POSITION 001 002 003 004 005 006 007

HEXDECIMAL DATA MONITOR FILE TO FILE MOVE POSITION: 001 FILE LENGTH: 007 FILE R: 500- 506 FILE A DATA 0000 0000 0000 0000 0000 0000 0000 DATA: 1257

This enters data into the command buffer.

19-8

FILE R DATA 0000 0000 0000 0000 0000 0000 0000

Page 301

Chapter 19 Data Transfer File Instuction

Important: If you made a mistake, you can correct it by moving the cursor left or right to the incorrect number and then pressing the correct number key.

COUNTER ADDR: 200 FILE A: 400-406 INSERT

POSITION 001 002 003 004 005 006 007

HEXDECIMAL DATA MONITOR FILE TO FILE MOVE POSITION: 001 FILE LENGTH: 007 FILE R: 500- 506 FILE A DATA 1257 0000 0000 0000 0000 0000 0000

FILE R DATA 0000 0000 0000 0000 0000 0000 0000

DATA: 1257

This information (1257) now appears in position 001 of file A. The command buffer at the bottom of the screen still displays 1257. ↓↓

Cursor down one line. We will now add information to position 002.

0721

COUNTER ADDR: 200 FILE A: 400-406 POSITION 001 002 003 004 005 006 007

HEXDECIMAL DATA MONITOR FILE TO FILE MOVE POSITION: 001 FILE LENGTH: 007 FILE R: 500- 506 FILE A DATA 1257 0000 0000 0000 0000 0000 0000

FILE R DATA 0000 0000 0000 0000 0000 0000 0000

DATA: 0721

COUNTER ADDR: 200 FILE A: 400-406 INSERT

POSITION 001 002 003 004 005 006 007

HEXDECIMAL DATA MONITOR FILE TO FILE MOVE POSITION: 001 FILE LENGTH: 007 FILE R: 500- 506 FILE A DATA 1257 0721 0000 0000 0000 0000 0000

FILE R DATA 0000 0000 0000 0000 0000 0000 0000

DATA: 0721

19-9