The text of a manual · part 15 of 61
DL205 PLC User Manual, Volume 1 of 2: Chapter 3: CPU Specifications and Operations, pages 125 to 134
Pages 125 to 134 of 592, from DL205 PLC User Manual, Volume 1 of 2
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 PLC Direct D2-08ND3 and Koyo D2-08ND3
Page 125
Chapter 3: CPU Specifications and Operations
Reading Inputs from Specialty I/O
1 • Remote I/O 2 • Specialty Modules (such as High-Speed Counter, etc.) The time required to read any input status from these modules depends on which CPU you 3 are using, the number of modules, and the number of input points. Remote Module DL230 DL240 DL250–1 DL260 4 Overhead Per module (with inputs) 5 Per input point For example, the time required for a DL240 to read two 8-point input modules (located in a 6 Remote base) would be calculated as follows, where NM is the number of modules and NI is the total number of input points: 7 Remote I/O Formula 8 Time = 6µs + (67µs x NM) + (40µs x NI) Example 9 Time = 6µs + (67µs x 2) + (40µs x 16) Time = 780 µs 10 Service Peripherals Communication requests can occur at any time during the scan, but the CPU only “logs” the requests for service until the Service Peripherals portion of the scan. The CPU does not spend 11 any time on this if there are no peripherals connected. 12 13 To Log Request (anytime) DL230 DL240 DL250–1 DL260 Nothing Connected 14 Port 1 A Port 2 B C D During this portion of the cycle the CPU reads any input points associated with the following:
N/A N/A N/A
6.0 µs 67.0 µs 40.0 µs
1.82 µs 17.9 µs 2.0 µs
1.82 µs 17.9 µs 2.0 µs
Min. & Max.
0 µs
0 µs
0 µs
0 µs
Send Min. / Max. Rec. Min. / Max. Send Min. / Max. Rec. Min. / Max.
22 / 28 µs 24 / 58 µs N/A N/A
23 / 26 µs 52 / 70 µs 26 / 30 µs 60 / 75 µs
3.2/9.2 µs 25.0/35.0 µs 3.6/11.5 µs 35.0/44.0 µs
3.2/9.2 µs 25.0/35.0 µs 3.6/11.5 µs 35.0/44.0 µs
DL205 User Manual, 4th Edition, Rev. A
3–31
Page 126
Chapter 3: CPU Specifications and Operations During the Service Peripherals portion of the scan, the CPU analyzes the communications request and responds as appropriate. The amount of time required to service the peripherals depends on the content of the request.
1 To Service Request DL230 DL240 DL250–1 DL260 2 Minimum Run Mode Max. 3 Program Mode Max. CPU Bus Communication 4 Some specialty modules can also communicate directly with the CPU via the CPU bus. During this portion of the cycle the CPU completes any CPU bus communications. The 5 actual time required depends on the type of modules installed and the type of request being processed. 6 NOTE: Some specialty modules can have a considerable impact on the CPU scan time. If timing is critical in your application, consult the module documentation for any information concerning the impact on the 7 scan time. Update Clock/Calendar, Special Relays, Special Registers 8 The clock, calendar, and special relays are updated and loaded into special V-memory locations during this time. This update is performed during both Run and Program Modes. 9 Modes DL230 DL240 DL250–1 DL260 10 Program Mode 11 Run Mode 12 Writing Outputs The time required to write the output status for the local and expansion I/O modules depends on which CPU you are using and the number of output points in the base. The 13 following table shows typical update times required by the CPU. 14 Timing Factors DL230 DL240 DL250–1 DL260 Overhead A Per output point For example, the time required for a DL240 to write data for two 8-point output modules would be calculated as follows (where NO is the total number of output points): B Formula Time = 33 + (NO x 14.6µs) C Example Time = 33 + (16 x 14.6µs) D 260 µs 30 ms 3.5 Seconds
Minimum Maximum Minimum Maximum
66.0 µs 8.5 µs
250 µs 20 ms 4 Seconds
8.0 µs fixed 8.0 µs fixed 20.0 µs 26.0 µs
8 µs 410 µs 2 Seconds
35.0 µs 48.0 µs 60.0 µs 85.0 µs
33.0 µs 14.6 µs
Time = 266.6µs
3–32
DL205 User Manual, 4th Edition, Rev. A
11.0 µs 11.0 µs 19.0 µs 26.0 µs
28.1 µs 3.0 µs
8 µs 410 µs 3.7 Seconds
11.0 µs 11.0 µs 19.0 µs 26.0 µs
28.1 µs 3.0 µs
Page 127
Chapter 3: CPU Specifications and Operations
Writing Outputs to Specialty I/O
1 • Remote I/O 2 • Specialty Modules (such as High-Speed Counter, etc.) The time required to write any output image register data to these modules depends on which 3 CPU you are using, the number of modules, and the number of output points. Remote Module DL230 DL240 DL250–1 DL260 4 Overhead Per module (with outputs) 5 Per output point For example, the time required for a DL240 to write two 8-point output modules (located in 6 a Remote base) would be calculated as follows, where NM is the number of modules and NO is the total number of output points: 7 Remote I/O Formula 8 Time = 6 µs + (67.5 µs x NM) + (46 µs x NO) Example 9 Time = 6 µs + (67.5 µs x 2) + (46 µs x 16) Time = 877 µs 10 NOTE: This total time is the actual time required for the CPU to update these outputs. This does not include any additional time that is required for the CPU to actually service the particular specialty modules. 11 Diagnostics 12 The DL205 CPUs perform many types of system diagnostics. The amount of time required depends on many things, such as the number of I/O modules installed, etc. The following table shows the minimum and maximum times that can be expected. 13 Diagnostic Time DL230 DL240 DL250–1 DL260 14 Minimum Maximum A B C D During this portion of the cycle the CPU writes any output points associated with the following.
N/A N/A N/A
600.0 µs 900.0 µs
6.0 µs 67.5 µs 46.0 µs
422.0 µs 855.0 µs
1.9 µs 17.7 µs 3.2 µs
26.8 µs 103.0 µs
1.9 µs 17.7 µs 3.2 µs
26.8 µs 103.0 µs
DL205 User Manual, 4th Edition, Rev. A
3–33
Page 128
Chapter 3: CPU Specifications and Operations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 3–34
Application Program Execution The CPU processes the program from the top (address 0) to the END instruction. The CPU executes the program left to right and top to bottom. As each rung is evaluated the appropriate image register or memory location is updated. The time required to solve the application program depends on the type and number of instructions used, and the amount of execution overhead. You can add the execution times for all the instructions in your program to find the total program execution time. For example, the execution time for a DL240 running the program shown would be calculated as follows: X0
Instruction
Time
STR X0 OR C0 ANDN X1 OUT Y0 STRN C100 LD K10 STRN C101 OUT V2002 STRN C102 LD K50 STRN C103 OUT V2006 STR X5 ANDN X10 OUT Y3 END
1.4µs 1.0µs 1.2µs 7.95µs 1.6µs 62.0µs 1.6µs 21.0µs 1.6µs 62.0µs 1.6µs 21.0µs 1.4µs 1.2µs 7.95µs 16.0µs
TOTAL
210.5µs
X1
Y0 OUT
C0
C100
LD K10
C101
OUT
C102
V2002
LD K50
C103
X5
OUT
X10
V2006
Y3 OUT
END
Appendix C provides a complete list of instruction execution times for DL205 CPUs. Program Control Instructions, the DL240, DL250–1 and DL260 CPUs offer additional instructions that can change the way the program executes. These instructions include FOR/NEXT loops, Subroutines, and Interrupt Routines. These instructions can interrupt the normal program flow and effect the program execution time. Chapter 5 provides detailed information on how these different types of instructions operate.
DL205 User Manual, 4th Edition, Rev. A
Page 129
Chapter 3: CPU Specifications and Operations
PLC Numbering Systems octal 1482
49.832 ? BCD binary
1 2 ? 3 4 5 6 7 PLC Resources PLCs offer a fixed amount of resources, depending on the model and configuration. We use 8 the word “resources” to include variable memory (V-memory), I/O points, timers, counters, etc. Most modular PLCs allow you to add I/O points in groups of eight. In fact, all the resources of our PLCs are counted in octal. It’s easier for computers to count in groups of 9 eight than ten, because eight is an even power of 2. Octal means simply counting in groups of eight 10 Decimal 1 2 3 4 5 6 7 8 things at a time. In the figure to the right, there are eight circles. The quantity in decimal is “8”, 11 but in octal it is “10” (8 and 9 are not valid in Octal 1 2 3 4 5 6 7 10 octal). In octal, “10” means 1 group of 8 plus 0 (no individuals). 12 In the figure below, we have two groups of eight circles. Counting in octal we have “20” items, meaning 2 groups of eight, plus 0 individuals Don’t say “twenty”, say “two–zero octal”. 13 This makes a clear distinction between number systems. 9 10 11 12 13 14 15 16 Decimal 1 2 3 4 5 6 7 8 14 11 12 13 14 15 16 17 20 1 2 3 4 5 6 7 10 Octal A After counting PLC resources, it’s time to access PLC resources (there’s a difference). The CPU instruction set accesses resources of the PLC using octal addresses. Octal addresses are the B same as octal quantities, except they start counting at zero. The number zero is significant to a computer, so we don’t skip it. X= 0 1 2 3 4 5 6 7 C Our circles are in an array of square containers to the right. X To access a resource, our PLC instruction will address its 1X location using the octal references shown. If these were D counters, “CT14” would access the black circle location. 2 X If you are a new PLC user or are using DirectLOGIC ? 0402 ? ? 3 PLCs for the first time, please take a moment to study 3A9 ASCII 7 how our PLCs use numbers. You’ll find that each PLC hexadecimal manufacturer has their own conventions on the use of 1001011011 1011 –961428 numbers in their PLCs. Take a moment to familiarize ? decimal yourself with how numbers are used in DirectLOGIC A 72B ? –300124 177 PLCs. The information you learn here applies to all our PLCs. As any good computer does, PLCs store and manipulate numbers in binary form: ones and zeros. So why do we have to deal with numbers in so many different forms? Numbers have meaning, and some representations are more convenient than others for particular purposes. Sometimes we use numbers to represent a size or amount of something. Other numbers refer to locations or addresses, or to time. In science we attach engineering units to numbers to give a particular meaning (see Appendix H for numbering system details).
DL205 User Manual, 4th Edition, Rev. A
3–35
Page 130
Chapter 3: CPU Specifications and Operations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 3–36
V–Memory Variable memory (called “V-memory”) stores data for the ladder program and for configuration settings. V-memory locations and V-memory addresses are the same thing, and are numbered in octal. For example, V2073 is a valid location, while V1983 is not valid (“9” and “8” are not valid octal digits). Each V-memory location is one data word wide, meaning 16 bits. For configuration registers, our manuals will show each bit of a V-memory word. The least significant bit (LSB) will be on the right, and the most significant bit (MSB) on the left. We use the word “significant,” referring to the relative binary weighting of the bits. V-memory address (octal)
V-memory data (binary)
MSB
V2017
LSB
0 1 0 0 1 1 1 0 0 0 1 0 1 0 0 1
V-memory data is 16-bit binary, but we rarely program the data registers one bit at a time. We use instructions or viewing tools that let us work with binary, decimal, octal, and hexadecimal numbers. All these are converted and stored as binary for us. A frequently-asked question is “How do I tell if a number is binary, octal, BCD, or hex”? The answer is that we usually cannot tell by looking at the data, but it does not really matter. What matters is: the source or mechanism which writes data into a V-memory location and the thing which later reads it must both use the same data type (i.e., octal, hex, binary, or whatever). The Vmemory location is a storage box... that’s all. It does not convert or move the data on its own.
Binary-Coded Decimal Numbers Since humans naturally count in decimal, we prefer to enter and view PLC data in decimal as well (via operator interfaces). However, computers are more efficient in using pure binary numbers. A compromise solution between the two is Binary-Coded Decimal (BCD) representation. A BCD digit ranges from 0 to 9, and is stored as four binary bits (a nibble). This permits each V-memory location to store four BCD digits, with a range of decimal numbers from 0000 to 9999. 4
BCD number 8
V-memory storage
4
9 2
1
0 1 0 0
8
4
3 2
1
1 0 0 1
8
4
6 2
1
0 0 1 1
8
4
2
1
0 1 1 0
In a pure binary sense, a 16-bit word represents numbers from 0 to 65535. In storing BCD numbers, the range is reduced to 0 to 9999. Many math instructions use BCD data, and DirectSOFT and the handheld programmer allow us to enter and view data in BCD. Special RLL instructions convert from BCD to binary, or visa–versa.
Hexadecimal Numbers Hexadecimal numbers are similar to BCD numbers, except they utilize all possible binary values in each 4bit digit. They are base-16 numbers so we need 16 different digits. To extend our decimal digits 0 through 9, we use A through F as shown. Decimal Hexadecimal
0 1 2 3 0 1 2 3
4 5 4 5
6 6
7 7
8 9 10 11 12 13 14 15 8 9 A B C D E F
A 4-digit hexadecimal number can represent all 65536 values in a V-memory word. The range is from 0000 to FFFF (hex). PLCs often need this full range for sensor data, etc. Hexadecimal is a convenient way for humans to view full binary data. Hexadecimal number
A
7
F
4
V-memory storage
1 0 1 0
0 1 1 1
1 1 1 1
0 1 0 0
DL205 User Manual, 4th Edition, Rev. A
Page 131
Chapter 3: CPU Specifications and Operations
Memory Map
1 2 3 4 Octal Numbering System All memory locations or areas are numbered in Octal 5 (base 8). For example, the diagram shows how the octal numbering system works for the discrete input points. Notice the octal system does not contain any 6 numbers with the digits 8 or 9. 7 Discrete and Word Locations 8 As you examine the different memory types, you’ll Discrete – On or Off, 1 bit notice two types of memory in the DL205, discrete 9 X0 and word memory. Discrete memory is one bit that can be either a 1 or a 0. Word memory is referred to as 10 V memory (variable) and is a 16-bit location normally used to manipulate data/numbers, store data/numbers, Word Locations – 16 bits etc. Some information is automatically stored in V11 memory. For example, the timer current values are 0 1 0 1 00 0 0 0 0 1 0 0 1 0 1 stored in V-memory. 12 V–Memory Locations for Discrete Memory Areas 13 The discrete memory area is for inputs, outputs, control relays, special relays, stages, timer status bits and counter status bits. However, you can also access the bit data types as a V14 memory word. Each V-memory location contains 16 consecutive discrete locations. For example, the following diagram shows how the X input points are mapped into V-memory locations. A 16 Discrete (X) Input Points B C V40400 These discrete memory areas and their corresponding V-memory ranges are listed in the D memory area table for the DL230, DL240, DL250–1 and DL260 CPUs in this chapter. With any PLC system, you generally have many different types of information to process. This includes input device status, output device status, various timing elements, parts counts, etc. It is important to understand how the system represents and stores the various types of data. For example, you need to know how the system identifies input points, output points, data words, etc. The following paragraphs discuss the various memory types used in the DL205 CPUs. A memory map overview for the DL230, DL240, DL250–1 and DL260 CPUs follows the memory descriptions.
X0
X1
X2
X3
X0 _ X7
X10 _ X17
Y0 _ Y7
X4
X5
X6
X7
X10 X11 X12 X13 X14 X15 X16 X17
X17 X16 X15 X14 X13 X12 X11 X10
Bit # 15
14
13
12
11
10
9
8
X7
X6
X5
X4
X3
X2
X1
X0
7
6
5
4
3
2
1
0
DL205 User Manual, 4th Edition, Rev. A
3–37
Page 132
Chapter 3: CPU Specifications and Operations
Input Points (X Data Type)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 3–38
The discrete input points are noted by an X data type. There are up to 512 discrete input points available with the DL205 CPUs. In this example, the output point Y0 will be turned on when input X0 energizes.
X0
Y0 OUT
X1
Y1 OUT
X10
C5 OUT
C5
Y10 OUT
Output Points (Y Data Type) The discrete output points are noted by a Y data type. There are up to 512 discrete output points available with the DL205 CPUs. In this example, output point Y1 will turn on when input X1 energizes.
Control Relays (C Data Type) Control relays are discrete bits normally used to control the user program. The control relays do not represent a real world device, that is, they cannot be physically tied to switches, output coils, etc. They are internal to the CPU. Control relays can be programmed as discrete inputs or discrete outputs. These locations are used in programming the discrete memory locations (C) or the corresponding word location which has 16 consecutive discrete locations. In this example, memory location C5 will energize when input X10 turns on. The second rung shows a simple example of how to use a control relay as an input.
Y20 OUT
Timers and Timer Status Bits (T Data type) The amount of timers available depends on the model of CPU you are using. The tables at the end of this section provide the number of timers for the DL230, DL240, D2-250-1 and DL260. Regardless of the number of timers, you have access to timer status bits that reflect the relationship between the current value and the preset value of a specified timer. The timer status bit will be on when the current value is equal to or greater than the preset value of a corresponding timer. When input X0 turns on, timer T1 will start. When the timer reaches the preset of 3 seconds (K of 30) timer status contact T1 turns on. When T1 turns on, output Y12 turns on.
DL205 User Manual, 4th Edition, Rev. A
X0
TMR
T1 K30
T1
Y12 OUT
Page 133
Chapter 3: CPU Specifications and Operations
Timer Current Values (V Data Type) Some information is automatically stored in V-memory, such as the current values associated with timers. For example, V0 holds the current value for Timer 0, V1 holds the current value for Timer 1, etc. These are 4digit BCD values. The primary reason for this is programming flexibility. The example shows how you can use relational contacts to monitor several time intervals from a single timer.
X0
TMR T1 K1000
1 2 3 4 Counters and Counter Status Bits (CT Data type) You have access to counter status bits that reflect the relationship between the current value and the preset 5 value of a specified counter. The counter status bit will be on when the current value is equal to or greater than 6 the preset value of a corresponding counter. 7 Each time contact X0 transitions from off to on, the counter increments by one. (If X1 comes on, the counter is reset to zero.) When the counter reaches the 8 preset of 10 counts (K of 10) counter status contact CT3 turns on. When CT3 turns on, output Y12 turns 9 on. 10 Counter Current Values (V Data Type) Just like the timers, the counter current values are also 11 automatically stored in V-memory. For example, V1000 holds the current value for Counter CT0, V1001 holds 12 the current value for Counter CT1, etc. These are 4digit BCD values. The primary reason for this is programming flexibility. The example shows how you 13 can use relational contacts to monitor the counter values. 14 Word Memory (V Data Type) A Word memory is referred to as V-memory (variable) and is a 16-bit location normally used to manipulate B data/numbers, store data/numbers, etc. Some information is automatically stored in V-memory. For example, the timer current values are stored in VC Word Locations – 16 bits memory. The example shows how a four-digit BCD constant is loaded into the accumulator and then stored 0 0 0 1 0 0 1 1 0 1 0 0 0 1 0 1 D in a V-memory location. V1
K30
Y12 OUT
V1
K50
Y13 OUT
V1
K75
V1
X0
K100
Y14 OUT
CNT
CT3
K10
X1
CT3
Y12 OUT
X0
CNT
CT3
K10
X1
V1003
K1
Y12 OUT
V1003
K3
Y13 OUT
V1003
K5
V1003
X0
K8
Y14 OUT
LD
K1345
OUT V1400
1
3
4
DL205 User Manual, 4th Edition, Rev. A
5
3–39
Page 134
Chapter 3: CPU Specifications and Operations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 3–40
Stages (S Data type) Stages are used in RLLPLUS programs to create a structured program, similar to a flowchart. Each program stage denotes a program segment. When the program segment, or stage, is active, the logic within that segment is executed. If the stage is off, or inactive, the logic is not executed and the CPU skips to the next active stage. (See Chapter 7 for a more detailed description of RLLPLUS programming.) Each stage also has a discrete status bit that can be used as an input to indicate whether the stage is active or inactive. If the stage is active, then the status bit is on. If the stage is inactive, then the status bit is off. This status bit can also be turned on or off by other instructions, such as the SET or RESET instructions. This allows you to easily control stages throughout the program.
ISG S0000
Wait forStart Start
S1 JMP
X0 S500 JMP SG
Check for a Part
S0001
Part Present
S2 JMP
X1 Part Present
S6 JMP
X1 SG
Clamp the part
S0002
Clamp SET S400 S3 JMP
Part Locked X2
Special Relays (SP Data Type) Special relays are discrete memory locations with pre-defined functionality. There are many different types of special relays. For example, some aid in program development, others provide system operating status information, etc. Appendix D provides a complete listing of the special relays. In this example, control relay C10 will energize for 50 ms and de–energize for 50 ms because SP5 is a pre–defined relay that will be on for 50 ms and off for 50 ms.
SP5
SP4: 1 second clock SP5: 100 ms clock SP6: 50 ms clock
Remote I/O Points (GX Data Type) Remote I/O points are represented by global relays. They are generally used only to control remote I/O, but they can be used as normal control relays when remote I/O is not used in the system. In this example, memory location GX0 represents an output point and memory location GX10 represents an input point.
DL205 User Manual, 4th Edition, Rev. A
C10 OUT
X3
GX0 OUT
GX10
Y12 OUT