The text of a manual · part 14 of 60
DL205 PLC User Manual, Volume 1 of 2, pages 131 to 140
Pages 131 to 140 of 598
The original document is the PDF (12 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 AutomationDirect D2-04TD1, AutomationDirect D2-08TD2, AutomationDirect D2-16ND3-2, AutomationDirect D2-32ND3, Konnect-It D2-04TD1, Koyo D2-04TD1, Konnect-It D2-08TD2, Koyo D2-08TD2, and 5 more models
Page 131
Chapter 3: CPU Specifications and Operations
PLC Numbering Systems
1 2 ? 3 4 5 6 7 PLC Resources PLCs offer a fixed number of resources, depending on the model and configuration. We use the word “resources” to include variable memory (V-memory), I/O points, timers, counters, 8 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 eight 9 than ten, because eight is an even power of two. Octal means simply counting in groups of eight. Decimal 1 2 3 4 5 6 7 8 10 In the figure to the right, there are eight circles. The quantity in decimal is “8,” but in octal it is 11 “10” (8 and 9 are not valid in octal). In octal, Octal 1 2 3 4 5 6 7 10 “10” means 1 group of 8 plus 0 (no individuals). In the figure below, we have two groups of eight circles. Counting in octal we have “20.”items, 12 meaning two groups of eight, plus zero individuals Don’t say “twenty,” say “two–zero octal”. This makes a clear distinction between number systems. 13 9 10 11 12 13 14 15 16 Decimal 1 2 3 4 5 6 7 8 14 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20 Octal A After counting PLC resources, it’s time to access PLC resources (there’s a difference). The CPU B instruction set accesses resources of the PLC using octal addresses. Octal addresses are the same as octal quantities, except they start counting at zero. The number zero is significant to a C computer, so we don’t skip it. X= 0 1 2 3 4 5 6 7 Our circles are in an array of square containers to the right. X D To access a resource, our PLC instruction will address its octal
49.832 binary
If you are a new PLC user or are using DirectLOGIC ? 1482 BCD PLCs for the first time, please take a moment to study ? 3 0402 ? ? how our PLCs use numbers. You’ll find that each PLC 3A9 ASCII 7 manufacturer has its own conventions on the use of hexadecimal numbers in their PLCs. Take a moment to familiarize 1001011011 1011 –961428 yourself with how numbers are used in DirectLOGIC ? PLCs. The information you learn here applies to all our decimal A 72B ? –300124 177 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).
location using the octal references shown. If these were 1 X counters, “CT14” would access the black circle location. 2 X
DL205 User Manual, 4th Edition, Rev. D
3-35
Page 132
Chapter 3: CPU Specifications and Operations
V–Memory
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 3-36
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 data is 16-bit binary, but we rarely program the data registers one bit at a time. We use 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 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 V-memory 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 4 binary bits (a nibble). This permits each V-memory location to store 4 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 4-bit 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. D
Page 133
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 8 Discrete and Word Locations Discrete – On or Off, 1 bit As you examine the different memory types, you’ll 9 X0 notice two types of memory in the DL205, discrete 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 11 etc. Some information is automatically stored in 0 1 0 1 00 0 0 0 0 1 0 0 1 0 1 V-memory. For example, the timer current values are stored in V-memory. 12 13 V–Memory Locations for Discrete Memory Areas 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 V-memory 14 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 D These discrete memory areas and their corresponding V-memory ranges are listed in the 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 memory area table for the DL230, DL240, DL250–1 and DL260 CPUs in this chapter. DL205 User Manual, 4th Edition, Rev. D
3-37
Page 134
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. Up to 512 discrete input points are 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. Up to 512 discrete output points are 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. Control relays are internal to the CPU and 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 number 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. D
X0
T1
TMR
K30
T1
Y12 OUT
Page 135
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 4-digit 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) 5 You have access to counter status bits that reflect the relationship between the current value and the preset value of a specified counter. The counter status bit will 6 be on when the current value is equal to or greater than 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. Counter Current Values (V Data Type) 10 Just like the timers, the counter current values are also automatically stored in V-memory. For example, 11 V1000 holds the current value for Counter CT0, V1001 holds the current value for Counter CT1, etc. 12 These are 4-digit BCD values. The primary reason for this is programming flexibility. The example shows how you can use relational contacts to monitor the 13 counter values. 14 Word Memory (V Data Type) Word memory is referred to as V-memory (variable) and is a 16-bit location normally used to manipulate A data/numbers, store data/numbers, etc. Some information is automatically stored in V-memory. B For example, the timer current values are stored in V-memory. The example shows how a four-digit BCD constant is loaded into the accumulator and then C Word Locations – 16 bits stored in a V-memory location. 0 0 0 1 00 1 1 0 1 0 0 0 1 0 1 D V1
K30
Y12 OUT
V1
K50
Y13 OUT
V1
K75
V1
X0
K100
Y14 OUT
CNT
CT3
K10
X1
CT3
Y12 OUT
X0
CNT
K10
CT3
X1
V1003
K1
Y12 OUT
V1003
K3
Y13 OUT
V1003
K5
V1003
X0
K8
LD
Y14 OUT
K1345
OUT V1400
1
3
4
DL205 User Manual, 4th Edition, Rev. D
5
3-39
Page 136
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 SG
S500 JMP
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 50ms and de–energize for 50 ms because SP5 is a pre–defined relay that will be on for 50ms and off for 50ms.
SP5
C10 OUT
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. D
X3
GX0 OUT
GX10
Y12 OUT
Page 137
Chapter 3: CPU Specifications and Operations
DL230 System V-memory System V-memory
V2320–V2377 V7620–V7627 V7620 V7621 V7622 V7623 V7624 V7625 V7626 V7627
Description of Contents The default location for multiple preset values for the UP counter. Locations for DV–1000 operator interface parameters Sets the V-memory location that contains the value. Sets the V-memory location that contains the message. Sets the total number (1 - 16) of V-memory locations to be displayed. Sets the V-memory location that contains the numbers to be displayed. Sets the V-memory location that contains the character code to be displayed. Sets the bit control pointer. Power Up mode change preset value password. Reserved for future use.
Default Values/Ranges N/A
V0–V2377 V0–V2377 1–16 V0–V2377 V0–V2377 V-memory location for X,Y, or C points used. 0,1,2,3,12 Default = 0000
V7630
Starting location for the multi–step presets for channel 1. The default value is Default: V2320 2320, which indicates the first value should be obtained from V2320. Since 24 Range: V0–V2320 presets are available, the default range is V2320 – V2377. You can change the starting point if necessary.
V7631–V7632 V7633
Not used Sets the desired mode for the high speed counter, interrupt, pulse catch, pulse train, and input filter (see the D2-CTRINT Manual, D2-CTRIF-M for more information). Location is also used for setting the with/without battery option, enable/disable CPU mode change, and power-up in Run Mode option.
N/A
V7634
Contains set-up information for high-speed counter, interrupt, pulse catch, pulse train output, and input filter for X0 (when D2–CTRINT is installed). Contains set up-information for high-speed counter, interrupt, pulse catch, pulse train output, and input filter for X1 (when D2–CTRINT is installed). Contains set-up information for high-speed counter, interrupt, pulse catch, pulse train output, and input filter for X2 (when D2–CTRINT is installed). Contains set-up information for high-speed counter, interrupt, pulse catch, pulse train output, and input filter for X3 (when D2–CTRINT is installed).
Default: 0000
V7635 V7636 V7637 V7640–V7642 V7640 V7641 V7642 V7643–V7647 V7751
Additional setup parameters for the DV-1000 Timer preset value pointer Counter preset value pointer Timer preset block size (high byte) / Counter preset block size (low byte) Not used Fault Message Error Code, stores the 4-digit code used with the FAULT instruction when the instruction is executed.
Default: 0000 Lower Byte Range: Range: 0–None 10–Up 40–Interrupt 50–Pulse Catch 60–Filtered discrete In. Upper Byte Range: Bits 8–11, 14,15: Unused Bit 12: With Batt. installed: 0 = disable BATT LED 1 = enable BATT LED Bit 13: Power-up in Run
Default: 0000 Default: 0000 Default: 0000 V2000–V2377 V2000–V2377 1–99 N/A N/A
DL205 User Manual, 4th Edition, Rev. D
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
3-41
Page 138
Chapter 3: CPU Specifications and Operations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
System V-memory V7752 V7753 V7754 V7755 V7756 V7757 V7760–V7764 V7765 V7666–V7774 V7775 V7776 V7777
3-42
Description of Contents I/O Configuration Error, tores the module ID code for the module that does not match the current configuration. I/O Configuration Error, stores the correct module ID code. I/O Configuration Error, identifies the base and slot number. Error code, stores the fatal error code. Error code, stores the major error code. Error code, stores the minor error code. Module Error the slot number and error code where an I/O error occurs. Scan, the total number of scan cycles that have occurred since the last Program Mode to Run Mode transition. Not used Scan, stores the current scan time (milliseconds). Scan, the minimum scan time that has occurred since the last Program Mode to Run Mode transition (milliseconds). Scan, the maximum scan time that has occurred since the last Program Mode to Run Mode transition (milliseconds).
DL205 User Manual, 4th Edition, Rev. D
Default Values/Ranges N/A N/A
N/A
N/A N/A N/A N/A
Page 139
Chapter 3: CPU Specifications and Operations
DL240 System V-memory System V-memory
Default Values/ Ranges
Description of Contents default location for multiple preset values for UP/DWN and UP counter 1 or pulse N/A V3630–V3707 The output function. V3710–V3767 The default location for multiple preset values for UP/DWN and UP counter 2. V3770–V3773 Not used V3774–V3777 Default locations for analog potentiometer data (channels 1–4, respectively).
N/A N/A Range: 0 – 9999
V7620–V7627 Locations for DV–1000 operator interface parameters V7620 Sets the V-memory location that contains the value. V7621 Sets the V-memory location that contains the message. V7622 Sets the total number (1 – 16) of V-memory locations to be displayed. V7623 Sets the V-memory location that contains the numbers to be displayed. V7624 Sets the V-memory location that contains the character code to be displayed. V7625 Sets the bit control pointer V7626 Power Up Mode V7627 Change Preset Value Password.
V0 – V3760 V0 – V3760 1 – 16 V0 – V3760 V0 – V3760 V-memory location for X, Y, or C points used. 0,1,2,3,12 Default=0000
V7630 V7631
V7632
Starting location for the multi–step presets for channel 1. Since there are 24 presets available, the default range is V3630 – V3707. You can change the starting point if necessary. Starting location for the multi–step presets for channel 2. Since there are 24 presets available, the default range is V3710– V3767. You can change the starting point if necessary.
Contains the baud rate setting for Port 2. You can use AUX 56 (from the Handheld Programmer) or, use DirectSOFT to set the port parameters if 9600 baud is unacceptable. Also allows you to set a delay time between the assertion of the RTS signal and the transmission of data. This is useful for radio modems that require a key-up delay before data is transmitted. e.g., a value of 0302 sets 10ms Turnaround Delay (TAD) and 9600 baud.
Default: V3630 Range: V0 – V3710 Default: V3710 Range: V0 – V3710 Default: 2 – 9600 baud Lower Byte = Baud Rate Lower Byte Range: 00 = 300 01 = 1200 02 = 9600 03 = 19.2K Upper Byte = Time Delay Upper Byte Range: 01 = 2ms 02 = 5ms 03 = 10ms 04 = 20ms 05 = 50ms 06 = 100ms 07 = 500ms
DL205 User Manual, 4th Edition, Rev. D
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 3-43
Page 140
Chapter 3: CPU Specifications and Operations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
System V-memory
Description of Contents
V7633
Sets the desired mode for the high speed counter, interrupt, pulse catch, pulse train, and input filter (see the D2-CTRINT manual, D2-CTRIF-M, for more information). Location is also used for setting the with/without battery option, enable/disable CPU mode change.
V7634
Contains set-up information for high-speed counter, interrupt, pulse catch, pulse train output, and input filter for X0 (when D2–CTRINT is installed). Contains set-up information for high-speed counter, interrupt, pulse catch, pulse train output, and input filter for X1 (when D2–CTRINT is installed). Contains set-up information for high-speed counter, interrupt, pulse catch, pulse train output, and input filter for X2 (when D2–CTRINT is installed). Contains set-up information for high-speed counter, interrupt, pulse catch, pulse train output, and input filter for X3 (when D2–CTRINT is installed).
V7635 V7636 V7637
Default Values/ Ranges Default: 0000 Lower Byte Range: 0 – None 10 – Up 20 – Up/Dwn. 30 – Pulse Out 40 – Interrupt 50 – Pulse Catch 60 – Filtered Dis. Upper Byte Range: Bits 8 – 11, 15 Unused Bit 12: With Batt. installed: 0 = disable BATT LED 1 = enable BATT LED Bit 13: Power-up in Run Bit 14: Mode chg. enable (K-sequence only) Default: 0000 Default: 0000 Default: 0000 Default: 0000
Default: 0000 Range: 0 – 9999 Default: 0000 V7642–V7643 Location for setting the lower and upper limits for the CH2 analog pot. Range: 0 – 9999 Default: 0000 V7644–V7645 Location for setting the lower and upper limits for the CH3 analog pot. Range: 0 – 9999 Default: 0000 V7646–V7647 Location for setting the lower and upper limits for the CH4 analog pot. Range: 0 – 9999 V7650–V7737 Locations reserved for set-up information used with future options (remote I/O and data communications). V7720–V7722 Locations for DV–1000 operator interface parameters. V7720 Titled Timer preset value pointer . V2000–V2377 V2000–V2377 V7721 Titled Counter preset value pointer. 1–99 V7722 HiByte-Titled Timer preset block size, LoByte-Titled Counter preset block size. V7746 Location contains the battery voltage, accurate to 0.1V. For example, a value of 32 indicates 3.2 volts. V7747 Location contains a 10ms counter. This location increments once every 10ms. Fault Message Error Code, stores the 4-digit code used with the FAULT instruction when the instruction is V7751 executed. If you’ve used ASCII messages (DL240 only), then the data label (DLBL) reference number for that message is stored here. V7752 I/O configuration Error, stores the module ID code for the module that does not match the current configuration. V7640–V7641 Location for setting the lower and upper limits for the CH1 analog pot.
3-44
DL205 User Manual, 4th Edition, Rev. D