The text of a manual · part 63 of 70
SLC 500 Instruction Set Reference Manual, pages 621 to 630
Pages 621 to 630 of 694
The original document is the PDF (7.2 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 1747-L514
Page 621
Programming Instruction References
D-21
Message lengths for SLC 5/05 processors are shown in the next table.
TIP
Message lengths are based on Ethernet buffer size of 2108 bytes (includes command header and system addressing in addition to actual file data). The local file is the destination file for reads and the source files for writes. In the following table, byte values are the maximum byte length argument values the compiler should generate to be passed to the MSG instruction and then written to word 11 of the MSG control block by the processor at run time.
Table D.5 SLC 5/05 Message Lengths File Type
485CIF and 500CPU Read/Write
PLC5 Read
PLC5 Write
Elements
Bytes
Elements
Bytes
Elements
Bytes
O,I
256
512
256
512
256
512
S
83
166
83
166
83
166
B
256
512
256
512
256
512
T
256
1536
256 (208 when target file type is Timer)
1536 (1248 when target file type is Timer)
208 (201 when using logical ASCII addressing)
1248 (1206 when using logical ASCII addressing)
C
256
1536
256
1536
256
1536
R
256
1536
256
1536
256
1536
N
256
512
256
512
256
512
F
256
1024
256
1024
256
1024
A
256
512 - Treat an ASCII file element here as a whole 16-bit word.
256
512 - Treat an ASCII file element here as 1 byte like PLCs do; compensate by doubling the number of elements that can be read.
256
512 - Treat an ASCII file element here as 1 byte like PLCs do; compensate by doubling the number of elements that can be read.
ST
25 (24 for 500CPU write)
2100 (2016 for 500CPU write)
1
M
256
512
256
1 512
256
512
Publication 1747-RM001G-EN-P - November 2008
Page 622
D-22
Programming Instruction References
Notes:
Publication 1747-RM001G-EN-P - November 2008
Page 623
Appendix
E
Data File Organization and Addressing
This chapter discusses the following topics. • Data file organization and addressing • Specifying indexed addressing • Specifying indirect addressing (SLC 5/03 OS302, SLC 5/04 OS401, and SLC 5/05 processors) • Specifying indirect indexed addressing (SLC 5/03 OS302, SLC 5/04 OS401, and SLC 5/05 processors) • Addressing file instructions (using the file indicator #) • Numeric constants • M0-M1 files, G files (SLC 5/02 and higher processors with specialty I/O modules)
Understanding File Organization
The processor provides control through the use of a program you create, called a processor file. This file contains other files that break your program down into more manageable parts.
Processor File Overview Most of the operations you perform with the programming device involve the processor file and the two components created with it; program files and data files.
Processor File
Program Files
Data Files
The programming device stores processor files on hard disk (or floppy disk). Monitoring and editing of processor files is done in the workspace of the computer. After you select a file from disk and edit it, you then save the file
1
Publication 1747-RM001G-EN-P - November 2008
Page 624
E-2
Data File Organization and Addressing hard to disk, replacing the original disk version with the edited version. The hard disk is the recommended location for a processor file.
PROGRAMMING DEVICE Hard Disk
Workspace 01
01 02 03 04 Uniquely named processor files
Processor files are created in the offline mode using the programming device. These files are then restored (downloaded), to the processor for online operation.
Program Files Program files contain controller information, the main ladder program, interrupt subroutines, and any subroutine programs. These files are: • System Program (file 0) - This file contains various system related information and user-programmed information such as processor type, I/O configuration, processor file name, and password. • Reserved (file 1) - This file is reserved. • Main Ladder Program (file 2) - This file contains user-programmed instructions defining how the controller is to operate. • Subroutine Ladder Program (file 3 to 255) - These files are user-created and accessed according to subroutine instructions residing in the main ladder program file.
Data Files Data files contain the status information associated with external I/O and all other instructions you use in your main and subroutine ladder program files. In addition, these files store information concerning processor operation. You can also use the files to store “recipes” and look-up tables if needed. These files are organized by the type of data they contain. The data file types are: • Output (file 0) - This file stores the state of the output terminals for the controller. • Input (file 1) - This file stores the status of the input terminals for the controller.
Publication 1747-RM001G-EN-P - November 2008
Page 625
Data File Organization and Addressing
E-3
• Status (file 2) - This file stores controller operation information. This file is useful for troubleshooting controller and program operation. • Bit (file 3) - This file is used for internal relay logic storage. • Timer (file 4) - This file stores the timer accumulator and preset values and status bits. • Counter (file 5) - This file stores the counter accumulator and preset values and the status bits. • Control (file 6) - This file stores the length, pointer position, and status bits for specific instructions such as shift registers and sequencers. • Integer (file 7) - This file is used to store numeric values or bit information. • Floating Point (file 8) - This file stores single precision non-extended 32-bit numbers. Applies to SLC 5/03 (OS301 and higher), SLC 5/04, and SLC 5/05 processors. • String (user-defined file) - Applies to SLC 5/03 (OS301 and higher), SLC 5/04, and SLC 5/05 processors. • ASCII (user-defined file) - Applies to SLC 5/03 (OS301 and higher), SLC 5/04, and SLC 5/05 processors.
Addressing Data Files
For the purposes of addressing, each data file type is identified by a letter (identifier) and a file number. File numbers 0 through 7 are the default files that fixed, SLC 5/01, SLC 5/02, and SLC 5/03 OS300 processors create for you. File number 8 applies only to SLC 5/03 (OS301 and higher), SLC 5/04, and SLC 5/05 processors. If you need additional storage, you can create files by specifying the appropriate identifier and a file number from 9 to 255.
Publication 1747-RM001G-EN-P - November 2008
Page 626
E-4
Data File Organization and Addressing
Table E.1 Data file types, identifiers, and numbers (data files in processor memory) File Type
Identifier
File Number
Output Input Status Bit Timer Counter Control Integer Float
O I S B T C R N F
0 1 2 3 4 5 6 7 8
User-Defined Files File Type
Identifier
File Number
Bit Timer Counter Control Integer Float String ASCII
B T C R N F St A
9 to 255
TIP
Publication 1747-RM001G-EN-P - November 2008
Floating point, string, and ASCII file types are only available when using SLC 5/03 (OS301 and higher), SLC 5/04, and SLC 5/05 processors.
Page 627
Data File Organization and Addressing
E-5
Specifying Logical Addresses You assign logical addresses to instructions from the highest level (element) to the lowest level (bit). Addressing examples are shown in the table below.
To specify the address of a
Use these parameters(1)
Word within an integer file
N 7 :
2
File Type File Number File Delimiter Word Number
Word within a structure file (for example, a timer file)
T 4 :
7 .
ACC
N 7 :
2 /
5
File Type File Number File Delimiter Structure Number Delimiter Word
Bit within an integer file File Type File Number File Delimiter Word Number Bit Delimiter Bit Number (1)
Some programming devices support short addressing. This allows you to eliminate the file number and file delimiter from addresses. Consult your programming device’s user manual for information on addressing capabilities. (For example: N7:2 = N2; T4:12.ACC = T12.ACC; B3:2/12 = B2/12)
Publication 1747-RM001G-EN-P - November 2008
Page 628
E-6
Data File Organization and Addressing
To specify the address of a
Use these parameters(1)
Bit within a bit file
B 3 /
31
File Type File Number Bit Delimiter Bit Number R 6 :
Bit within an integer file
7 /
DN
File Type File Number File Delimiter Structure Number Delimiter Mnemonic (1)
Some programming devices support short addressing. This allows you to eliminate the file number and file delimiter from addresses. Consult your programming device’s user manual for information on addressing capabilities. (For example: N7:2 = N2; T4:12.ACC = T12.ACC; B3:2/12 = B2/12)
You can also address at the bit level using mnemonics for timer, counter, or control data types. The available mnemonics depend on the type of data.
I/O Addressing for a Fixed I/O Controller In the following figure, a fixed I/O controller has 24 inputs and 16 outputs. An expansion chassis has been added. Slot 1 of the chassis contains a module having 6 inputs and 6 outputs. Slot 2 contains a module having 8 outputs. The following tables show how these outputs and inputs are arranged in data files 0 and 1. For these files, the element size is always 1 word. Slot numbers 0 1
Publication 1747-RM001G-EN-P - November 2008
2
I/O
I/O
I/O
Fixed I/O Controller
Expansion Chassis
Page 629
Data File Organization and Addressing
Slot
Inputs
Outputs
0 1 2
24 6 None
16 6 8
10
09
E-7
Table E.2 Data File 0 - Output Image 15
14
13
12
11
08
07
06
05
Slot 0 Outputs (0 to 15) Slot 1 Outputs (0 to 5)
04
03
02
01
00 x
O:0
INVALID
O:1
Slot 2 Outputs (0 to 7)
x
O:2
Table E.3 Data File 1 - Input Image 15
14
Slot 0 Inputs (0 to 15)
x
Slot 0 Inputs (16 to 23)
INVALID
Slot 1 Inputs (0 to 5)
INVALID
13
12
11
10
09
08
07
06
05
04 x x
03
02
01
00 I:0 I:0.1 x
I:1
The table on the following page explains the addressing format for outputs and inputs. Note that the format specifies e as the slot number and s as the word number. When you are dealing with file instructions, refer to the element as e.s (slot and word), taken together.
Publication 1747-RM001G-EN-P - November 2008
Page 630
E-8
Data File Organization and Addressing
Assign I/O addresses to fixed I/O controllers
Table E.4 Addressing Format Format
Explanation O
Output
I
Input
:
Element delimiter Slot number Fixed I/O controller: 0 (decimal)
e
Left slot of expansion chassis: 1 Right slot of expansion chassis: 2
O:e.s/b I:e.s/b
.
Word delimiter. Required only if a word number is necessary as noted below.
s
Word number
/
Bit delimiter b
Terminal number
Required if the number of inputs or outputs exceeds 16 for the slot. Range: 0 to 255 (range accommodates multi-word “specialty cards”) Inputs: 0 to 15 (or 0 to 23, slot 0) Outputs: 0 to 15
Examples (applicable to the controller shown on page F-10): O:0/4 O:2/7 I:1/4 I:0/15 I:0.1/7
Controller output 4 (slot 0) Output 7, slot 2 of the expansion chassis Input 4, slot 1 of the expansion chassis Controller input 15 (slot 0) Controller input 23 (bit 07, word 1 of slot 0)
Alternate way of addressing I/O terminals 16 and higher: As indicated above, address I:0.1/7 applies to input terminal 23 of slot 0. You can also address this terminal as I:0/23. Word addresses: O:1 I:0 I:0.1
Output word 0, slot 1 Input word 0, slot 0 Input word 1, slot 0
Default Values: Your programming device will display an address more formally. For example, when you assign the address I:1/4, the programming device will show it as I:1.0/4 (input file, slot 1, word 0, terminal 4).
I/O Addressing for a Modular Controller With modular controllers, slot number 0 is reserved for the processor module (CPU). Slot 0 is invalid as an I/O slot. The figure below shows a modular controller configuration consisting of a 7-slot chassis interconnected with a 10-slot chassis. Slot 0 contains the CPU.
Publication 1747-RM001G-EN-P - November 2008