The text of a manual · part 22 of 42
DL305 User Manual: Chapter 8: System Operation, pages 162 to 171
Pages 162 to 171 of 359, from DL305 User Manual
The original document is the PDF (4.9 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 D3-08TD2, AutomationDirect D3-16TD2, Konnect-It D3-08TD2, Koyo D3-08TD2, Konnect-It D3-16TD2 and Koyo D3-16TD2
Page 162
System Operation
8--11
It is important to note the DL305 CPUs only retain the forced value for one scan if the input point used corresponds to a module that is installed in the base. The following example shows how the forcing actually works on the next CPU scan. Result of previous scan 030
Force input 030 ON
040
On due to 030 forced ON
CPU Scan
Field Device
Update I/O Points
I/O Modules
OFF
030
OFF
031
ON
032
ON
033
... ... The CPU reads the inputs from the local and expansion bases and stores the status in an input image register.
032 031 030 ON OFF OFF Input Image Register
... ...
... 042 041 040 ... ON OFF OFF Output Image Register
... ...
Service Peripherals
The application program uses the image register to solve the program. In this case, output 040 is turned off since the force of input 030 is no longer valid.
Service Monitoring & Forcing ... ...
032 031 030 ON OFF OFF Input Image Register
... ...
Solve Application Program 030 040
As you can see from the example, the input forcing will not be valid when the CPU reads the input status on the next scan. Output point forcing works in a similar manner. That is, if you force an output on and the application program results dictate the output should be turned on, then the output image register will show the results of the application program instead of the forcing request. This is discussed in more detail in the next section.
DL305 User Manual, Rev. D
System Operation
Since the programming device did not issue another request for a force, the image register maintains the status obtained during the reading of the inputs.
Page 163
8--12
System Operation
Solve Application Program
The CPU evaluates each instruction in the application program during this segment of the cycle. The instructions define the relationship between the input conditions and the desired output response. The CPU uses the output image register area to store the status of the desired action for the outputs. The actual outputs are updated during the Update I/O Points segment of the cycle. The internal control relays (C), stages (S), and data registers (R) are also updated in this segment. You may recall the CPU may have obtained and stored forcing information when it serviced any peripheral devices. If any output points or register locations have been forced, the output image register also contains this information.
System Operation
NOTE: If an output point was used in the application program, the results of the program solution will overwrite any forcing information that was stored. For example, if output 030 was forced on by the programming device, and a rung containing 030 was evaluated such that 030 should be turned off, then the output image register will show that 030 should be off. Of course, you can force output points that are not used in the application program. In this case, the point remains forced because there is no solution that results from the application program execution.
DL305 User Manual, Rev. D
Page 164
System Operation
8pt
8pt
8pt
16pt
4ch.
16pt
Relay
Output
Input
Input
Output
Input
050 -057
040 -047
030 -037
020 027 -120 127
010 017 -110 117
000 007 -100 107
8--13
CPU Scan
Field Device
Update I/O Points
I/O Modules
030
OFF
031
ON
032
ON
033
The CPU reads the inputs from the local and expansion bases and stores the status in an input image register.
032 031 030 ON OFF OFF Input Image Register
... ...
... 042 041 040 ... ON OFF OFF Output Image Register
... ...
Service Peripherals
Force input 030 ON Force output 041 ON
The application program uses the forced value to solve the application program. In this example, 040 will be turned on because the force changed the status of 030 in the image register.
Notice output 041 is also on. This output was forced on by the programming device and since it was not used in the application program, the forced status is maintained.
Service Monitoring & forcing ... ...
032 031 030 ON OFF ON Input Image Register
... ...
042 041 040 ... ... ON ON OFF Output Image Register
... ...
Solve Application Program 030
... ... ... ...
042 ON 222 ON
040
041 ON 221 ON
040 ON 220 OFF
... ... ... ...
Output Image Register Contains I/O, CRs, etc.
DL305 User Manual, Rev. D
System Operation
OFF
... ...
Page 165
8--14
System Operation
I/O Response Time Is Timing Important I/O response time is the amount of time required for the control system to sense a change in an input point and update a corresponding output point. In the majority of for Your applications, the CPU performs this task in such a short period of time you may never Application? have to concern yourself with the aspects of system timing. However, some applications do require extremely fast update times. In these cases, you may need to know how to to determine the amount of time spent during the various segments of operation. There are four things that can affect the I/O response time. S The point in the cycle when the field input changes states S Input module Off to On delay time S CPU scan time S Output module Off to On delay time The next paragraphs show how these items interact to affect the response time.
System Operation
Normal Minimum I/O Response
The I/O response time is shortest when the module senses the input change just before the I/O Update portion of the execution cycle. In this case the input status is read, the application program is solved, and the output point gets updated on the following scan. The following diagram shows an example of the timing for this situation. Scan Solve Program
Solve Program
Scan
Solve Program
Update I/O
Update I/O
CPU Reads Inputs
CPU Writes Outputs
Solve Program
Field Input
Input Module Off/On Delay
Output Module Off/On Delay I/O Response Time
In this case, you can calculate the response time by simply adding the following items. Input Delay + Scan Time + Output Delay = Response Time
DL305 User Manual, Rev. D
Page 166
System Operation Normal Maximum I/O Response
8--15
The I/O response time is longest when the module senses the input change just after the Update I/O portion of the execution cycle. In this case the new input status does not get read until the following scan. The following diagram shows an example of the timing for this situation. Scan
Scan
Solve Program
Solve Program
Solve Program
Solve Program
Update I/O
Field Input CPU Reads Input change
CPU Writes Output change
Input Module Off/On Delay
Output Module Off/On Delay I/O Response Time
Improving Response Time
There are a few things you can do the help improve throughput. S You can try to choose instructions with faster execution times S You can choose modules that have faster response times
DL305 User Manual, Rev. D
System Operation
In this case, you can calculate the response time by simply adding the following items. Input Delay +(2 x Scan Time) + Output Delay = Response Time
Page 167
8--16
System Operation
CPU Scan Time Considerations The scan time covers all the cyclical tasks that are performed by the operating system. This information can be very important when evaluating the performance of a system. As we’ve shown previously there are several segments that make up the overall execution cycle. Each of these segments requires a certain amount of time to complete. Of all the segments, the only ones you really need to understand are those that occur during Run Mode. Even within this portion, your primary concern should be to understand the instruction execution times.
Update I/O Points Service Peripherals Service Monitoring & Forcing
System Operation
Solve Application Program
DL330 / DL330P Scan Calculation
The following table provides execution timing guidelines for the execution cycle. A Input / Output Update B
Service Peripherals, Monitoring, and Forcing
C Application Program Solution
D A timer interrupt occurs every 2.5ms during the scan. The interrupt requires approximately 266μs to service. So, the larger the program, the more timer interrupts.
A = 3.3 ms typical I/O update B = 0 -- 5.2 ms maximum to service peripherals, monitoring, and forcing C = Total of instruction execution time D = 266μs x A + B + C + D 2.5ms
Actual Scan = A + B + C + D NOTE: There are other events that occur during the execution cycle, but the areas shown are the most important. This information is provided so you will understand the basic scan calculations. Scan time can vary from scan-to-scan.
DL305 User Manual, Rev. D
Page 168
System Operation DL340 Scan Calculation
8--17
Typical scan overhead is from 2.5 -- 3.5ms. However, the following table provides more precise execution timing guidelines for the execution cycle. A Input / Output Update B
Service Peripherals, Monitoring, and Forcing
C Application Program Solution
D A timer interrupt occurs every 2.5ms during the scan. The interrupt requires approximately 200μs to service. So, the larger the program, the more timer interrupts.
A = 2 ms typical I/O update B = 0 -- 1.2 ms maximum to service peripherals, monitoring, and forcing C = Total of instruction execution time 2.5ms
Actual Scan = A + B + C + D NOTE: There are other events that occur during the execution cycle, but the areas shown are the most important. This information is provided so you will understand the basic scan calculations. Scan time can vary from scan-to-scan.
DL305 User Manual, Rev. D
System Operation
D = 200 μs x A + B + C + D
Page 169
8--18
System Operation
System Operation
Application Program Execution
The CPU processes the program from 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 You can add the execution times for all the instructions in your program to determine how much time is required to execute the instructions. For example, the execution time for a DL330 running the program shown would be calculated as follows. Instruction
Time
STR 000 OR 160 ANDN 001 OUT 020 STRN 161 DSTR K10 STRN 162 DOUT R400 STRN 163 DSTR K50 STRN 164 DOUT R402 STR 005 ANDN 010 OUT 021 END
6.6μs 6.6μs 8.4μs 7.5μs 9.1μs 14.3μs 9.1μs 52.6μs 9.1μs 14.3μs 9.1μs 52.6μs 6.6μs 8.4μs 7.5μs μ0μs
TOTAL
221.8μs
000
001
020 OUT
160
161
DSTR F50 K10
162
DOUT F60 R400
163
DSTR F50 K50
164
005
DOUT F60 R402 010
021 OUT
END
NOTE: Appendix C provides the instruction execution times for the DL305 CPUs.
DL305 User Manual, Rev. D
Page 170
System Operation
8--19
Memory Map 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 DL305 CPUs. NOTE: The DL305 CPUs do not all have the same memory ranges. Make sure you review the detailed memory maps at the end of this section to determine the available memory types for your particular model of CPU. Octal Numbering System
All memory locations or areas are numbered in Octal (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 numbers with the digits 8 or 9.
8pt Relay
8pt Output
8pt Output
16pt Input
4ch. (Analog)
16pt Input
050 -057
040 -047
030 -037
020 027 -120 127
010 017 -110 117
000 007 -100 107
100 101 102 103 104 105 106 107
Two Basic Memory Types: Discrete and Word
As you examine the different memory types, you’ll notice two types of memory in the DL305, discrete and word memory. Discrete memory is one bit that can be either a 1 or a 0. Word memory is referred to as Data Register memory and is an 8-bit location normally used to manipulate data/numbers, store data/numbers, etc. Some information is automatically stored in Register (R) memory. For example, the timer current values are stored in Registers that correspond to the timer or counter number. So, the current value for timer T600 is automatically stored in R600.
Discrete -- On or Off, 1 bit 000 or
Word Locations -- 8 bits 0 0 1 0 0 1 0 1
DL305 User Manual, Rev. D
000
System Operation
000 001 002 003 004 005 006 007
Page 171
8--20
System Operation
R Memory Locations for Discrete Memory Areas
The discrete memory area is for inputs, outputs, control relays, etc. However, you can also access the bit data types as an R-memory word. Each R-memory location contains 8 consecutive discrete locations. Remember, the DL305 system does not have a separate memory type for input and output points. The type of point assigned to the location depends on the type of module installed in the slot that corresponds to the register location. Also, the number of registers assigned to the module depends on the number of points. For example, a 16-point module would require two registers since each register only contains 8 bits. The following diagram shows how the points for a 16-point module installed in the slot next to the CPU would map into registers. 16 Discrete Input Module 107 106 105 104 103 102 101 100
Bit # 7
6
5
4
3
2
1
0
007 006 005 004 003 002 001 000
7
6
System Operation
R010
5
4
3
2
1
0
R000
These discrete memory areas and their corresponding R-memory ranges are listed in the memory area tables at the end of this chapter. I/O Points
The discrete input and output points do not have separate data types. The type of point assigned to the reference address depends on the type of module installed in the base. Depending on the type of CPU, you can have up to 184 I/O points in a DL305 system. In the first example, output point 010 will 1st Slot -- Input, 2nd Slot -- Output be turned on when input 000 energizes. 000 010 This assumes an 8-point input module is OUT installed in the first slot and an 8-point output module is installed in the second slot. 1st Slot -- Output, 2nd Slot -- Input The second example shows how the numbers can represent a different type of point. For this example, the module positions were reversed.
010
000 OUT
NOTE: Unused I/O references can be used as control relays in the application program.
DL305 User Manual, Rev. D