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

The text of a manual · part 9 of 45

Enhanced and Ethernet PLC-5 Programmable Controllers User Manual: Chapter 4 - Addressing I/O and Controller Memory, pages 61 to 68

Pages 61 to 68 of 388, from Enhanced and Ethernet PLC-5 Programmable Controllers User Manual

The original document is the PDF (5.1 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 1785-L20B and Allen-Bradley 1785-L40B

Page 61

Addressing I/O and Controller Memory

4-17

Specifying Logical Addresses The format of a logical address corresponds directly to the location in data storage: # X F : e . s / b Where Is the # File address. Omit for bit, word, and structure addresses (also indicates indexed addressing, see next page) X File type:B - binaryN - integerT - timerMG - message C - counterO - outputA - ASCIIPD - PID F - floating pointR - controlD - BCDSC - SFC status I - inputS - statusBT - block-transfer ST - ASCII string F File number:0 - output 1 - input 2 - status 3-999 - any other type : colon or semicolon delimiter separates file and structure/word numbers e Structure/word number:0-277octal for input/output files up to:0-127decimal for the status file 0-999for all the file types except MG, PD, and ST files . Period delimiter is used only with structure-member mnemonics in counter, timer and control files s Structure/member mnemonic is used only with timer, counter, control, BT, MG, PD, SC, and ST files / Bit delimiter separates bit number b Bit number:00-07 or 10-17 for input/output files 00-15 for all other files 00-15,999 for binary files when using direct bit address

To Specify the Address of a Use these Parameters File

F

8

File Type File Number

Word within an integer file

N

9

:

2

2 /

5

File Type File Number File Delimiter Word Number

Bit within an integer file

N

9

:

File Type File Number File Delimiter Word Number Bit Number

Publication 1785-UM012D-EN-P - July 2005

Page 62

4-18

Addressing I/O and Controller Memory

To Specify the Address of a Use these Parameters Bit within a binary file

B 3 / 2 4 5

Bit Delimiter Bit Number Binary files are bit stream continuous files, and therefore you can address them in two ways: by word and bit, or by bit alone.

Bit within a structure file

R 6 : 7 . D N

File Type File Number File Delimiter Structure Number Member Delimiter Member Mnemonic

You can also use mnemonics to address members at the word or bit level. The available mnemonics depend on the type of data (timer, counter, or control) and the program instruction. For example: Instruction Type Word Level

Example Bit Level

Example

Timer TON, TOF, RTO

T4:1.PRE

T4:0.EN preset .PRE accumulated.ACC enable.EN timing.TT done.DN

For information about the mnemonics for a specific instruction, see chapter 22 of the PLC-5 Programming Controller Instruction Set Reference, publication 1785-6.1.

Specifying Indirect Addresses ATTENTION

When using indirect addressing, make sure that the indirect address points to a valid data file or element. During Run mode, if ladder execution encounters an invalid or out-of-range indirect address, a run-time error occurs and the controller halts.

The controller uses the value from the pointer address to form the indirect address. You can use ladder logic to change the value stored at that substitute address.

Publication 1785-UM012D-EN-P - July 2005

Page 63

Addressing I/O and Controller Memory

4-19

When you specify indirect addresses, follow these guidelines: • You can indirectly address the file number, word number, or bit number. • The substitute address must be one of the following types: N, T, C, R, B, I, O, or S. Any T, C, or R address must be a word-length sub-member address, such as T4:0.ACC. • Enter the pointer address in brackets [ ]. Example N[N7:0]:0

Explanation The file number is stored in integer address N7:0. N7:[C5:7.ACC] Structure number The word number is the accumulated value of counter 7 in file 5. B3/[I:017] Bit number The bit number is stored in input word 17. N[N7:0]:[N9:1] File and word number The file number is stored in integer address N7:0 and the word number in integer address N9:1.

ATTENTION

Variable File number

If you indirectly address the input or output image table, the value you specify in the integer file that you use for the indirection (the pointer) is converted to octal when executed by the instruction.

For example, if you enter O:[N7:0] and N7:0 contains the value 10, the value at N7:0 is converted to octal and the resulting address is O:012, not O:010. To monitor for invalid indirect addresses, condition the rung with the indirect address with a limit test of the indirect address to ensure that the address stays within the intended range. This is especially advisable if the PLC-5 controller has no control over the indirect address, such as the value is determined by values from an I/O module or a peer controller.

Publication 1785-UM012D-EN-P - July 2005

Page 64

4-20

Addressing I/O and Controller Memory

Specifying Indexed Addresses The controller starts operation at the base address plus the offset. Store the offset value in the offset word in the controller’s status file. You can manipulate the offset word in your ladder logic. The indexed address symbol is the # character. Place the # character immediately before the file-type identifier in a logical address. Enter the offset value in the status file S:24. All indexed instructions use S:24 to store an offset. When you specify indexed addresses, follow these guidelines: • Make sure the index value (positive or negative) does not cause the indexed address to exceed the file-type boundary. ATTENTION

The controller does not check indexed addresses to make sure that the addresses do not cross data-table file boundaries (e.g., N7 to F8). You could even modify the status file, which is physically the last data table file. But if the indexed address exceeds the data-table area of memory, the controller initiates a run-time error and sets a major fault.

• When an instruction uses more than two indexed addresses, the controller uses the same index value for each indexed address. • Set the offset word to the index value you want immediately before enabling an instruction that uses an indexed address. ATTENTION

Instructions with a # sign in an address manipulate the offset value stored at S:24. Make sure you monitor or load the offset value you want prior to using an indexed address. Otherwise unpredictable machine operation could occur with possible damage to equipment and/or injury to personnel.

The following MVM example uses an indexed address in the source and destination addresses. If the offset value is 10 (stored in S:24), the controller manipulates the data stored at the base address plus the offset. MVM MASKED MOVE Source Mask Destination

#N7:10 00110011 #N11:5

Publication 1785-UM012D-EN-P - July 2005

Value Base Address Offset Address Source N7:10 N7:20 Destination N11:5 N11:15

Page 65

Addressing I/O and Controller Memory

4-21

Specifying Symbolic Addresses When you specify symbolic address, follow these guidelines: • Start the name with an alphabetic character (not a number). • The symbol must begin with a letter and can contain as many as 10 of the following characters: – – A-Z (upper and lower case) – – 0-9 – – underscore (_) • You can substitute a symbolic address for word or bit addresses. IMPORTANT

Example Input image (bit) Output image (bit) Word

Symbols are a feature of the programming software (not the controller) and are stored in a database on the hard disk of the personal computer you are using. If you use a terminal other than the one on which you defined the symbols, you will not have access to the symbol database. Logical Address Symbolic Address I:015/00 LS1 I:015/03 AUTO1 I:015/06 SW1 O:013/00 M1 O:013/02 CL1 O:013/04 L1 F10:0 Calc_1 F10:1 Calc_2

Publication 1785-UM012D-EN-P - July 2005

Page 66

4-22

Addressing I/O and Controller Memory

Optimizing Instruction Execution Time and Controller Memory For the best instruction-execution performance, store your most frequently used addresses as shown below:

TIP

Address bit instructions between the end of the input image file and physical word 256. Bit addresses located in words greater than 256 require one extra word in the controller's memory for storage and execute 0.16ms slower than bit addresses stored in words 0-255. Address element instructions between the end of the input image and physical word 2048. Addresses stored in words greater than 2048 require more words in the controller's memory for storage.

frequently used bit addresses

PLC-5/11, -5/20, -5/20E Physical Word #

PLC-5/30 Physical Word #

PLC-5/40, -5/40L -5/40E Physical Word #

PLC-5/60, -5/60L -5/80, -5/80E Physical Word #

0-31

0-63

0-127

0-191 output image 1

0

32-63

32-127

32-255

32-383 input image 1

1 word 256 frequently used element addresses word 2048

File Type binary, timer, counter, control, integer, floating point block transfer, message, PID, SFC status, ASCII string

Default File #

3-999 according to your application status 2 1 The minimum size of the file is 32 words. 2 The status file is always the last physical file in the data table.

Publication 1785-UM012D-EN-P - July 2005

2

Page 67

Addressing I/O and Controller Memory

4-23

The following examples illustrate these concepts: Bit address example If your data table map looks like this: O I B T C R N

32 32 64 32 32 32 32

1 OTE

An address used in an OTE instruction stored here: occupies one word in the controller's memory executes at a rate 0.48µs

256 1 2 OTE XX

The same address stored here: occupies two words in the controller's memory executes at a rate 0.64µs end

This example uses the instruction timing and memory usage tables in Appendix D. Consult these tables for information about other instructions.

Element address example Your data table map looks like this: O I B T C N

1

64 64 1000 100 100 720

Addresses used in a MOV instruction stored here occupy three words in the controller's memory.

MOV N7:0 N7:1

2048 MOV N100:0 N100:1

3

MOV XX YY

1 The same addresses stored here occupy five words in the controller's memory.

2

2

3 4

5

MOV XX XX YY YY end

This example uses the instruction timing and memory usage tables in Appendix D. Consult these tables for information about other instructions.

Publication 1785-UM012D-EN-P - July 2005

Page 68

4-24

Addressing I/O and Controller Memory

The PLC-5 controller automatically allocates both an input and output memory location to each I/O location. I/O modules generally only use either the inputs or the outputs. To more effectively use I/O memory, you can use these methods of placing I/O modules.

Effectively Using I/O Memory Use 2-slot

1-slot complementary I/O chassis

Application Install 16-point I/O modules as an input module and output module pair in an I/O group. For example, if you place an input module in slot 0, place an output module in slot 1. Install 32-point I/O modules as an input module and an output module pair in an I/O group. For example, if you place an input module in slot 0, place an output module in slot 1. You configure complementary chassis with a primary and complement chassis pair. You complement the I/O modules I/O group for I/O group between the two chassis. The I/O modules in the complementary chassis perform the opposite function of the corresponding modules in the primary chassis. By designating a PLC-5 scanner channel as complementary, you can complement racks 1-7. A channel configured for complementary I/O can’t scan racks greater than 7. Those PLC-5 controllers that can address rack numbers greater than 7 can address these racks on another scanner channel which has not been configured as complementary. The remote I/O link device (such as a1771-ASB adapter) must also be configured for complimentary. For more information see the PLC-5 Reference Guide: Configuring Complementary I/O for PLC-5 Controllers, publication 1785-6.8.3.

Publication 1785-UM012D-EN-P - July 2005