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

The text of a manual · part 11 of 14

Mini-PLC-2 Programmable Controller Programming and Operations Manual, pages 101 to 110

Pages 101 to 110 of 132

The original document is the PDF (13 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-LN2 and Allen-Bradley 1772-LN3

Page 101 read from a scan by OCR; it may hold reading errors

Page 10-13

The Data Table must be configured to the size which will match the Data Table of the taped program. Set the Data Table size as described is Section 9.1 Data Table Adjustment. If the size of the Data Table on tape is not immediately available and the Processor is configured differently, the load operation will abort automatically. The Industrial Terminal will display the Data Table configuration contained on the tape along with a prompt to configure the Processor Data Table.

The number of Use Program and Data Table words are counted and displayed while mem- ory content is loaded and again during verification. After verification, a message displays the number of discrepencies found, if any. Instructions in memory that don’t match cor- responding instructions on the data cartridge tape can be located and displayed using the procedure described in paragraph 10.4.5, Displaying and Locating Errors. The discre- pencies can be corrected if a hard copy printout of the program is. available showing the correct instructions. Otherwise erase the entire memory (put the cursor on the first instruction and press [CLEAR MEMORY] [9][9]) and repeat the memory loading procedure.

This command can be aborted at any time by pressing [CANCEL COMMAND].

10.5.3 Data Cartridge Verification

This command is used to verify User Program and messages in Processor memory with the content in data cartridge tape, or vice versa. Although the Data Table size and configura- tion are checked, the Data Table content is not verified.

With the Processor in any mode, verification can be done by pressing the keys [RECORD] [SHIFT] [C] on the Industrial Terminal Key- board. The number of User Program and Data Table words are counted and displayed while tape content and memory content are being compared. When verification is complete, the number of discrepencies, if any, is displayed. If discrepancies are found, either the tape can be re-recorded using the Dumping Memory procedure in paragraph 10.5.1, or the Pro- cessor memory can be corrected using the procedure in paragraph 10.4.5.

The verification process can be aborted at any time by pressing [CANCEL COMMAND].

10.6 LADDER DIAGRAM DUMP

Accessible in any mode, the Ladder Diagram Dump command is used to print out a hard copy of the User Program using a peripheral printer that is connected to Channel C.

After setting the baud rate for the printer, this command is accessed by pressing the keys [SEARCH][4][4] on the PLC-2 Overlay. The printout will begin from the current rung, allowing all or part of the program to be printed.

When the printout is complete, this command is automatically terminated. This command can be terminated before completion by pressing [ESC] on the peripheral device or [CANCEL COMMAND] on the PLC-2 Overlay.

10.7 TOTAL MEMORY DUMP

The Total Memory Dump command is ac- cessible in the PROGRAM mode only. It is used to print out a hard copy of the Data Table, User Program and Messages using a peripheral printer connected to Channel C.

After setting the baud rate for the printer, this command is accessed by pressing the keys [SEARCH][4][5] on the PLC-2 Overlay and will print out the complete memory, regard- less of cursor position (1770-T3, only).

The Data Table will be printed in hexadecimal. The bit pattern for each Data Table word will be as shown in Figure 10-8. In each row, the 4-digit octal word address is the address where the left-most hex value is stored. For example, the hex values ECCB16 and 024C16 are stored in word addresses 0020, and 0025,, respectively. For more information on the hexadecimal numbering system, refer to Sec- tion 13, Numbering Systems.

The Data Table printout will be followed by the User Program in ladder diagram and block format. The messages will be printed out and identified by number.

Page 102 read from a scan by OCR; it may hold reading errors

Page 10-14

DATA TABLE

DATA

0010 | 26C1 A4FF 952B 0020 }ECCB 9A00 4721

0177 | 2EC4 6F6D ABCD

” ” ” ”

FO73. D572 43CE 002F 5101 024C

” ” ”

1C2D 4FGC D10D

” ”

300F

FIGURE 10-8, Data Table Printout in Hexadecimal

When the printout is complete, this command is automatically terminated. The Total Mem- ory Dump Command can be terminated prior to completion by pressing [ESC] on the peri- pheral printer or [CANCEL COMMAND] on the PLC-2 Overlay.

Page 103 read from a scan by OCR; it may hold reading errors

Page 11-1

Section 11 SPECIAL PROGRAMMING TECHNIQUES

11.0 GENERAL

There are several programming techniques that offer versatile contro! of the process or machine operation. They include:

¢ Scan Counter ¢ Block Transfer (1772-LN3 Processor Module) ® One-Shot

¢ Programming 0.01-Second Timers

11.1 SCAN COUNTER

The scan counter is a programming technique that can be used where timing may be an important consideration. For example, it can be used in diagnostics to compute and com- pare average scan times of an operation with predicted scan times, and to detect if repeated requests for an operation are being ignored due to a malfunction.

The scan counter is programmed using two rungs as shown in Figure 11-1. The first rung contains optional condition instructions anda CTU instruction whose Preset value equals the number of scans to be counted. The second rung is started with a BRANCH END instruction to open the rung and is ended with the same CTU instruction.

When the first rung goes TRUE, bit 17 of the CTU instruction is set to 1 and the CTU instruction Accumulated value will increment one count. The second rung will never go TRUE because it is an open rung. It is used to reset the CTU instruction Enable bit (bit 17) to zero so the CTU instruction can increment its count during the next scan. The CTU instruc- tion will continue to increment past the Preset value unless it is reset by a CTR instruction.

11.2 BLOCK TRANSFER (1772-LN3. Processor Module)

Block Transfer can be performed with the 1772-LN3 Processor and any Bulletin 1771 1/O Module with Block Transfer capability.

11.2.1 Introduction

Block Transfer is a programming technique used to transfer up to 64 16-bit words of data in one scan from !/O modules to the Data Table and vice versa. It is used with intelligent 1771 |1/O modules such as the Analog, Thermocouple, or Encoder/Counter modules which have this capability. Block Transfer can be compared with single transfer programming in which only one word of data is transferred per scan.

Block Transfer can be performed as a Read, Write or Bidirectional operation, depending on the I/O Module being used. An input module uses the Block Transfer Read opera- tion, an output module uses the Block Transfer Write operation and a Bidirectional module can use either or both the Read and Write Operations. During a Read operation, data is read into the Processor’s memory from the

050

Ho CONDITION(S) (OPTIONAL)

BRANCH, - __p-s 9, {CTU) PR 040 AC 000

050

END INSTRUCTION, (CTU}- PR 040 AC 000

FIGURE 11-1, Scan Counter

Page 104 read from a scan by OCR; it may hold reading errors

Page 11-2 input module. During a Write operation, data is written to the output module from the Procesor’s memory.

The number of words transferred in one scan can range from 1 to 64, depending on the I/O module being used. The time required to perform Block Transfer depends on the num- ber of words being transferred.

The Processor uses two I/O Image Table bytes to communicate with Block Transfer modules. The byte corresponding to the module’s address in the Output Image Table (Control byte) contains the Read or Write bit for initiating the transfer of data. The byte corresponding to the module’s address in the Input Image Table (Status byte) is used to signal the completion of the transfer.

Whether the upper or lower byte of the I/O Image Table word is used depends on the position of the module in the Module Group. When in the lower slot, the lower byte is used and vice versa. See Figure 11-2. For double slot modules, the slot number must always be entered as a “O” because the overlapping of module groups is not permitted.

When Block Transfer is requested in the ladder diagram program, the output part of the next I/O scan is interrupted (Figure 11-3). If the I/O module is ready for Block Transfer, the transfer will be performed. When the transfer of data is complete, the Read bit (or Write bit) is set in the corresponding Input Image Table byte. The processor then con- tinues its normal scan.

The I/O module may not be ready for Block Transfer 100% of the time. For ashorttime, the I/O module must perform internal checks on its own operation. If Block Transfer is re- quested when the I/O module is not ready, the Read or Write bit in the corresponding Input Image Table byte (done bit) is held at zero. The Processor will then continue with its normal I/O scan.

A Block Transfer read or write operation is requested by only one rung of program. A bidirectional Block Transfer is requested by two program rungs. Other support rungs, described later, may be necessary to support the Block Transfer operation. Of these sup- port rungs, buffering data must be pro- grammed to ensure validity of Block Transfer data.

DATA TABLE

< - - - - BIT NUMBERS >} Z 10,07 00 i] OUTPUT IMAGE TABLE

UPPER "7 012 CONTROL BYTE GH th, a Fa of

OUTPUT IMAGE TABLE WORD,, 010 i 017 on ro

110 q

INPUT IMAGE TABLE WORD,

T INPUT IMAGE TABLE

UPPER BYTE ZI STATUS BYTE WHI

Bo I

! 117 oo

1/0 RACK

BLOCK TRANSFER MODULE

MODULE POSITION - IMAGE TABLE BYTE RELATIONSHIP

LOWER UPPER SLOT SLOT

THE UPPER BYTE OF THE I/O IMAGE TABLE WORDS ARE USED WHEN THE MODULE IS IN THE UPPER SLOT AND VICE VERSA.

FIGURE 11-2, Module Position/Image Table Byte Relationship

Page 105 read from a scan by OCR; it may hold reading errors

Page 11-3

BLOCK TRANSFER REQUEST

OUTPUT INPUT SCAN

PROGRAM SCAN

FIGURE 11-3, Block Transfer Request

11.2.2 Block Transfer Rungs

The Block Transfer rung must be programmed in acertain format (Figure 11-4). It consists of condition instructions that are optional, two GET instructions and an OUTPUT ENERGIZE instruction.

FIRST GET INSTRUCTION

The first GET instruction (Figure 11-4) is used to identify the rack location of the block transfer module. The location must be stored in the first available address in the timer/ counter Accumulated value area of the Data Table, starting with 030,. When more than one Block Transfer module is used, consecutive addresses must be assigned in this area.

As its “data,” the first GET instruction stores the location of the Block Transfer module by R=Rack, G=Module Group and S=Slot num- ber. When Block Transfer is performed, the Processor searches the timer/counter Accumu- lated value area for a match of the module’s Rack, Group and Slot number.

SECOND GET INSTRUCTION

The second GET instruction (Figure 11-4) must be assigned an address in the timer/ counter Preset area of the Data Table, 100 words above the first GET address.

8

As its “data,” the second GET instruction stores a Data Table address that designates the beginning of the area reserved for Block Transfer data. During aread operation, data is loaded into consecutive word locations starting with the designated address. During a write operation, data is sent to the module from consecutive word locations starting with the designated address.

When reserving an area for Block Transfer data, an appropriate address must be selected

WYZ XYZ

H HIs}-{6}

{ RGS ABC CONDITIONS (OPTIONAL)

=H

WYZ = First available T/C Address (Accumulated Area) XYZ = T/C Address 100, higher than WYZ (Preset Area). RGS = Location of Block Transfer module where R= Rack, G=Module Group and

S=Module Slot.

S is a zero for the left slot and a one for the right slot. For a 2-slot module, S is always zero.

ABC = Starting address where data is transferred to/from. ORGST = OUTPUT ENERGIZE initiates Block Transfer where O=Output byte, R=Rack, G=Module Group, S=Module Slot, T=6 for write operation; 7 for read operation

FIGURE 11-4, Block Transfer Rung

Page 106 read from a scan by OCR; it may hold reading errors

Page 11-4 to ensure that a) none of the Block Transfer data can overrun word 077, or the upper boundary of the Data Table, word 177; (if so, the transfer is prevented) and b) that none of the Block Transfer data can write over ad- dresses assigned to other functions. The re- served area begins with the starting address of the Block Transfer data (ABC in Figure 11-4) and requires consecutive word storage loca- tions equal to the number of words to be transferred.

OUTPUT ENERGIZE INSTRUCTION

The OUTPUT ENERGIZE instruction (Figure 11-4) is used to initiate Block Transfer. It is given an address that indicates the module location and the type of Block Transfer operation. The first digit of the address is always “0” for output byte, even though an input or output Block Transfer module can be used. The next three digits identify the module location by Rack, Group and Slot. The last digit is either a6” for a write operation ora‘“7” for a read operation. When Block Transfer is successfully completed, the Read bit (or Write bit) is set in the corresponding Input Image Table byte.

PROGRAMMING EXAMPLE

An example rung for performing a Block Transfer Read operation and the Data Table areas used by the rung are shown in Figure 11-5. The following parameters have been chosen for the example:

Module Address 121 Storage word containing the Module Address 030 Address of first word of Block

Transfer data 060 Storage word containing address of first word of data 130

The module is located in Module Group 2, Slot 1. Therefore, the Control and Status bytes corresponding to the module’s address in the Output and Input Image Tables are at word address 012, and 112, (upper bytes) respec- tively. The address of the Read bit and Done bit is 012/17 and 112/17, respectively.

During the program scan when input switch 113/02 is closed, the rung is enabled and Read bit 012/17 is set to “1.” In the next scan of the Output Image Table, the upper byte data of word address 012 is sent to the module. The module responds that it is ready for transfer. The Processor interrupts the Output Image Table scan and starts searching the timer/ counter Accumulated area of the Data Table. It finds the Module Address 121, in word address 030, ,and the address of the first word of Block Transfer data 060, in word address 130,. The Processor then transfers the data from the module to Data Table addresses 060, through 067,. When the number of words to be transferred is not programmed, the module will transfer its maximum (default) number which in this example was eight.

BIDIRECTIONAL BLOCK TRANSFER

A bidirectional operation requires one rung for a read operation and one rung for a write operation. Consecutive addresses in the timer/counter area of the Data Table should be selected for the GET instructions (Figure 11-6). For example, the first GET instruction of both rungs should be assigned consecutive word addresses such as 040, and 041,. Both will have the same “data” “to identify the module location at address 130..

The second GET instruction of both rungs will be assigned addresses 100, words above the first GET instructions. As" “data,” they will store the starting address for Block Transfer data such as 050, and 060,.

The OUTPUT ENERGIZE instruction is ad- dressed for aread operation in onerung anda write operation in the other rung. To let the Processor know whether a read or write operation is to be performed, bit 16 or 17 of the first GET instructions must be set ON. This can be done by programming an OUTPUT ENERGIZE or OUTPUT LATCH instruction unconditional- ly. Forexample, bit 16 of word 040, is set ON to indicate a write operation. Bit 17 of word 041 is set ON to indicate a read operation.

8

11.2.3 Support Rungs

There are additional techniques that can be used to support the Block Transfer operation:

© Loading Zeros

Page 107 read from a scan by OCR; it may hold reading errors

Page 11-5

~-------- 010 R DATA TABLE OUTPUT IMAGE TABLE

OUTPUT BLOCKLENGTH] ©. 7 BYTE. CONTAINS READ

IMAGE 1 CODE 012 ENABLE BIT AND BLOCK TABLE 29 [7 ee LENGTH IN BINARY D ---------- is 4 017 CODE, --- 027 ~ STORAGE WORD 1 2 1 030 = CONTAINS MODULE TIMER/ ADDRESS IN BCD COUNTER ACCUMULATED 6 AREA 060 FIRST WORD OF

BLOCK TRANSFER DATA BLOCK TRANSFER DATA

067 ~=LAST WORD OF DATA ida IF

110

INPUT Ro INPUT IMAGE TABLE IMAGE 1 112. BYTE CONTAINS TABLE 29 [7, ~ - - - - """- -- --- ------, DONE BIT -- eee 117

0 6 0 130 STORAGE WORD CONTAINS

ADDRESS OF FIRST DATA

COUNTER WORD IN BCD PRESET AREA

OPTIONAL CONDITION

113 030 = 130 012 G4 Gi + 02 121 060 17

FIGURE 11-5, Data Table Locations for a Block Transfer Read Operation

Page 108 read from a scan by OCR; it may hold reading errors

4ajSuesL 49O/g |UONIadIpig 40) SUONeD07 aIqeL e}eq, 9-LL AYNDIS

ZL

H } 10 9

0v0 20

090 O€L el0

90 H } fo}-43h Tet Tp0

0So O€l

E10

Lol Ort

SHNODO YHaSSNVYL IN4SSSOONS Y3LSV LES SYV SLIG INOG DSNIGNOdSSaYyOD, - > Ell

8090 GHOM LV

ONILYVLS 31EVL VLVO SHL OLNI Q30V01 ONV 2 INGOW 3SHL WOdS 090

QvVa¥ 38 OL SHV VLVG 40 SGYHOM S

80S0 GUOM WOdS oso ONILYVLS JINGOW YASSNVYL WOOT1E IWNOILOSYIGIEG SHL OL NSLLIOM 3€@ OL 3Y¥vV VLVG 40 SQHOM S

LO 0v0

LO fy HDH Orl 00

Vivd QVaY YASISNVYL HOOTE vivd SLIYM YSSSNVYEL HOOT1E

Lye

Md

9-1, obey

Page 109 read from a scan by OCR; it may hold reading errors

Page 11-7

¢ Setting the number of words to be trans- ferred e Buffering data

Of these support rungs, buffering data must be programmed to ensure the Block Transfer data is valid. Other techniques, such as an IMMEDIATE OUTPUT instruction or a Scan Monitor, can also be programmed. The |OT instruction is used to request Block Transfer more than once per scan by assigning it the word address corresponding to the module’s location. A Scan Monitor is used to monitor the number of scans that have occurred be- tween each Block Transfer operation. For programming information on the Scan Moni- tor, refer to the respective User’s Manual for the Block Transfer module.

LOADING ZEROS

When programming Block Transfer rungs, the first address(es) in the timer/counter Accumulated area of the Data Table starting at address 030, must be used to store the location(s) of the Block Transfer module(s). After the last module location is stored, the next consecu- tive address should be loaded with zeros. This serves as a boundary to prevent the Processor from searching the remaining timer/counter Accumulated value addresses where it could by chance, find a BCD value identical to the Rack, Module Group and Slot number of a Block Transfer module.

The boundary word data bits can be set to zero manually using Bit Manipulation [SEARCH][5][3], or by GET/PUT transfer. The GET/PUT transfer can be programmed by assigning the GET and PUT instructions to the address immediately following the last Block Transfer Data Address (Figure 11-7). The value of the GET instruction can be set to 000 when programmed.

SETTING THE NUMBER OF WORDS TO TRANSFER

Each Block Transfer module has a default value that specifies the maximum number of words that can be transferred. Either the default value or some lesser value can be selected. For Bidirectional Block Transfer, use the default value of the module. Because the default value can vary from one kind of module to another, consult the appropriate module documentation.

When a lesser number of words are desired, the number of words to be transferred must be set when programming the Block Transfer support rungs. The number of words is stored in the upper or lower Output Image Table byte

DATA TABLE

1 0 0

1 1 0

0 0 0 pe

FIRST WORD IN ACCUMULATED

030 AREA OF DATA TABLE

031

032 LAST CONSECUTIVE DATA ADDRESS CONTAINS ZEROS TO SEPARATE BLOCK TRANSFER ADDRESSES FROM TIMER, COUNTER AND STORAGE ADDRESSES

032 GI 000

032 {PUT 000

FIGURE 11-7, Loading Zeros

Page 110 read from a scan by OCR; it may hold reading errors

Page 11-8 that corresponds to the module’s location. The appropriate bits must be set ON to specify a binary value that equals the number of words to transfer (Figure 11-8). These bits can be set ON by programming unconditional OUTPUT ENERGIZE or OUTPUT LATCH instructions.

For example, 5 words can be transferred by setting bits 00 and 02 high unconditionally in

Output Image Table word 014. The binary equivalent of 5, as stated in the look-up table, is 000101.

If the number of words to be transferred or the location of Block Transfer data must change at different times, special programming techniques must be used. Refer to the appropriate documentation for the Block Transefer module for these programming techniques.

READ 5 WORDS FROM MODULE ee #WORDS BIT PATTERN TOTRANSFER |7/61]5141312111]0 RW, - DEFAULT ololojlojojo t{ofoJolo{1fol1] o14 1 \ | /folo]}ofofol|: 2 \i/[olo]olo][1]o 3 Vif jolofolof[1]|1 4 o{o{o}1]o]o 0 1 1 4 0 030 x ° h OL Oj4}¢ aE 62 [| \fatata 1| 0 63 [| \[1 1 1 050 64 ol ololo|joj|o BLOCK TRANSFER DATA 054 1 tfo}1] 114 ) 5 ) 130 014 + 00 SETS THE o14| Pp NUMBER ; OF WORDS _ 02 030 130 014, {G}-{G} - { 140 050 07

FIGURE 11-8, Setting the Number of Transfer Words