The text of a manual · part 6 of 68
Programmable Controllers C200HX-CPU-ZE, C200HG-CPU-ZE, C200HE-CPU-ZE Operation Manual: SECTION 3 Memory Areas, pages 38 to 46
Pages 38 to 46 of 613, from Programmable Controllers C200HX-CPU-ZE, C200HG-CPU-ZE, C200HE-CPU-ZE Operation Manual
The original document is the PDF (3.8 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.
Filed in the catalog under the Omron C200H-SP001 and Omron C200HW-PA204
Page 38
SECTION 3 Memory Areas Various types of data are required to achieve effective and correct control. To facilitate managing this data, the PC is provided with various memory areas for data, each of which performs a different function. The areas generally accessible by the user for use in programming are classified as data areas. The other memory area is the UM Area, where the user’s program is actually stored. This section describes these areas individually and provides information that will be necessary to use them. As a matter of convention, the TR area is described in this section, even though it is not strictly a memory area. 3-1
3-2 3-3 3-4
3-5
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1-1 Data Area Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1-2 IR/SR Area Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Area Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . IR (Internal Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SR (Special Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-1 Controller Link/SYSMAC NET/SYSMAC LINK System . . . . . . . . . . . . . . . . . . 3-4-2 Remote I/O Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-3 Link System Flags and Control Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-4 Forced Status Hold Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-5 I/O Status Hold Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-6 Output OFF Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-7 FAL (Failure Alarm) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-8 Low Battery Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-9 Cycle Time Error Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-10 I/O Verification Error Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-11 First Cycle Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-12 Clock Pulse Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-13 Step Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-14 Group-2 Error Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-15 Special Unit Error Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-16 Instruction Execution Error Flag, ER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-17 Arithmetic Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-18 Interrupt Subroutine Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-19 RS-232C Port Communications Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-20 Peripheral Port Communications Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-21 Memory Cassette Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-22 Data Transfer Error Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-23 Ladder Diagram Memory Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-24 Memory Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-25 Data Save/Load Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-26 Transfer Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-27 PC Setup Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-28 Clock and Keyboard Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-29 Group-2 Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-30 Special I/O Unit Restart Bits and Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . AR (Auxiliary Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-1 Restarting Special I/O Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-2 Slave Rack Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-3 Group-2 Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-4 Optical I/O Unit and I/O Terminal Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-5 SYSMAC LINK System Data Link Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-6 Controller Link System Data Link Start Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-7 Error History Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
27 27 28 28 32 36 41 43 43 45 46 46 46 46 47 47 47 47 48 48 48 48 48 49 49 50 50 51 51 51 52 52 52 52 52 52 52 54 55 55 55 56 56 56
25
Page 39
Section 3-5-8 Active Node Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-9 Controller Link/SYSMAC LINK/SYSMAC NET Link System Service Time . . 3-5-10 Calendar/Clock Area and Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-11 TERMINAL Mode Key Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-12 Power OFF Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-13 SYSMAC LINK – Programming Device Flags . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-14 Cycle Time Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-15 Link Unit Mounted Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-16 CPU Unit-mounting Device Mounted Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-17 FPD Trigger Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-18 Data Tracing Flags and Control Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-19 Cycle Time Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 DM (Data Memory) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6-1 Expansion DM Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6-2 Special I/O Unit Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6-3 Special I/O Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6-4 Error History Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6-5 PC Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6-6 Communications Board Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6-7 Special I/O Unit Area Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 HR (Holding Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8 TC (Timer/Counter) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 LR (Link Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10 UM Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11 TR (Temporary Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12 EM (Extended Data Memory) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12-1 Using the EM Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12-2 The Current EM Bank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
26
57 57 57 58 58 59 59 59 59 59 59 60 60 61 62 62 64 65 71 73 74 74 75 76 77 77 77 78
Page 40
Section
Introduction
3-1
3-1
Introduction
3-1-1 Data Area Overview Details, including the name, size, and range of each area are summarized in the following table. Data and memory areas are normally referred to by their acronyms, e.g., the IR Area, the SR Area, etc. Area
Size
Range
Internal Relay Area 1
3,776 bits
IR 000 to IR 235
Special Relay Area 1 Special Relay Area 2 Internal Relay Area 2
312 bits 704 bits 3,392 bits
SR 236 to SR 255 SR 256 to SR 299 IR 300 to IR 511
Temporary Relay Area
8 bits
TR 00 to TR 07
Holding Relay Area
1,600 bits
HR 00 to HR 99
Auxiliary Relay Area
448 buts
AR 00 to AR 27
Link Relay Area
1,024 bits
LR 00 to LR 63
Timer/Counter Area
512 counters/ timers
TC 000 to TC 511
Comments Refer to 3-1-2 IR/SR Area Overview and 3-3 IR (Internal Relay) Area for more details. Refer to 3-1-2 IR/SR Area Overview and 3-4 SR (Special Relay) Area for more details. Refer to 3-1-2 IR/SR Area Overview and 3-3 IR (Internal Relay) Area for more details. Used to temporarily store and retrieve execution conditions when programming certain types of branching ladder diagrams. Used to store data and to retain the data values when the power to the PC is turned OFF. Contains flags and bits for special functions. Retains status during power failure. Used for data links in the PC Link System. (These bits can be used as work words or work bits when not used in the PC Link System.) Used to define timers and counters, and to access completion flags, PV, and SV. TIM 000 through TIM 015 are refreshed via interrupt processing as high-speed timers.
Data Memory Area
Fixed DM Area Extended Data Memory Area
6,144 words 1,000 words 2,600 words 3,400 words 31 words (44 words) 512 words 56 words 6,144 words
DM 0000 to DM 6143 DM 0000 to DM 0999 DM 1000 to DM 2599 DM 2600 to DM 5999 DM 6000 to DM 6030 DM 6100 to DM 6143 DM 6144 to DM 6599 DM 6600 to DM 6655 EM 0000 to EM 6143
Read/Write Normal DM. Special I/O Unit Area Normal DM History Log Link test area (reserved) Fixed DM Area (read only) PC Setup The amount of EM area memory depends on the PC model being used. PCs are available with no EM, one 6,144-word bank, or three 6,144-word banks. Like DM, the EM memory can be accessed in word units only and EM area data is retained when the power to the PC is turned OFF.
Work Bits and Words
When some bits and words in certain data areas are not being used for their intended purpose, they can be used in programming as required to control other bits. Words and bits available for use in this fashion are called work words and work bits. Most, but not all, unused bits can be used as work bits. Those that can be used are described area-by-area in the remainder of this section. Actual application of work bits and work words is described in Section 4 Writing and Inputting the Program.
Flags and Control Bits
Some data areas contain flags and/or control bits. Flags are bits that are automatically turned ON and OFF to indicate particular operation status. Although some flags can be turned ON and OFF by the user, most flags are read only; they cannot be controlled directly.
27
Page 41
Section
Data Area Structure
3-2
Control bits are bits turned ON and OFF by the user to control specific aspects of operation. Any bit given a name using the word bit rather than the word flag is a control bit, e.g., Restart bits are control bits.
3-1-2 IR/SR Area Overview When designating a data area, the acronym for the area is always required for any area except the IR and SR areas. Although the acronyms for the IR and SR areas are given for clarity in text explanations, they are not required, and not entered, when programming. The IR and SR areas are divided into two 256-word sections; the boundary between these sections is located in the SR area between SR 255 and SR 256. When the SR area is used as an operand in an instruction, the operand cannot cross over this boundary. Also, basic instructions that access bits in the second section (SR 25600 through IR 51115) have somewhat longer execution times. Area
Range
IR Area 1 I/O Area 1
IR 000 to IR 029
Group-2 High-density I/O Unit and B7A Interface Unit Area SYSMAC BUS and CompoBus/D Output Area Special I/O Unit Area 1 Optical I/O Unit and I/O Terminal Area Work Area SR Area 1 SR Area 2
IR Area 2 I/O Area 2
IR 030 to IR 049 IR 050 to IR 099 IR 100 to IR 199 IR 200 to IR 231
Note
I/O words are allocated to the CPU Rack and Expansion I/O Racks by slot position. Allocated to Group-2 High-density I/O Units and to B7A Interface Units 0 to 9 Allocated to Remote I/O Slave Racks 0 to 4 or to CompoBus/D Network Outputs. Allocated to Special I/O Units 0 to 9. Allocated to Optical I/O Units and I/O Terminals.
IR 232 to IR 235 For use as work bits in the program. SR 23600 to SR 25507 Contains system clocks, flags, control bits, and status information. SR 256 to SR 299 Contains flags, control bits, and status information. SR 290 to SR 297 are used as I/O words by MCRO(099). IR 300 to IR 309
Work Area Group-2 High-density I/O Unit Area 2 Work Area CompoBus/D Input Area Special I/O Unit Area 2 Work Area
Comments
IR 310 to IR 329 IR 330 to IR 341
These I/O words are allocated to a third Expansion I/O Rack by slot position. For use as work bits in the program. Allocated to Group-2 High-density I/O Units A to F.
IR 342 to IR 349 IR 350 to IR 399 IR 400 to IR 459 IR 460 to IR 511
For use as work bits in the program. Allocated to CompoBus/D Inputs Allocated to Special I/O Units A to F. For use as work bits in the program.
1. Refer to 3-3 IR (Internal Relay) Area for more details on the IR area. Refer to 3-4 SR (Special Relay) Area for more details on the SR area. 2. Bits in IR Area 1 and IR Area 2 can can be used in programming as work bits when not used for their allocated purpose.
3-2
Data Area Structure When designating a data area, the acronym for the area is always required for any but the IR and SR areas. Although the acronyms for the IR and SR areas are often given for clarity in text explanations, they are not required, and not entered, when programming. Any data area designation without an acronym is assumed to be in either the IR or SR area. Because IR and SR addresses run consecutively, the word or bit addresses are sufficient to differentiate these two areas.
28
Page 42
Section
Data Area Structure
3-2
An actual data location within any data area but the TC area is designated by its address. The address designates the bit or word within the area where the desired data is located. The TC area consists of TC numbers, each of which is used for a specific timer or counter defined in the program. Refer to 3-8 TC Area for more details on TC numbers and to 5-14 Timer and Counter Instructions for information on their application. The rest of the data areas (i.e., the IR, SR, HR, DM, AR, and LR areas) consist of words, each of which consists of 16 bits numbered 00 through 15 from right to left. IR words 000 and 001 are shown below with bit numbers. Here, the content of each word is shown as all zeros. Bit 00 is called the rightmost bit; bit 15, the leftmost bit. The term least significant bit is often used for rightmost bit; the term most significant bit, for leftmost bit. These terms are not used in this manual because a single data word is often split into two or more parts, with each part used for different parameters or operands. When this is done, the rightmost bits of a word may actually become the most significant bits, i.e., the leftmost bits in another word, when combined with other bits to form a new word. Bit number
15
14
13
12
11
10
09
08
07
06
05
04
03
02
01
00
IR word 000
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
IR word 001
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
The DM area is accessible by word only; you cannot designate an individual bit within a DM word. Data in the IR, SR, HR, AR, and LR areas is accessible either by word or by bit, depending on the instruction in which the data is being used. To designate one of these areas by word, all that is necessary is the acronym (if required) and the two-, three-, or four-digit word address. To designate an area by bit, the word address is combined with the bit number as a single four- or fivedigit address. The following table show examples of this. The two rightmost digits of a bit designation must indicate a bit between 00 and 15, i.e., the rightmost digit must be 5 or less the next digit to the left, either 0 or 1. The same TC number can be used to designate either the present value (PV) of the timer or counter, or a bit that functions as the Completion Flag for the timer or counter. This is explained in more detail in 3-8 TC Area. Area
Data Structure
Word designation
Bit designation
IR
000
00015 (leftmost bit in word 000)
SR
252
25200 (rightmost bit in word 252)
DM
DM 1250
Not possible
TC
TC 215 (designates PV)
TC 215 (designates completion flag)
LR
LR 12
LR 1200
Word data input as decimal values is stored in binary-coded decimal (BCD); word data entered as hexadecimal is stored in binary form. Each four bits of a word represents one digit, either a hexadecimal or decimal digit, numerically equivalent to the value of the binary bits. One word of data thus contains four digits, which are numbered from right to left. These digit numbers and the corresponding bit numbers for one word are shown below.
Digit number
3
2
1
0
Bit number
15
14
13
12
11
10
09
08
07
06
05
04
03
02
01
00
Contents
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
When referring to the entire word, the digit numbered 0 is called the rightmost digit; the one numbered 3, the leftmost digit.
29
Page 43
Section
Data Area Structure
3-2
When inputting data into data areas, it must be input in the proper form for the intended purpose. This is no problem when designating individual bits, which are merely turned ON (equivalent to a binary value of 1) or OFF (a binary value of 0). When inputting word data, however, it is important to input it either as decimal or as hexadecimal, depending on what is called for by the instruction it is to be used for. Section 5 Instruction Set specifies when a particular form of data is required for an instruction. Converting Different Forms of Data
Binary and hexadecimal can be easily converted back and forth because each four bits of a binary number is numerically equivalent to one digit of a hexadecimal number. The binary number 0101111101011111 is converted to hexadecimal by considering each set of four bits in order from the right. Binary 1111 is hexadecimal F; binary 0101 is hexadecimal 5. The hexadecimal equivalent would thus be 5F5F, or 24,415 in decimal (163 x 5 + 162 x 15 + 16 x 5 + 15). Decimal and BCD are easily converted back and forth. In this case, each BCD digit (i.e., each group of four BCD bits) is numerically equivalent of the corresponding decimal digit. The BCD bits 0101011101010111 are converted to decimal by considering each four bits from the right. Binary 0101 is decimal 5; binary 0111 is decimal 7. The decimal equivalent would thus be 5,757. Note that this is not the same numeric value as the hexadecimal equivalent of 0101011101010111, which would be 5,757 hexadecimal, or 22,359 in decimal (163 x 5 + 162 x 7 + 16 x 5 + 7). Because the numeric equivalent of each four BCD binary bits must be numerically equivalent to a decimal value, any four bit combination numerically greater than 9 cannot be used, e.g., 1011 is not allowed because it is numerically equivalent to 11, which cannot be expressed as a single digit in decimal notation. The binary bits 1011 are of course allowed in hexadecimal are a equivalent to the hexadecimal digit C. There are instructions provided to convert data either direction between BCD and hexadecimal. Refer to 5-18 Data Conversion for details. Tables of binary equivalents to hexadecimal and BCD digits are provided in the appendices for reference.
Decimal Points
Decimal points are used in timers only. The least significant digit represents tenths of a second. All arithmetic instructions operate on integers only.
Signed and Unsigned Binary Data This section explains signed and unsigned binary data formats. Many instructions can use either signed or unsigned data and a few (such as CPS(114), CPSL(115), DBS(485), DBSL(483), MBS(484), and MBSL(482)) use signed data exclusively. Unsigned binary
Unsigned binary is the standard format used in OMRON PCs. Data in this manual are unsigned unless otherwise stated. Unsigned binary values are always positive and range from 0 ($0000) to 65,535 ($FFFF). Eight-digit values range from 0 ($0000 0000) to 4,294,967,295 ($FFFF FFFF).
163
Digit value
30
162
161
160
Bit number
15
14
13
12
11
10
09
08
07
06
05
04
03
02
01
00
Contents
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Page 44
Section
Data Area Structure Signed Binary
3-2
Signed binary data can have either a positive and negative value. The sign is indicated by the status of bit 15. If bit 15 is OFF, the number is positive and if bit 15 is ON, the number is negative. Positive signed binary values range from 0 ($0000) to 32,767 ($7FFF), and negative signed binary values range from –32,768 ($8000) to –1 ($FFFF).
Sign indicator 163
Digit value
162
161
160
Bit number
15
14
13
12
11
10
09
08
07
06
05
04
03
02
01
00
Contents
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Eight-digit positive values range from 0 ($0000 0000) to 2,147,483,647 ($7FFF FFFF), and eight-digit negative values range from –2,147,483,648 ($8000 0000) to –1 ($FFFF FFFF). The following table shows the corresponding decimal, 16-bit hexadecimal, and 32-bit hexadecimal values. Decimal 2147483647 2147483646 . . . 32768 32767 32766 . . . 2 1 0 –1 –2 . . . –32767 –32768 –32769 . . . –2147483647 –2147483648
Converting Decimal to Signed Binary
16-bit Hex ––– ––– . . . ––– 7FFF 7FFE . . . 0002 0001 0000 FFFF FFFE . . . 8001 8000 ––– . . . ––– –––
32-bit Hex 7FFFFFFF 7FFFFFFE . . . 00008000 00007FFF 00007FFE . . . 00000002 00000001 00000000 FFFFFFFF FFFFFFFE . . . FFFF8001 FFFF8000 FFFF7FFF . . . 80000001 80000000
Positive signed binary data is identical to unsigned binary data (up to 32,767) and can be converted using BIN(023). The following procedure converts negative decimal values between –32,768 and –1 to signed binary. In this example –12345 is converted to CFC7.
31
Page 45
Section
IR (Internal Relay) Area
3-3
1. First take the absolute value (12345) and convert to unsigned binary: Bit number
15
14
13
12
11
10
09
08
07
06
05
04
03
02
01
00
Contents
0
0
1
1
0
0
0
0
0
0
1
1
1
0
0
1
2. Next take the complement: Bit number
15
14
13
12
11
10
09
08
07
06
05
04
03
02
01
00
Contents
1
1
0
0
1
1
1
1
1
1
0
0
0
1
1
0
3. Finally add one: Bit number
15
14
13
12
11
10
09
08
07
06
05
04
03
02
01
00
Contents
1
1
0
0
1
1
1
1
1
1
0
0
0
1
1
1
Reverse the procedure to convert negative signed binary data to decimal.
3-3
IR (Internal Relay) Area The IR area is used both as data to control I/O points, and as work bits to manipulate and store data internally. It is accessible both by bit and by word. In the C200HX/HG/HE PC, the IR area is comprised of words IR 000 to IR 235 (IR area 1) and IR 300 to IR 511 (IR area 2). Basic instructions have somewhat longer execution times when they access IR area 2 rather than IR area 1. Words in the IR area that are used to control I/O points are called I/O words. Bits in I/O words are called I/O bits. Bits in the IR area which are not assigned as I/O bits can be used as work bits. IR area work bits are reset when power is interrupted or PC operation is stopped. Area IR Area 1 I/O Area 1 Group-2 High-density I/O Unit Area 1 and B7A Interface Unit Area SYSMAC BUS and CompoBus/D Output Area Special I/O Unit Area 1 Optical I/O Unit and I/O Terminal Area Work Area IR Area 2 I/O Area 2 Work Area Group-2 High-density I/O Unit Area 2 Work Area CompoBus/D Input Area Special I/O Unit Area 2 Work Area
Range IR 000 to IR 029 IR 030 to IR 049 IR 050 to IR 099 IR 100 to IR 199 IR 200 to IR 231 IR 232 to IR 235 IR 300 to IR 309 IR 310 to IR 329 IR 330 to IR 341 IR 342 to IR 349 IR 350 to IR 399 IR 400 to IR 459 IR 460 to IR 511
I/O Words
If a Unit brings inputs into the PC, the bit assigned to it is an input bit; if the Unit sends an output from the PC, the bit is an output bit. To turn ON an output, the output bit assigned to it must be turned ON. When an input turns ON, the input bit assigned to it also turns ON. These facts can be used in the program to access input status and control output status through I/O bits.
Input Bit Usage
Input bits can be used to directly input external signals to the PC and can be used in any order in programming. Each input bit can also be used in as many instructions as required to achieve effective and proper control. They cannot be used in
32
Page 46
Section
IR (Internal Relay) Area
3-3 instructions that control bit status, e.g., the OUTPUT, DIFFERENTIATION UP, and KEEP instructions. Output Bit Usage
Output bits are used to output program execution results and can be used in any order in programming. Because outputs are refreshed only once during each cycle (i.e., once each time the program is executed), any output bit can be used in only one instruction that controls its status, including OUT, KEEP(011), DIFU(013), DIFD(014) and SFT(010). If an output bit is used in more than one such instruction, only the status determined by the last instruction will actually be output from the PC. See 5-15-1 Shift Register – SFT(010) for an example that uses an output bit in two ‘bit-control’ instructions.
Word Allocation for Racks
I/O words are allocated to the CPU Rack and Expansion I/O Racks by slot position. One I/O word is allocated to each slot, as shown in the following table. Since each slot is allocated only one I/O word, a 3-slot rack uses only the first 3 words, a 5-slot rack uses only the first 5 words, and an 8-slot rack uses only the first 8 words. Words that are allocated to unused or nonexistent slots are available as work words. Right side of a 10-slot rack →
← Left side of rack Rack
Slot 1
Slot 2
Slot 3
Slot 4
Slot 5
Slot 6
Slot 7
Slot 8
Slot 9
Slot 10
CPU
IR 000
IR 001
IR 002
IR 003
IR 004
IR 005
IR 006
IR 007
IR 008
IR 009
1st Expansion
IR 010
IR 011
IR 012
IR 013
IR 014
IR 015
IR 016
IR 017
IR 018
IR 019
2nd Expansion
IR 020
IR 021
IR 022
IR 023
IR 024
IR 025
IR 026
IR 027
IR 028
IR 029
3rd Expansion
IR 300
IR 301
IR 302
IR 303
IR 304
IR 305
IR 306
IR 307
IR 308
IR 309
Unused Words
Any words allocated to a Unit that does not use them can be used in programming as work words and bits. Units that do not used the words assigned to the slot they are mounted to include Link Units (e.g., Host Link Units, PC Link Units, SYSMAC NET Link Units, etc.), Remote I/O Master Units, Special I/O Units, Group-2 High-density I/O Units, B7A Interface Units, and Auxiliary Power Supply Units.
Allocation for Special I/O Units and Slave Racks
In most C200HX/HG/HE PCs, up to sixteen Special I/O Units may be mounted in any slot of the CPU Rack or Expansion I/O Racks. (A limited number of Special I/O Units can be installed in Remote I/O Slave Racks, too.) Each Special I/O Unit is allocated ten words based on its unit number (0 to F). Up to ten Special I/O Units may be mounted in the and PCs. Each Unit is allocated ten words based on its unit number (0 to 9). Unit number 0 1 2 3 4 5 6 7 8 9
I/O words IR 100 to IR 109 IR 110 to IR 119 IR 120 to IR 129 IR 130 to IR 139 IR 140 to IR 149 IR 150 to IR 159 IR 160 to IR 169 IR 170 to IR 179 IR 180 to IR 189 IR 190 to IR 199
PC Restrictions None
33