8 1 System Operation In This Chapter. . . .

8 1 System Operation In This Chapter. . . .
System Operation
18
In This Chapter. . . .
— Introduction
— CPU Operating System
— Initial Mode Setting and Memory Initialization
— Program Mode Operation
— Run Mode Operation
— I/O Response Time
— CPU Scan Time Considerations
— Memory Map
— I/O Point Bit Map
— Control Relay Bit Map
— Special Relays
— Timer / Counter Registers and Contacts
— Data Registers
— Stage Control / Status Bit Map
— Shift Register Bit Map
— Special Registers
8--2
System Operation
System Operation
Introduction
Achieving the proper control for your equipment or process requires a good
understanding of how the DL305 CPUs control all aspects of the system operation.
This includes many things, such as I/O updates, program execution, etc. Take a few
minutes to understand how the CPU stores and processes information. For more
complex applications, this knowledge will make it easier to program and debug your
application program to meet your system performance requirements.
There are four primary things you need to understand before you create your
application program
S CPU Operating System — the CPU is the heart of the system. It
manages all aspects of system control. A quick overview of all the steps
is provided in the next section.
S CPU Operating Modes — the CPU has different operating modes that
allow different types of operations. There are two primary modes of
operation, Program Mode and Run Mode.
S CPU Timing — it is important you understand how the CPU timing can
affect the system operation. The two most important areas are the I/O
response time and the CPU scan time.
S CPU Memory Map — The DL305 CPUs offer a wide variety of memory
types, such as timers, counters, inputs, etc. It is important to understand
what memory types are available and how the memory areas are
organized.
The remainder of this chapter discusses these items in detail.
DL305 User Manual, Rev. D
System Operation
8--3
CPU Operating System
After the initial power-up sequence, the DL305 CPUs process data cyclically. There
are several tasks the CPU must perform during each cycle, such as updating the I/O
status, servicing external communications, executing the application program, etc.
There are many different segments of execution, but the overwhelming majority of
your concerns will be with the portion of the execution cycle that occurs during Run
Mode. These operations will be discussed throughout the remainder of this chapter.
DL305 CPU
Operational Flow
Chart
Power up
#1
Initial Mode Setting
Initialize memory
Is program
memory OK?
NO
YES
YES
What mode is the
programmer in?
RUN
System Operation
Is programmer
connected?
Display error code
NO
User changes
programmer to
program mode
PGM/
Cassette
What is the
last mode?
PGM/
Cassette
RUN
I/O update
Service peripherals
Service peripherals
Service for force
operation or
monitoring
Operation of program
or cassette mode
PGM
What is the mode?
Executes user program
RUN
DL305 User Manual, Rev. D
8--4
System Operation
Initial Mode Setting and Memory Initialization
Flow Chart for
The previous flowchart contained a step called Initial Mode Setting. Once power has
Initial Mode Setting been connected to the system, the CPU executes the following procedure to
determine which mode of operation should be entered.
(#1)
NO
Is programmer
or Data Communication Unit
connected?
YES
What is
connected?
Data Communication Unit
Programmer
ONLINE or
OFFLINE?
ONLINE
OFFLINE
Is programmer
connected?
NO
PROM
YES
System Operation
What is the
current mode?
RUN
Service peripherals
Initialize Memory
DL305 User Manual, Rev. D
PGM
PGM
Select PGM/
Cassette mode
What is the
last mode?
RUN
What is the
program memory
RAM
System Operation
Memory
Initialization
8--5
Before the CPU can begin normal operation, all memory areas are initialized. The
CPU completes the following operations to initialize the memory areas.
Item
Procedure
I/O Points
Input Points: activated, CPU will monitor status.
Output Points: turned off
Control Relays
Non-Retentive: turned off
Retentive: retains the condition prior to the system
power interruption.
Shift Registers
Retains the condition prior to the system power
interruption.
Timer / Counter Current Values
Timers: reset to zero
Counters: retains the current count prior to the
system power interruption.
Stages
Non-Retentive: turned off
Retentive: retains the condition prior to the system
power interruption.
Data Registers
Retains the condition prior to the system power
interruption.
DL305 User Manual, Rev. D
System Operation
NOTE: Not all memory areas are retentive by default. See Chapter 3 for details on
how to set the CPU to have retentive memory. Also, the memory map section
provided later in this chapter shows the exact ranges that can be selected as
retentive.
8--6
System Operation
Program Mode Operation
System Operation
In Program Mode, the CPU does not
execute the application program or
update the output modules. The primary
use for Program Mode is to enter or
change an application program. You can
also use the program mode to set up
CPU parameters, such as the network
address for the communication port on
the DL340, retentive memory areas, etc.
You can use the Handheld Programmer
key switch to select Program Mode
operation, or you can use a DirectSOFT
menu option to change the CPU mode.
DL305 User Manual, Rev. D
Download Program
System Operation
8--7
Run Mode Operation
In Run Mode, the CPU executes the
application program and updates the I/O
system. You can perform many
operations during Run Mode. Some of
these include:
S
Monitor and change I/O point status
S
Update timer/counter preset values
S
Update Register memory locations
Even though there are many steps in the
overall flowchart of operation, the Run
Mode operation can be divided into a few
key areas. It is very important you
understand how each of these areas of
execution can affect the results of your
application program solutions.
Update I/O Points
Service Peripherals
Service Monitoring & Forcing
Solve Application Program
System Operation
DL305 User Manual, Rev. D
8--8
System Operation
Update I/O Points
The CPU reads the status of all input modules present in the local CPU base and
local expansion bases. The status of each input is stored in the input image register
area. The input image register data is used by the CPU when it solves the application
program.
You may be thinking, “What if an input changes after the CPU has read the inputs?”
Good question! Generally, the CPU program execution time is measured in
milliseconds, so in most cases this is not a problem. If you need to know more, I/O
response timing is explained in more detail later in this chapter.
The CPU also uses the output image register to update the output modules present
in the local CPU base and local expansion bases.
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
System Operation
CPU Scan
Field
Device
OFF
030
OFF
031
ON
032
ON
033
OFF
034
ON
035
OFF
036
OFF
037
OFF
040
OFF
041
ON
042
ON
043
OFF
044
ON
045
OFF
046
OFF
047
DL305 User Manual, Rev. D
Update I/O Points
I/O
Modules
...
...
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
Service Monitoring & Forcing
Solve Application Program
The CPU also writes the
status of the output image
register to the output
modules.
System Operation
8--9
Service Peripherals After the CPU updates the I/O points, it reads any attached peripheral devices. This
is primarily a communications service for any attached devices. For example, if you
were using an operator interface to read or write data, the CPU would service these
requests during this portion of the scan.
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
CPU Scan
Update I/O Points
...
...
...
...
...
042 041 040
...
ON OFF OFF
Output Image Register
...
...
Service Peripherals
Service Monitoring & Forcing
Solve Application Program
DL305 User Manual, Rev. D
System Operation
CPU services peripherals
through communication ports.
032 031 030
ON OFF OFF
Input Image Register
8--10
System Operation
Service for
After the CPU updates any communications requests from peripheral devices, it
determines if any forcing operations have been requested. The CPU also services
Monitoring and
Forcing Operations any monitoring requests during this portion. For example, if you are using the
Handheld Programmer to monitor the current value of a timer or counter, the CPU
will provide this information during this portion of the scan.
Here’s an example of one of the more popular requests. For example, you may want
to force an input on, even though it is really off. This allows you to change the point
status that was stored in the image register. This value will be valid until the image
register location is written to during the Update I/O Points segment of the next scan.
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
System Operation
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.
...
...
...
042 041 040
...
ON OFF OFF
Output Image Register
...
...
Service Peripherals
Force input 030 ON
The application program uses the
forced value to solve the
application program. In this
example, output 040 will be turned
on because the force changed the
status of input 030 in the image
register.
DL305 User Manual, Rev. D
032 031 030
ON OFF OFF
Input Image Register
...
...
Service Monitoring & Forcing
...
...
032 031 030
ON OFF ON
Input Image Register
...
...
Solve Application Program
030
040
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.
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
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
8--13
000
007
-100
107
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
...
...
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
Update
I/O
Solve
Program
Solve
Program
Update
I/O
Field Input
CPU Reads
Inputs
CPU Writes
Outputs
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
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
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
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
8--18
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.
System Operation
Instruction
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
TOTAL
Time
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
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
221.8μs
NOTE: Appendix C provides the instruction execution times for the DL305 CPUs.
DL305 User Manual, Rev. D
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)
050
-057
040
-047
030
-037
020
027
-120
127
010
017
-110
117
16pt
Input
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
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
8--21
System Operation
Control Relays
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.
Because of this, 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
contains
8
consecutive
discrete
locations.
010
160
OUT
160
020
OUT
021
OUT
In this example, memory location 160 will energize when input 010 turns on. The
second rung shows a simple example of how to use a control relay as an input.
NOTE: Some of the references normally assigned as Control Relays can also be
used to refer to a16-point I/O modules in some situations. Make sure you review the
memory maps at the end of this chapter if you use 16-point modules.
System Operation
DL305 User Manual, Rev. D
8--22
System Operation
Timers and
Timer Status Bits
(T Data type)
You can have up to 64 timers/counters in a DL305 CPU. Both the timers and
counters share the same memory area. This means you cannot have a timer T600
and a counter CT600 in the same program.
When you use these locations for timers, each timer has a status bit that reflects the
relationship between the current value and the timer preset value. The timer status
bit will be on when the current value is equal or greater than the preset value of a
corresponding timer. The DL330P does not support the status bit. Instead, you have
to use comparative boolean contacts. See Chapter 12 for details.
In the example shown, input 000 turns on
to start timer T600. When the timer
reaches the preset of 3 seconds (K of 30)
timer status contact T600 turns on. When
contact T600 turns on, output 022 is energized.
System Operation
Counters and
Counter Status
Bits
(CT Data type)
TMR
T600
K30
T600
022
OUT
You can have up to 64 timers/counters in a DL305 CPU. Both the timers and
counters share the same memory area. This means you cannot have a timer T600
and a counter CT600 in the same program.
When you use these locations for counters, each counter has a status bit that
reflects the relationship between the current count and the preset value. The counter
status bit will be on when the current value is equal to or greater than the counter
preset value. The DL330P does not support the status bit. Instead, you have to use
comparative boolean contacts. See Chapter 12 for details.
In the example shown, Each time contact
000 transitions from off to on, the counter
increments by one. (If 001 comes on, the
counter is reset to zero.) When the counter reaches the preset of 10 counts (K of
10) counter status contact CT603 turns
on. When CT603 turns on, output 022
turns on.
Counter
Current Values
(R Data Type)
000
As mentioned earlier, some information
is automatically stored in R memory. This
is true for the current values associated
with counters. For example, R600 holds
the current value for counter 600, R601
holds the current value for counter 601,
etc.
The primary reason for this is
programming flexibility. The example
shows how you can use comparative
contacts to monitor several count values
from a single counter.
DL305 User Manual, Rev. D
000
CNT
CT603
K10
001
CT603
000
CNT
CT600
K1000
001
CT600
CT600
CT600
=
=
=
022
OUT
K250
022
SET
K500
023
SET
K750
024
SET
8--23
System Operation
Data Registers
(R Data Type)
Stages
(S Data type)
A word memory location is referred to as
a Data Register, which is an 8-bit location
normally
used
to
manipulate
data/numbers, store data/numbers, etc.
Some information is automatically stored
in registers. For example, the timer
current values are automatically stored
in a register that corresponds to the timer
or counter number being used.
The example shows how a four-digit
BCD constant is loaded into the
accumulator and then stored in a
Register location. Notice two registers
are required to hold the 4-digit number.
DSTR
F50
K1345
OUT
R400
F60
Word Locations -- 8 bits
R401
0 0 0 1 00 1 1
1
3
R400
0 1 0 0 0 1 0 1
4
5
Ladder Representation
ISG
S0000
Wait for Start
Start
S1
JMP
000
SG
S150
JMP
Check for a Part
S0001
Part
Present
S2
JMP
001
Part
Present
S6
JMP
001
SG
Clamp the part
S0002
Part
Locked
002
DL305 User Manual, Rev. D
Clamp
SET
S140
S3
JMP
System Operation
Stages are used in RLL PLUS 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 10 for a more
detailed
description
of
RLL PLUS
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.
000
8--24
System Operation
Shift Registers
There are 128 bits available for use in Shift Registers with the DL330 and DL340
CPUs. You can still use Shift Registers in the DL330P CPU, but a separate range of
bits is not provided. You have to use the control relay points in the Shift Register
instructions. These are numbered from 400 to 577. Your first reaction may be to think
these are somehow related to the Data Registers with the same numbers. They are
completely separate areas and are not related.
The number of Shift Register instructions that can be used depends on how many
bits are used with each Shift Register. For example, if you have a DL330 and you use
16 bits in each Shift Register, you can have up to 8 Shift Registers. If you only used 8
bits in each one, then you could have up to 16 Shift Registers.
System Operation
In the example shown, contact 001
represents the data value (0 or 1) that will
be loaded into the shift register when the
clock input (002) is active. Each time the
clock input comes on, the data values are
shifted through the bit positions from 400
to 417. Input 003 resets the shift register
and sets all the bit positions back to zero.
Chapter 11 provides detailed instructions
on how to use shift registers.
Special Relays
Special Registers
(R 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
programming, others provide system
operating status information, etc.
In this example, special relay 375 will
energize for 50 ms and de--energize for
50 ms because relay 375 is a
pre--defined relay that will be on for 50 ms
and off for 50 ms.
001
Data Input
002
Clock Input
003
Reset Input
SR
400
375
417
020
OUT
There are also a few special registers that store various types of system information.
For example, the DL340 communication port parameters are set in special registers.
The detailed memory maps at the end of this chapter show special register
assignments for each CPU.
DL305 User Manual, Rev. D
System Operation
8--25
DL305 Aliases
An alias is an alternate way of referring to certain memory types, such as
timer/counter current values, register locations for I/O points, etc.. This makes some
instructions easier to understand. The use of the alias is optional, but some users
may find the alias to be helpful when developing a program. The table below shows
how the aliases can be used.
Address Start
Alias Start
Example
RC160
R16 is the 8--bit word memory reference for control relays
C160 through C167, hence its alias is RC160. R17 is the 8--bit
word memory reference for control relays C170 through C177,
hence its alias is RC170.
RS400
R40 is the 8--bit word memory reference for stage bits S400
through S407, hence its alias is RS400. R41 is the 8--bit word
memory reference for stage bits S410 through S417, hence its
alias is RS410.
R70
RIO700
R70 is the 8--bit word memory reference for discrete bits IO700
through IO707, hence its alias is RIO700. R71 is the 8--bit word
memory reference for discrete bits IO710 through IO717,
hence its alias is RIO710.
R77
RC770
R77 is the 8--bit word memory reference for control relays
C770 through C777, hence its alias is RC770.
R100
RC1000
R100 is the 8--bit word memory reference for control relays
C1000 through C1007, hence its alias is RC1000. R101 is the
8--bit word memory reference for control relays C1010 through
C1017, hence its alias is RC1010.
R107
RC1070
R107 is the 8--bit word memory reference for control relays
C1070 through C1077, hence its alias is RC1070.
TCA600
R600 is the 16--bit timer/counter accumulator value for
timer/counter 600, hence its alias is TCA600. R601 is the
16--bit timer/counter accumulator value for timer/counter 601,
hence its alias is TCA601.
R0
R16
R40
R600
DL305 User Manual, Rev. D
System Operation
RIO0
R0 is the 8--bit word memory reference for discrete bits IO0
through IO7, hence its alias is RIO0. R1 is the 8--bit word
memory reference for discrete bits IO10 through IO17, hence
its alias is RIO10.
8--26
System Operation
DL330 Memory
Map
System Operation
Memory Type
Discrete Memory
Reference
(octal)
Register Memory
Reference
(octal)
Qty.
Decimal
Input / Output
Points
000 -- 157
700 -- 767
R000 -- R015
R070 -- R076
168 Total
Control Relays
160 -- 373
R016 -- R037
140
Special Relays
374 -- 377
770 -- 777
R037
R077
12
Timers /
Counters
600 -- 673
674 -- 677*
None
64
Timer / Counter
Current Values
None
R600 -- R673
R674 -- R677*
Symbol
IO010
IO000
C160
C160
C376
C772
=
64
TMR
T600
K100
CTA600
=
CNT CT600
K10
K250
Contact valid for counters only.
Timer / Counter
Status Bits
T600 -- T673
T674 -- T677*
None
64
Data Words
None
R400 -- R563
116
Shift Registers
400 -- 577
None
128
Special
Registers
None
R574 -- R577
4
T600
None specific, used with many
instructions
SR
400
417
R574 -- R575 used with FAULT
R576 -- R577 Auxiliary Accumulator
* T/ C Setpoint Unit Only. Can be used as data registers if the Timer/Counter Setpoint Unit or Thumbwheel Interface Module is not used. R564 -- R573 contain the preset value used with the Timer /
Counter Setpoint Unit. R674 -- R677 contain the current values for these timers or counters.
DL305 User Manual, Rev. D
8--27
System Operation
DL330P Memory
Map
Memory Type
Discrete Memory
Reference
(octal)
Register Memory
Reference
(octal)
Qty.
Decimal
Symbol
Input / Output
Points
000 -- 157
700 -- 767
R000 -- R015
R070 -- R076
168 Total
Control Relays
160 -- 174
200 -- 277
R016 -- R017
R020 -- R027
77
C160
C160
Special Relays
175 -- 177
770 -- 777
R017
R077
11
C772
C376
Timers /
Counters
600 -- 673
674 -- 677*
None
64
Timer / Counter
Current Values
None
R600 -- R673
R674 -- R677*
64
Timer / Counter
Status Bits
T600 -- T673
T674 -- T677*
None
64
Data Words
None
R400 -- R563
116
Stages
S0 -- S177
R100 -- R117
128
None
R574 -- R577
=
4
TMR
T600
K100
CTA600
K250
CNT CT600
K10
TA600
≥
K250
≥
T600
None specific, used with many
instructions
SG
S1
S 001
R574 -- R575 used with FAULT
R576 -- R577 Auxiliary Accumulator
* T/ C Setpoint Unit Only. Can be used as data registers if the Timer/Counter Setpoint Unit or Thumbwheel Interface Module is not used, which
provides a total of 128 data registers.
R564 -- R573 contain the preset value used with the Timer / Counter Setpoint Unit. R674 -- R677 contain the current values for these timers or
counters
Timer / Counter Current Values Registers (T600 -- T677) are 16-bit registers.
DL305 User Manual, Rev. D
System Operation
Special
Registers
IO010
IO000
8--28
System Operation
DL340 Memory
Map
System Operation
Memory Type
Discrete Memory
Reference
(octal)
Register Memory
Reference
(octal)
Qty.
Decimal
Symbol
Input / Output
Points
000 -- 157
700 -- 767
R000 -- R015
R070 -- R076
168 Total
Control Relays
160 -- 373
1000 -- 1067
R016 -- R037
R100 -- R106
180
C160
C160
Special Relays
374 -- 377
770 -- 777
1070 -- 1077
R037
R077
R107
20
C772
C376
Timers /
Counters
600 -- 673
674 -- 677*
None
64
Timer / Counter
Current Values
None
R600 -- R673
R674 -- R677*
64
Timer / Counter
Status Bits
T600 -- T673
T674 -- T677*
None
64
Data Words
None
R400 -- R563
R700 -- R767
172
Shift Registers
400 -- 577
None
128
Special
Registers
None
R574 -- R577
R770 -- R777
12
IO010
IO000
=
TMR
T600
K100
CTA600
=
CNT CT600
K10
K250
Contact valid for counters only.
T600
None specific, used with many
instructions
SR
400
417
R574--R575 used with FAULT
R576--R577 Auxiliary Accumulator
R770--R777 Communications Setup
* T/ C Setpoint Unit Only. Can be used as data registers if the Timer/Counter Setpoint Unit or Thumbwheel Interface Module is not used. R564 -- R573
contain the preset value used with the Timer / Counter Setpoint Unit. R674 -- R677 contain the current values for these timers or counters.
Registers T600 -- T677 are 16-bit registers.
DL305 User Manual, Rev. D
System Operation
8--29
I/O Point Bit Map
These tables provide a listing of the individual Input points associated with each
register location for the DL330, DL330P, and DL340 CPUs.
MSB
006
016
026
036
046
056
066
076
106
116
126
136
146
156
166
176
706
716
726
736
746
756
766
005
015
025
035
045
055
065
075
105
115
125
135
145
155
165
175
705
715
725
735
745
755
765
004
014
024
034
044
054
064
074
104
114
124
134
144
154
164
174
704
714
724
734
744
754
764
003
013
023
033
043
053
063
073
103
113
123
133
143
153
163
173
703
713
723
733
743
753
763
LSB
002
012
022
032
042
052
062
072
102
112
122
132
142
152
162
172
702
712
722
732
742
752
762
001
011
021
031
041
051
061
071
101
111
121
131
141
151
161
171
701
711
721
731
741
751
761
000
010
020
030
040
050
060
070
100
110
120
130
140
150
160
170
700
710
720
730
740
750
760
Register
Number
R0
R1
R2
R3
R4
R5
R6
R7
R10
R11
R12
R13
R14
R15
n/a
n/a
R70
R71
R72
R73
R74
R75
R76
NOTE: 160 -- 167 can be used as I/O in a DL330 or DL330P CPU under certain
conditions. 160 -- 177 can be used as I/O in a DL340 CPU under certain conditions.
You should consult Chapter 4 to determine which configurations allow the use of
these points.
These points may be used as control relays. You cannot use them as both control
relays and as I/O points. Also, if you use these points as I/O, you cannot access
these I/O points as a Data Register reference using the DSTR5 (F55) and DOUT5
(F65) functions.
DL305 User Manual, Rev. D
System Operation
007
017
027
037
047
057
067
077
107
117
127
137
147
157
167
177
707
717
727
737
747
757
767
I/O References
8--30
System Operation
Control Relay Bit Map
The following tables provide a listing of the individual control relays associated with
each register location for the DL305 CPUs.
NOTE: If a 16 pt module is used in Slot 6 for the DL330 or DL330P CPU, 160 through
167 will not be available for control relay assignments. If a 16pt module is used in
Slot 6 and/or Slot 7 for a DL340 CPU, 160--167 and/or 170--177 are not available for
control relay assignments. You cannot use these points as both control relays and as
I/O points. If you use these points as I/O points, you still enter them as C160--C177 in
DirectSOFT.
Also, if you use these points as I/O, you cannot access these I/O points as a Data
Register reference using the DSTR5 (F55) and DOUT5 (F65) functions.
System Operation
MSB
167
177
207
217
227
237
247
257
267
277
307
317
327
337
347
357
367
166
176
206
216
226
236
246
256
266
276
306
316
326
336
346
356
366
DL330
Control Relay References
165
164
163
162
175
174
173
172
205
204
203
202
215
214
213
212
225
224
223
222
235
234
233
232
245
244
243
242
255
254
253
252
265
264
263
262
275
274
273
272
305
304
303
302
315
314
313
312
325
324
323
322
335
334
333
332
345
344
343
342
355
354
353
352
365
364
363
362
373
372
LSB
161
171
201
211
221
231
241
251
261
271
301
311
321
331
341
351
361
371
160
170
200
210
220
230
240
250
260
270
300
310
320
330
340
350
360
370
Register
Number
R16
R17
R20
R21
R22
R23
R24
R25
R26
R27
R30
R31
R32
R33
R34
R35
R36
R37
* Control relays 340 -- 373 can be made retentive by setting a CPU dipswitch. See Chapter 3 for details on setting
CPU dipswitches.
DL305 User Manual, Rev. D
System Operation
MSB
167
166
207
217
227
237
247
257
267
277*
206
216
226
236
246
256
266
276
DL330P
Control Relay References
165
164
163
162
174
173
172
205
204
203
202
215
214
213
212
225
224
223
222
235
234
233
232
245
244
243
242
255
254
253
252
265
264
263
262
275
274
273
272
LSB
161
171
201
211
221
231
241
251
261
271
160
170
200*
210
220
230
240
250
260
270
8--31
Register
Number
R16
R17
R20
R21
R22
R23
R24
R25
R26
R27
* Control relays 200 -- 277 can be made retentive by setting a CPU dipswitch. See Chapter 3 for details on setting
CPU dipswitches.
MSB
166
176
206
216
226
236
246
256
266
276
306
316
326
336
346
356
366
1007
1017
1027
1037
1047
1057
1067
1006
1016
1026
1036
1046
1056
1066
LSB
161
171
201
211
221
231
241
251
261
271
301
311
321
331
341
351
361
371
1001
1011
1021
1031
1041
1051
1061
160
170
200
210
220
230
240
250
260
270
300
310
320
330
340*
350
360
370
1000
1010
1020
1030
1040
1050
1060
Register
Number
R16
R17
R20
R21
R22
R23
R24
R25
R26
R27
R30
R31
R32
R33
R34
R35
R36
R37
R100
R101
R102
R103
R104
R105
R106
* Control relays 340 -- 373 can be made retentive by setting a CPU dipswitch. See Chapter 3 for details on setting
CPU dipswitches.
DL305 User Manual, Rev. D
System Operation
167
177
207
217
227
237
247
257
267
277
307
317
327
337
347
357
367
DL340
Control Relay References
165
164
163
162
175
174
173
172
205
204
203
202
215
214
213
212
225
224
223
222
235
234
233
232
245
244
243
242
255
254
253
252
265
264
263
262
275
274
273
272
305
304
303
302
315
314
313
312
325
324
323
322
335
334
333
332
345
344
343
342
355
354
353
352
365
364
363
362
373*
372
1005
1004
1003
1002
1015
1014
1013
1012
1025
1024
1023
1022
1035
1034
1033
1032
1045
1044
1043
1042
1055
1054
1053
1052
1065
1064
1063
1062
8--32
System Operation
Special Relays
The following table shows the Special Relays used with the DL305 CPUs. Note, our
DL105, DL205, and DL405 product families use the data type “SP” to designate
Special Relays. Even though we refer to the following relays as special relays,
DirectSOFT uses the letter “C” as a special relay prefix for the DL305 products.
These letters aren’t used with the handheld programmer.
CPUs
DL330P
System Operation
DL330
DL340
DL330
DL330P
DL340
DL340
DL305 User Manual, Rev. D
Special
Relay
Description of Contents
C175
100 ms clock, on for 50 ms and off for 50 ms.
C176
Disables all outputs except for those entered with the SET
OUT instruction.
C177
Battery voltage is low.
C374
On for the first scan cycle after the CPU is switched to Run
Mode.
C375
100 ms clock, on for 50 ms and off for 50 ms.
C376
Disables all outputs except for those entered with the SET
OUT instruction.
C377
Battery voltage is low.
C770
Changes timers to 0.01 second intervals. Timers are
normally 0.1 second time intervals.
C771
The external diagnostics FAULT instruction (F20) is in use.
C772
The data in the accumulator is greater than the comparison
value.
C773
The data in the accumulator is equal to the comparison
value.
C774
The data in the accumulator is less than the comparison
value.
C775
An accumulator carry or borrow condition has occurred.
C776
The accumulator value is zero.
C777
The accumulator has an overflow condition.
C1072
Port 2 parity: on = odd, off = none
C1074
The RX or WX instruction is active.
C1075
An error occurred during communications with the RX or
WX instructions.
C1076
Port 2 communications mode: on = ASCII mode, off = HEX
mode. DirectNET supports both ASCII and HEX modes
and Modbus® only supports HEX mode.
C1077
Port 1 communications mode: on = ASCII mode, off = HEX
mode
8--33
System Operation
Timer / Counter Registers and Contacts
The following table shows the locations used for programming timer or counters.
Since timers and counters share the same data area, you cannot have timers and
counters with duplicate numbers. For example, if you have Timer 600, you cannot
have a Counter 600.
Each register contains the current value for the timer or counter. Each timer or
counter also has a timer or counter contact with the same reference number.
NOTE: Counter current values are retentive and retain their state after a power
cycle. These registers are 16-bit registers.
606
616
626
636
646
656
666
676*
601
611
621
631
641
651
661
671
600
610
620
630
640
650
660
670
* Used with Timer / Counter Setpoint Unit and /or Thumbwheel Interface Module.
External
Timer/Counter
Setpoint Unit
Registers 674--677 are used in programming for use with the Timer/Counter
Setpoint Unit and the Thumbwheel Interface Module that are available in some
compatible product families. The registers contain the current time or count. There is
also a status bit for each register with the same reference number. For example, the
current value for Timer 674 is stored in R674 and the status contact is T674.
The presets for these modules are stored
in R564 -- R573 as follows.
S
R564 -- R565 — 1st T/C preset
S
R566 -- R567 — 2nd T/C preset
S
R570 -- R571 — 3rd T/C preset
S
R572 -- R573 — 4th T/C preset
The example shows how a 4-digit
number would be represented in these
registers.
R565
0 0 0 1 00 1 1
1
3
R564
0 1 0 0 0 1 0 1
4
DL305 User Manual, Rev. D
5
System Operation
607
617
627
637
647
657
667
677*
Timer/Counter References/Registers
605
604
603
602
615
614
613
612
625
624
623
622
635
634
633
632
645
644
643
642
655
654
653
652
665
664
663
662
675*
674*
673
672
8--34
System Operation
Data Registers
The following 8-bit data registers are primarily used with data instructions to store
various types of application data. For example, you could use a register to hold a
timer or counter preset value.
Some data instructions call for two bytes, which will correspond to two consecutive
8-bit data registers such as R401 and R400. The LSB (Least Significant Bit) will be in
register R400 as bit0 and the MSB (Most Significant Bit) will be in register R401 as
bit17.
System Operation
NOTE: Data Registers are retentive.
407
417
427
437
447
457
467
477
507
517
527
537
547
557
DL305 User Manual, Rev. D
406
416
426
436
446
456
466
476
506
516
526
536
546
556
405
415
425
435
445
455
465
475
505
515
525
535
545
555
DL330 / DL330P
8-Bit Data Registers
404
403
414
413
424
423
434
433
444
443
454
453
464
463
474
473
504
503
514
513
524
523
534
533
544
543
554
553
563
402
412
422
432
442
452
462
472
502
512
522
532
542
552
562
401
411
421
431
441
451
461
471
501
511
521
531
541
551
561
400
410
420
430
440
450
460
470
500
510
520
530
540
550
560
System Operation
406
416
426
436
446
456
466
476
506
516
526
536
546
556
405
415
425
435
445
455
465
475
505
515
525
535
545
555
707
717
727
737
747
757
767
706
716
726
736
746
756
766
705
715
725
735
745
755
765
402
412
422
432
442
452
462
472
502
512
522
532
542
552
562
702
712
722
732
742
752
762
401
411
421
431
441
451
461
471
501
511
521
531
541
551
561
701
711
721
731
741
751
761
DL305 User Manual, Rev. D
400
410
420
430
440
450
460
470
500
510
520
530
540
550
560
700
710
720
730
740
750
760
System Operation
407
417
427
437
447
457
467
477
507
517
527
537
547
557
DL340
8-Bit Data Registers
404
403
414
413
424
423
434
433
444
443
454
453
464
463
474
473
504
503
514
513
524
523
534
533
544
543
554
553
563
704
703
714
713
724
723
734
733
744
743
754
753
764
763
8--35
8--36
System Operation
Stage Control / Status Bit Map
This table provides a listing of the individual stages and stage control bits. These are
only available with the DL330P CPU.
System Operation
MSB
007
017
027
037
047
057
067
077
107
117
127
137
147
157
167
177
Stage References
006
016
026
036
046
056
066
076
106
116
126
136
146
156
166
176
DL305 User Manual, Rev. D
005
015
025
035
045
055
065
075
105
115
125
135
145
155
165
175
004
014
024
034
044
054
064
074
104
114
124
134
144
154
164
174
003
013
023
033
043
053
063
073
103
113
123
133
143
153
163
173
LSB
002
012
022
032
042
052
062
072
102
112
122
132
142
152
162
172
001
011
021
031
041
051
061
071
101
111
121
131
141
151
161
171
000
010
020
030
040
050
060
070
100
110
120
130
140
150
160
170
Register
Number
R100
R101
R102
R103
R104
R105
R106
R107
R110
R111
R112
R113
R114
R115
R116
R117
System Operation
8--37
Shift Register Bit Map
The shift register bits listed below are used in the shift register instruction. These
outputs are discrete bits and are not the same locations as the 8 Bit Data Registers.
These bits are retentive meaning they retain their state after a power cycle.
NOTE: The DL330P does not have Shift Register bits. Shift Register instructions in
the DL330P use Control Relays memory references.
MSB
406
416
426
436
446
456
466
476
506
516
526
536
546
556
566
576
LSB
401
411
421
431
441
451
461
471
501
511
521
531
541
551
561
571
400
410
420
430
440
450
460
470
500
510
520
530
540
550
560
570
Register
Number
R40
R41
R42
R43
R44
R45
R46
R47
R50
R51
R52
R53
R54
R55
R56
R57
With the DL340 CPU, these bits can also be used as control relays if they are not
used with a Shift Register instruction.
DL305 User Manual, Rev. D
System Operation
407
417
427
437
447
457
467
477
507
517
527
537
547
557
567
577
DL330 / DL340
Shift Register References
405
404
403
402
415
414
413
412
425
424
423
422
435
434
433
432
445
444
443
442
455
454
453
452
465
464
463
462
475
474
473
472
505
504
503
502
515
514
513
512
525
524
523
522
535
534
533
532
545
544
543
542
555
554
553
552
565
564
563
562
575
574
573
572
8--38
System Operation
Special Registers
This table provides a listing of the special registers used with the DL305 CPUs.
CPUs
DL330
DL330P
DL340
System Operation
DL340 Only
DL305 User Manual, Rev. D
Special
Register
Description of Contents
R574 -- 575 Contains the error code used with the FAULT instruction.
R576 -- 577 Auxiliary accumulator used with the MUL and DIV
instructions.
R771
Sets the upper byte of the station address assigned to the
bottom communication port. Therefore, this will contain the
1st and 2nd digits of the address.
R772
Sets the lower byte of the station address assigned to the
bottom communication port. This only contains one digit,
which is the 3rd digit of the address.
R773
Sets the baud rate for the bottom communication port.
R774
Sets the leading communications delay time for the bottom
communication port.
R775
Sets the trailing communications delay time for the bottom
communication port.
R776
Sets the leading communications delay time for the top
communication port.
R777
Sets the trailing communications delay time for the top
communication port.
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement