6 1 Drum Instruction Programming

6 1 Drum Instruction Programming
Drum Instruction
Programming
(DL450 CPU only)
In This Chapter. . . .
— Introduction
— Step Transitions
— Overview of Drum Operation
— Drum Control Techniques
— Drum Instructions
16
6--2
Drum Instruction Programming
Drum Instruction
Programming
Introduction
Purpose
X X 430 440 450
Drum Terminology
The four drum instructions available in the DL450 CPU electronically simulate an
electro-mechanical drum sequencer. The instructions offer slight variations on the
basic principle, which we describe first.
Drum instructions are best suited for repetitive processes that consist of a finite
number of steps. They can do the work of many rungs of ladder logic with elegant
simplicity. Therefore, drums can save a lot of programming and debugging time.
We introduce some terminology associated with drum instructions by describing the
original electro-mechanical drum pictured below. The mechanical drum generally
has pegs on its curved surface. The pegs are populated in a particular pattern,
representing a set of desired actions for machine control. A motor or solenoid rotates
the drum a precise amount at specific times. During rotation, stationary wipers sense
the presence of pegs (present = on, absent = off). This interaction makes or breaks
electrical contact with the wipers, creating electrical outputs from the drum. The
outputs are wired to devices on a machine for On/Off control.
Drums usually have a finite number of positions within one rotation, called steps.
Each step represents some process step. At powerup, the drum resets to a
particular step. The drum rotates from one step to the next based on a timer, or on
some external event. During special conditions, a machine operator can manually
increment the drum step using a jog control on the drum’s drive mechanism. The
contact closure of each wiper generates a unique on/off pattern called a sequence,
designed for controlling a specific machine. Because the drum is circular, it
automatically repeats the sequence once per rotation. Applications vary greatly, and
a particular drum may rotate once per second, or as slowly as once per week.
Pegs
Wipers
Drum
Outputs
Electronic drums provide the benefits of mechanical drums and more. For example,
they have a preset feature that is impossible for mechanical drums: The preset
function lets you move from the present step directly to any other step on command!
DL405 User Manual, 4th Edition, Rev. A
6--3
Drum Instruction Programming
For editing purposes, the electronic drum is presented in chart form in DirectSOFT
and in this manual. Imagine slicing the surface of a hollow drum cylinder between
two rows of pegs, then pressing it flat. Now you can view the drum as a chart as
shown below. Each row represents a step, numbered 1 through 16. Each column
represents an output, numbered 0 through 15 (to match word bit numbering). The
solid circles in the chart represent pegs (On state) in the mechanical drum, and the
open circles are empty peg sites (Off state).
OUTPUTS
STEP 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1
f F f F f f F f f f F f f F f f
2
f F f F F f F f f f f F f f F f
3
f F F F F f F F f f f f f f f f
4
F F f F F f F f F f f f f f f F
5
f f f F f f F f F f F f F f f F
6
f f f F f f F f F f F f F F f F
7
F f f F f f F F F F f F F F f F
8
F f F f f F f F F f f f F f f F
9
f f f f f f f F F f f f F f f f
10
f f f f f f f F F F f f f f f f
11
F f f f F f f f f F f f f f F f
12
f F f f F F f f F f F F f F F f
13
f f F f f f f f f f f F F f F f
14
f f f f f f f F f f f F F f F F
15
F f f f f F f F f F f F f f F F
16
f f F f f f f F f F f F F f f F
Output Sequences The mechanical drum sequencer derives its name from sequences of control
changes on its electrical outputs. The following figure shows the sequence of On/Off
controls generated by the drum pattern above. Compare the two, and you will find
that they are equivalent! If you can see their equivalence, you are well on your way to
understanding drum instruction operation.
Step
Output
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction
Programming
Drum Chart
Representation
6--4
Drum Instruction Programming
Drum Instruction
Programming
Step Transitions
Drum Instruction
Types
Timer-Only
Transitions
Drum instructions in the DL450 CPU consist of four types:
S Timed Drum with Discrete Outputs (DRUM)
S Time and Event Drum with Discrete Outputs (EDRUM)
S Masked Event Drum with Discrete Outputs (MDRMD)
S Masked Event Drum with Word Output (MDRMW)
The four drum instructions include time-based step transitions, and three include
event-based transitions as well. Other options include outputs defined as a single
word or as individual bits, and an output mask (individual output disable/enable).
Each drum has 16 steps, and each step has 16 outputs. Refering to the figure below,
each output can be either an X, Y, or C coil, offering programming flexibility. Step 1
has been assigned an arbitrary, unique, output pattern (f= Off, F= On) as shown.
Drums move from one step to another based on time and/or an external event
(input). Each step has its own transition condition which you assign during the drum
instruction entry. The figure below shows how timer-only transitions work.
Step 1
Outputs:
F f f f F f F f f f f F F f f f
Outputs:
f f f F f f f f F F f F f f F F
Increment
count timer
No
Has counts per
step expired?
Yes
Step 2
Use next transition criteria
The drum remains in Step 1 for a specific duration (user-programmable). The
timebase of the timer is programmable, from 0.01 seconds to 99.99 seconds. This
establishes the resolution, or the duration of each “tick of the clock”. Each step uses
the same timebase, but has its own unique counts per step, which you program. The
drum spends a specific amount of time in each step, given by the formula:
Time in step = 0.01 seconds X Timebase x Counts per step
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction Programming
6--5
NOTE: When first choosing the timebase resolution, a good rule of thumb is to make
it about 1/10 the duration of the shortest step in your drum. Then you will be able to
optimize the duration of that step in 10% increments. Other steps with longer
durations allow optimizing by even smaller increments (percentage-wise). Also,
note that the drum instruction executes once per CPU scan. Therefore, it is pointless
to specify a drum timebase that is much faster than the CPU scan time.
Timer and Event
Transitions
Time and Event Drums move from step to step based on time and/or external events.
The figure below shows how step transitions work for these drums.
Step 1
No
Outputs:
F f f f F f F f f f f F F f f f
Is Step event
true?
Yes
Increment
count timer
No
Has step
counts expired?
Yes
Step 2
Outputs:
f f f F f f f f F F f F f f F F
Use next transition criteria
When the drum enters Step 1, it sets the output pattern as shown. Then it begins
polling the external input programmed for that step. You can define event inputs as
X, Y, or C discrete point types. Suppose we select X0 for the Step 1 event input. If X0
is off, then the drum remains in Step 1. When X0 is On, the event criteria is met and
the timer increments. The timer increments as long as the event remains true. When
the counts for Step 1 have expired, then the drum moves to Step 2. The outputs
change immediately to match the new pattern for Step 2.
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction
Programming
For example, if you program a 5 second time base and 12 counts for Step 1, then the
drum will spend 60 seconds in Step 1. The maximum time for any step is given by the
formula:
Max Time per step = 0.01 seconds X 9999 X 9999
= 999,800 seconds = 277.7 hours = 11.6 days
Drum Instruction
Programming
6--6
Drum Instruction Programming
Event-Only
Transitions
Step transitions do not require both the event and the timer criteria to be
programmed for each step. You have the option of programming just one of the two,
and even mixing transition types among all the steps of the drum. For example, you
might want Step 1 to transition on an event, Step 2 to transition on time only, and Step
3 to transition on both time and an event. Furthermore, you may elect to use only part
of the 16 steps, and only part of the 16 outputs.
Step 1
No
Outputs:
F f f f F f F f f f f F F f f f
Outputs:
f f f F f f f f F F f F f f F F
Is Step event
true?
Yes
Step 2
Use next transition criteria
Counter
Assignments
Each drum instruction uses the resources of four counters in the CPU. When
programming the drum instruction, you select the first counter number. The drum
also uses the next three counters automatically. The counter bit associated with the
first counter turns on when the drum has completed its cycle, going off when the
drum is reset. These counter values and counter bit precisely indicate the progress
of the drum instruction, and can be monitored by your ladder program.
Suppose we program a timer drum to have
8 steps, and we select CT10 for the
counter number (remember, counter
numbering is in octal). Counter usage is
shown to the right. The right column holds
typical values, interpreted below.
Counter Assignments
CT10 Counts in step V1010
1528
CT11 Timer Value
V1011
0200
CT12 Preset Step
V1012
0001
CT13 Current Step
V1013
0004
CT10 shows that we are at the 1528th count in the current step, which is step 4
(shown in CT13). If we have programmed step 4 to have 3000 counts, then the step
is just over half completed. CT11 is the count timer, shown in units of 0.01 seconds.
So, each least-significant-digit change represents 0.01 seconds. The value of 200
means that we have been in the current count (1528) for 2 seconds (0.01 x 100).
Finally, CT12 holds the preset step value which was programmed into the drum
instruction. When the drum’s Reset input is active, it presets to step 1 in this case.
The value of CT12 does not change without a program edit. Counter bit CT10 turns
on when the drum cycle is complete, and turns off when the drum is reset.
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction Programming
The last step in a drum sequence may be any step number, since partial drums are
valid. Refer to the following figure. When the transition conditions of the last step are
satisfied, the drum sets the counter bit corresponding to the counter named in the
drum instruction box (such as CT0). Then it moves to a final “drum complete” state.
The drum outputs remain in the pattern defined for the last step (including any output
mask logic). Having finished a drum cycle, the Start and Jog inputs have no effect at
this point. The drum leaves the “drum complete” state when the Reset input
becomes active (or on a program-to--run mode transition). It resets the drum
complete bit (such as CT0), and then goes directly to the appropriate step number
defined as the preset step.
Outputs:
Last step
No
Are transition
conditions met?
F F F f f f F f f F f F F F f F
(Timer and/or
Event criteria)
Yes
Set
CT0 = 1
Set Drum Complete bit
Outputs:
Complete
No
F F F f f f F f f F f F F F f F
Reset Input
Active?
Yes
Reset
CT0 = 0
Reset Drum Complete bit
Go to Preset Step
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction
Programming
Last Step
Completion
6--7
6--8
Drum Instruction Programming
Drum Instruction
Programming
Overview of Drum Operation
Drum Instruction
Block Diagram
The drum instruction utilizes various inputs and outputs in addition to the drum
pattern itself. Refer to the figure below.
Inputs
DRUM INSTRUCTION
Block Diagram
Outputs
Start
Real Time
Inputs
(from ladder)
Jog *
Reset
Drum
Preset Step
Counts/Step
Timebase
Programming
Selections
Step
Control
Step
Pointer
Events *
f
f
f
F
f
f
f
f
f
f
f
F
F
F
F
F
F
f
f
f
F
F
f
F
f
f
f
F
f
f
f
f
f f
f f
F f
F f
F f
F F
F F
f F
Outputs
Output
Mask *
Final Drum
Outputs
Counter #
Pattern
Output Mask *
Counter Assignments
* Asterisked inputs
are applicable only
to particular drum
instructions.
CT0
Counts in step
V1000
xxxx
CT1
Timer Value
V1001
xxxx
CT2
Preset Step
V1002
xxxx
CT3
Current Step
V1003
xxxx
The drum instruction accepts several inputs for step control, the main control of the
drum. The inputs and their functions are:
S
S
S
S
Start -- The Start input is effective only when Reset is off. When Start is
on, the drum timer runs if it is in a timed transition, and the drum looks
for the input event during event transitions. When Start is off, the drum
freezes in its current state (Reset must remain off), and the drum
outputs maintain their current on/off pattern.
Jog -- The jog input is only effective when Reset is off (Start may be
either on or off). The jog input increments the drum to the next step on
each off-to-on transition. Note that only the basic timer drum does not
have a jog input.
Reset -- The Reset input has priority over the Start input. When Reset is
on, the drum moves to its preset step. When Reset is off, then the Start
input operates normally.
Preset Step -- A step number from 1 to 16 that you define (typically is
step 1). The drum moves to this step whenever Reset is on, and
whenever the CPU first enters run mode.
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction Programming
S
S
Counts/Step -- The number of timer counts the drum spends in each
step. Each step has its own counts parameter. However, programming
the counts/step is optional on Timer/Event drums.
Timer Value -- the current value of the counts/step timer.
Counter # -- The counter number specifies the first of four consecutive
counters which the drum uses for step control. You can monitor these to
determine the drum’s progress through its control cycle.
Events -- Either an X, Y, C, GX, GY, S, C, CT, or SP type discrete point
serves as step transition inputs. Each step has its own event. However,
programming the event is optional on Timer/Event drums.
WARNING: The outputs of a drum are enabled any time the CPU is in Run
Mode. The Start Input does not have to be on, and the Reset input does not
disable the outputs. Upon entering Run Mode, drum outputs automatically
turn on or off according to the pattern of the preset step. This includes any
effect of the output mask when applicable.
Powerup State of
Drum Registers
The choice of the starting step on powerup and program-to-run mode transitions are
important to consider for your application. Please refer to the following chart. If the
counter memory is configured as non-retentive, the drum is initialized the same way
on every powerup or program-to-run mode transition. However, if the counter
memory is configured to be retentive, the drum will stay in its previous state.
Counter Number
Function
CTA(n)
Initialization on Powerup
Non-Retentive Case
Retentive Case
Current Step
Count
Initialize = 0
Use Previous (no
change)
CTA(n + 1)
Counter Timer
Value
Initialize = 0
Use Previous (no
change)
CTA(n + 2)
Preset Step
Initialize = Preset Step #
Use Previous (no
change)
CTA(n + 3)
Current Step #
Initialize = Preset Step #
Use Previous (no
change)
Applications with relatively fast drum cycle times typically will need to be reset on
powerup, using the non-retentive option. Applications with relatively long drum cycle
times may need to resume at the previous point where operations stopped, using the
retentive case. The default option is the retentive case. This means that if you
initialize scratchpad V-memory, the memory will be retentive.
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction
Programming
S
S
6--9
6--10
Drum Instruction Programming
Drum Instruction
Programming
Drum Control Techniques
Drum
Control Inputs
Now we are ready to put together the
concepts on the previous pages and
demonstrate general control of the drum
instruction box. The drawing to the right
shows a simplified generic drum
instruction. Inputs from ladder logic
control the Start, Jog, and Reset Inputs.
The first counter bit of the drum (CT0, for
example) indicates the drum cycle is
done.
X0
Start
X1
Jog
X2
Reset
Outputs
Setup
Info.
Steps
Mask
f
f
f
F
f
f
f
f
f
f
f
F
F
F
F
F
F
f
f
f
F
F
f
F
f
f
f
F
f
f
f
f
f f
f f
F f
F f
F f
F F
F F
f F
The timing diagram below shows an arbitrary timer drum input sequence and how
the drum responds. As the CPU enters run mode it initializes the step number to the
preset step number (typically is Step 1). When the Start input goes high the drum
begins running, looking for an event and/or running the count timer (depending on
the drum type and setup).
After the drum enters Step 2, Reset turns On while Start is still On. Since Reset has
priority over Start, the drum goes to the preset step (Step 1). Note that the drum is
held in the preset step during Reset, and that step does not run (respond to events or
run the timer) until Reset turns off.
After the drum has entered step 3, the Start input goes off momentarily, halting the
drum’s timer until Start turns on again.
Start
drum
Inputs
Start
1
0
Jog
1
0
Reset
1
0
Reset
drum
Hold
drum
Resume
drum
Drum
Reset
Complete drum
Drum Status
1
Step #
Drum
Complete (CT0)
1
Outputs (x 16)
1
0
1
2
1
1
2
3
3
4
...
15
16
16
16
1
1
0
When the drum completes the last step (Step 16 in this example), the Drum
Complete bit (CT0) turns on, and the step number remains at 16. When the Reset
input turns on, it turns off the Drum Complete bit (CT0), and forces the drum to enter
the preset step.
NOTE: The timing diagram shows all steps using equal time durations. Step times
can vary greatly, depending on the counts/step programmed.
DL405 User Manual, 4th Edition, Rev. A
6--11
Drum Instruction Programming
Jog
drum
Inputs
Start
1
0
Jog
1
0
Reset
1
0
Reset
drum
Jog
drum
Jog
drum
Drum
Complete
Drum Status
1
Step #
Self-Resetting
Drum
Initializing Drum
Outputs
Using Complex
Event Step
Transitions
Drum
Complete (CT0)
1
Outputs (x 16)
1
0
2
3
3
3
4
5
6,7
8
...
14
15
16
16
16
1
0
Applications often require drums that
automatically start over once they
complete a cycle. This is easily
accomplished, using the drum complete
bit. In the figure to the right, the drum
instruction setup is for CT0, so we logically
OR the drum complete bit (CT0) with the
Reset input. When the last step is done,
the drum turns on CT0 which resets itself
to the preset step, also resetting CT0.
Contact X1 still works as a manual reset.
X0
X1
CT0
Start
Reset
Outputs
Setup
Info.
Steps
Mask
f
f
f
F
f
f
f
f
f
f
f
F
F
F
F
F
F
f
f
f
F
F
f
F
f
f
f
F
f
f
f
f
f f
f f
F f
F f
F f
F F
F F
f F
The outputs of a drum are enabled any time the CPU is in run mode. On
program-to-run mode transitions, the drum goes to the preset step, and the outputs
energize according to the pattern of that step. If your application requires all outputs
to be off at powerup make the preset step in the drum a “reset step”, with all outputs
off.
Each event--based transition accepts only one contact reference for the event.
However, this does not limit events to just one contact. Just use a control relay
contact such as C0 for the step transition event. Elsewhere in the ladder logic you
may use C0 as an output coil, making it dependent on many other “events”
(contacts).
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction
Programming
In the figure below, we focus on how the Jog input works on event drums. To the left
of the diagram, note that the off-to-on transitions of the Jog input increments the
step. Start may be either on or off (however, Reset must be off). Two jogs takes the
drum to step three. Next, the Start input turns on, and the drum begins running
normally. During step 6 another Jog input signal occurs. This increments the drum to
step 7, setting the timer to 0. The drum begins running immediately in step 7,
because Start is already on. The drum advances to step 8 normally.
As the drum enters step 14, the Start input turns off. Two more Jog signals moves the
drum to step 16. However, note that a third Jog signal is required to move the drum
through step 16 to “drum complete”. Finally, a Reset input signal arrives which forces
the drum into the preset step and turns off the drum complete bit.
6--12
Drum Instruction Programming
Drum Instruction
Programming
Drum Instructions
Timed Drum with
Discrete Outputs
(DRUM)
X X The DL450 drum instructions may be programmed DirectSOFT. The EDRUM is the
only drum instruction that can be programmed with a handheld programmer
(firmware version 5.5 or later). This section covers entry using DirectSOFT for all
instructions plus the handheld mnemonics for the EDRUM instructions.
The Timed Drum with Discrete Outputs is the most basic of the DL450’s drum
instructions. It operates according to the principles covered on the previous pages.
Below is the instruction in chart form as displayed by DirectSOFT.
Counter Number
430 440 450
Step Preset
Timebase
Control
Inputs
Discrete Output Assignment
Start
Reset
Step Number
Counts per Step
Output Pattern
f= Off, F= On
The Timed Drum features 16 steps and 16 outputs. Step transitions occur only on a
timed basis, specified in counts per step. Unused steps must be programmed with
“counts per step” = 0 (this is the default entry). The discrete output points may be
individually assigned as X, Y, or C types, or may be left unused. The output pattern
may be edited graphically with DirectSOFT.
Whenever the Start input is energized, the drum’s timer is enabled. It stops when the
last step is complete, or when the Reset input is energized. The drum enters the
preset step chosen upon a CPU program-to-run mode transition, and whenever the
Reset input is energized.
Drum Parameters
Field
Data Types
Ranges
Counter Number
aaa
--
0 -- 377
Preset Step
bb
K
1 -- 16
Timer base
cc
K
0 -- 99.99 seconds
Counts per step
dddd
K
0 -- 9999
Discrete Outputs
Fffff
X, Y, C, GX, GY *
see page 3--42
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction Programming
6--13
Counter Number
Ranges of (n)
Function
Counter Bit Function
CTA(n)
0 -- 374
Counts in step
CTn = Drum Complete
CTA( n+1)
1 -- 375
Timer value
CT(n+1) = (not used)
CTA( n+2)
2 --376
Preset Step
CT(n+2) = (not used)
CTA( n+3)
3 --377
Current Step
CT(n+1) = (not used)
The following ladder program shows the DRUM instruction in a typical ladder
program, as shown by DirectSOFT. Steps 1 through 10 are used, and twelve of the
sixteen output points are used. The preset step is step 1. The timebase runs at (K10
x 0.01) = 0.1 per count. Therefore, the duration of step 1 is (25 x 0.1) = 2.5 seconds.
In the last rung, the Drum Complete bit (CT10) turns on output Y0 upon completion of
the last step (step 10). A drum reset also resets CT10.
Start
Reset
Drum Complete
DirectSOFT Display
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction
Programming
Drum instructions use four counters in the CPU. The ladder program can read the
counter values for the drum’s status. The ladder program may write a new preset
step number to CTA(n+2) at any time. However, the other counters are for
monitoring purposes only.
Drum Instruction
Programming
6--14
Drum Instruction Programming
The Event Drum features time--based and event--based step transitions. It operates
according to the general principles of drum operation covered in the beginning of this
section. Below is the instruction as displayed by DirectSOFT.
Event Drum
(EDRUM)
X X 430 440 450
Counter Number
Step Preset
Timebase
Discrete Output Assignment
Start
Control
Inputs
Jog
Reset
Step Number
Counts per Step
Event per step
Output Pattern
f= Off, F= On
The Event Drum features 16 steps and 16 outputs. Step transitions occur on timed
and/or event basis. The jog input also advances the step on each off-to-on transition.
Time is specified in counts per step, and events are specified as discrete contacts.
Unused steps and events must be left blank. The discrete output points may be
individually asssigned.
Drum Parameters
Field
Data Types
Ranges
Counter Number
aaa
--
0 -- 377
Preset Step
bb
K
1 -- 16
Timer base
cc
K
0 -- 99.99 seconds
Counts per step
dddd
K
0 -- 9999
Event
eeee
X, Y, C, GX, GY, S, T, ST
see page 3--42
Discrete Outputs
Fffff
X, Y, C , GX, GY*
see page 3--42
Whenever the Start input is energized, the drum’s timer is enabled. As long as the
event is true for the current step, the timer runs during that step. When the step count
equals the counts per step, the drum transitions to the next step. This process stops
when the last step is complete, or when the Reset input is energized. The drum
enters the preset step chosen upon a CPU program-to-run mode transition, and
whenever the Reset input is energized.
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction Programming
6--15
Counter Number
Ranges of (n)
Function
Counter Bit Function
CTA(n)
0 -- 374
Counts in step
CTn = Drum Complete
CTA( n+1)
1 -- 375
Timer value
CT(n+1) = (not used)
CTA( n+2)
2 --376
Preset Step
CT(n+2) = (not used)
CTA( n+3)
3 --377
Current Step
CT(n+1) = (not used)
The following ladder program shows the EDRUM instruction in a typical ladder
program, as shown by DirectSOFT. Steps 1 through 11 are used, and all sixteen
output points are used. The preset step is step 1. The timebase runs at (K10 x 0.01) =
0.1 second per count. Therefore, the duration of step 1 is (1 x 0.1) = 0.1 seconds.
Note that step 1 is time-based only (event is left blank). And, the output pattern for
step 1 programs all outputs off, which is a typically desirable powerup condition. In
the last rung, the Drum Complete bit (CT4) turns on output Y0 upon completion of the
last step (step 11). A drum reset also resets CT4.
NOTE: If all events are true in an event only drum (a drum with 0 counts per step in all
steps), the PLC completes one step of the drum per scan; thus, the drum will be
complete in 16 scans. However, as the outputs of the drum are enabled any time the
CPU is in RUN Mode, the drum discrete outputs will be energized as pulsed outputs
for each scan.
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction
Programming
Drum instructions use four counters in the CPU. The ladder program can read the
counter values for the drum’s status. The ladder program may write a new preset
step number to CTA(n+2) at any time. However, the other counters are for
monitoring purposes only.
Drum Instruction
Programming
6--16
Drum Instruction Programming
The handheld programmer can also enter or edit drum instructions. The diagram
below lists the keystrokes for entering the drum example on the previous page.
NOTE: Drum editing requires Handheld Programmer firmware version 5.5 or later.
Handheld Programmer Keystrokes
Handheld Programmer Keystrokes cont’d
skip over unused event
Start
STR
X(IN)
0
1 ( DEF 0000 )
Jog
STR
X(IN)
1
( DEF 0000 )
Y(OUT)
4
0
Reset
STR
X(IN)
2
( DEF 0000 )
X(IN)
2
1
Drum Inst.
SHFT
E
D
( DEF 0000 )
X(IN)
2
2
SHFT
CNT
4
( DEF 0000 )
C(CR)
0
( DEF 0000 )
C(CR)
1
( DEF 0000 )
X(IN)
3
0
( DEF 0000 )
X(IN)
3
5
( DEF 0000 )
X(IN)
3
3
R
U
M
NXT
Preset Step
( DEF K0000 )
1
Time Base
( DEF K0000 )
6
4
( DEF 0000 )
C(CR)
7
( DEF 0000 )
C(CR)
1
0
( DEF 0000 )
Y(OUT)
1
3
( DEF 0000 )
Y(OUT)
1
7
( DEF 0000 )
YOUT)
4
2
( DEF 0000 )
C(CR)
2
0
( DEF 0000 )
Y(OUT)
5
( DEF 0000 )
NXT
( DEF 0000 )
Y(OUT)
6
( DEF 0000 )
NXT
( DEF 0000 )
C(CR)
4
( DEF 0000 )
NXT
( DEF 0000 )
C(CR)
2
( DEF 0000 )
NXT
( DEF 0000 )
Y(OUT)
1
0
16 ( DEF 0000 )
NXT
( DEF 0000 )
Y(OUT)
2
0
1 ( DEF K0000 )
NXT
( DEF 0000 )
C(CR)
1
4
( DEF K0000 )
9
8
1
2
( DEF 0000 )
C(CR)
3
0
( DEF K0000 )
2
8
9
4
( DEF 0000 )
Y(OUT)
3
2
( DEF K0000 )
4
4
7
6
( DEF 0000 )
Y(OUT)
7
2
( DEF K0000 )
5
1
6
9
( DEF 0000 )
C(CR)
3
4
( DEF K0000 )
9
3
4
3
15
( DEF 0000 )
Y(OUT)
1
( DEF K0000 )
4
4
8
6
1
( DEF K0000 )
5
( DEF K0000 )
9
4
5
9
( DEF K0000 )
2
0
( DEF K0000 )
3
8
SHFT
A(H)
( DEF K0000 )
1
5
( DEF K0000 )
5
8
6
4
( DEF K0000 )
4
5
( DEF K0000 )
8
4
4
7
( DEF K0000 )
1
8
0
( DEF K0000 )
( DEF K0000 )
9
2
3
( DEF K0000 )
( DEF K0000 )
1
2
0
( DEF K0000 )
( DEF K0000 )
8
6
4
( DEF K0000 )
1
2
0
( DEF K0000 )
4
0
0
( DEF K0000 )
NXT
( DEF K0000 )
NXT
( DEF K0000 )
NXT
( DEF K0000 )
NXT
( DEF K0000 )
NXT
( DEF K0000 )
NXT
0
Outputs
Counts/
Step
16
Events
Output
Pattern
0
skip over
unused steps
step 1 pattern = 0000
unused steps
( DEF K0000 )
0
16 ( DEF K0000 )
Last rung
STR
CNT
Y(OUT)
0
0
skip over
unused steps
NOTE: You may use the NXT and PREV keys
to skip past entries for unused outputs or steps.
(Go to next column)
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction Programming
6--17
Counter Number
430 440 450
Step Preset
Timebase
Discrete Output Assignment
Output Mask Word
Start
Control
Inputs
Jog
Reset
Step Number
Counts per Step
Event per step
Output Pattern
f= Off, F= On
The Masked Event Drum with Discrete Outputs features sixteen steps and sixteen outputs.
Drum outputs are logically ANDed bit-by-bit with an output mask word for each step. The
Gggg field specifies the beginning location of the 16 mask words. Step transitions occur on
timed and/or event basis. The jog input also advances the step on each off-to-on transition.
Time is specified in counts per step, and events are specified as discrete contacts. Unused
steps and events can be left blank (this is the default entry).
Drum Parameters
Field
Data Types
Ranges
Counter Number
aaa
--
0 -- 177
Preset Step
bb
K
1 -- 16
Timer base
cc
K
0 -- 99.99 seconds
Counts per step
dddd
K
0 -- 9999
Event
eeee
X, Y, C, GX, GY, S, T, ST
see page 3--42
Discrete Outputs
Fffff
X, Y, C, GX, GY *
see page 3--42
Output Mask
Gggg
V
see page 3--42
Whenever the Start input is energized, the drum’s timer is enabled. As long as the event is
true for the current step, the timer runs during that step. When the step count equals the
counts per step, the drum transitions to the next step. This process stops when the last step is
complete, or when the Reset input is energized. The drum enters the preset step chosen
upon a CPU program-to-run mode transition, and whenever the Reset input is energized.
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction
Programming
The Masked Event Drum with Discrete Outputs has all the features of the basic
Event Drum plus final output control for each step. It operates according to the
general principles of drum operation covered in the beginning of this section. Below
is the instruction in chart form as displayed by DirectSOFT.
Masked
Event Drum with
Discrete Outputs
(MDRMD)
X X Drum Instruction
Programming
6--18
Drum Instruction Programming
Drum instructions use four counters in the CPU. The ladder program can read the
counter values for the drum’s status. The ladder program may write a new preset
step number to CTA(n+2) at any time. However, the other counters are for
monitoring purposes only.
Counter Number
Ranges of (n)
Function
Counter Bit Function
CTA(n)
0 -- 374
Counts in step
CTn = Drum Complete
CTA( n+1)
1 -- 375
Timer value
CT(n+1) = (not used)
CTA( n+2)
2 --376
Preset Step
CT(n+2) = (not used)
CTA( n+3)
3 --377
Current Step
CT(n+1) = (not used)
The following ladder program shows the MDRMD instruction in a typical ladder
program, as shown by DirectSOFT. Steps 1 through 11 are used, and all 16 output
points are used. The output mask word is at V2000. The final drum outputs are
shown above the mask word as individual bits. The data bits in V2000 are logically
ANDed with the output pattern of the current step in the drum. If you want all drum
outputs to be off after powerup, just write zeros to V2000 on the first scan. Ladder
logic may update the output mask at any time to enable or disable the drum outputs.
The preset step is step 1. The timebase runs at (K10 x 0.01) = 0.1 second per count.
Therefore, the duration of step 1 is (5 x 0.1) = 0.5 seconds. Note that step 1 is
time-based only (event is left blank). In the last rung, the Drum Complete bit (CT10)
turns on output Y0 upon completion of the last step (step 10). A drum reset also
resets CT10.
NOTE: The ladder program must load constants in V2000 through
V2012 to cover all mask registers for the eleven steps used in this drum.
DL405 User Manual, 4th Edition, Rev. A
6--19
Drum Instruction Programming
NOTE: Drum editing requires Handheld Programmer firmware version 5.5 or later.
skip over unused event
Start
STR
X(IN)
0
1 ( DEF 0000 )
Jog
STR
X(IN)
1
( DEF 0000 )
Y(OUT)
4
0
Reset
STR
X(IN)
2
( DEF 0000 )
X(IN)
2
1
Drum Inst.
SHFT
M
D
R
( DEF 0000 )
X(IN)
2
2
SHFT
( DEF 0000 )
C(CR)
0
( DEF 0000 )
C(CR)
1
( DEF 0000 )
X(IN)
3
0
( DEF 0000 )
X(IN)
3
5
( DEF 0000 )
X(IN)
3
3
CNT
1
0
Output Mask
( DEF V00000)
2
0
Preset Step
( DEF K0000 )
1
Time Base
( DEF K0000 )
0
Outputs
M
D
0
0
NXT
6
4
C(CR)
7
( DEF 0000 )
C(CR)
1
0
( DEF 0000 )
Y(OUT)
1
7
( DEF 0000 )
Y(OUT)
1
3
( DEF 0000 )
C(CR)
2
0
( DEF 0000 )
YOUT)
4
2
( DEF 0000 )
NXT
( DEF 0000 )
Y(OUT)
5
( DEF 0000 )
NXT
( DEF 0000 )
Y(OUT)
6
( DEF 0000 )
NXT
( DEF 0000 )
C(CR)
4
( DEF 0000 )
NXT
( DEF 0000 )
C(CR)
2
16 ( DEF 0000 )
NXT
( DEF 0000 )
Y(OUT)
1
0
1 ( DEF K0000 )
2
6
8
8
( DEF 0000 )
Y(OUT)
2
0
( DEF K0000 )
9
8
1
2
( DEF 0000 )
C(CR)
1
4
( DEF K0000 )
2
8
9
4
( DEF 0000 )
C(CR)
3
0
( DEF K0000 )
4
4
7
6
( DEF 0000 )
Y(OUT)
3
2
( DEF K0000 )
5
1
6
9
( DEF 0000 )
Y(OUT)
7
2
( DEF K0000 )
9
3
4
3
4
( DEF K0000 )
4
4
8
6
( DEF K0000 )
9
4
5
9
( DEF K0000 )
3
8
SHFT
A(H)
( DEF K0000 )
5
8
6
4
( DEF K0000 )
8
4
4
7
( DEF 0000 )
Events
skip over
unused steps
( DEF 0000 )
C(CR)
3
15
( DEF 0000 )
Y(OUT)
1
1
( DEF K0000 )
5
( DEF K0000 )
2
0
( DEF K0000 )
1
5
( DEF K0000 )
4
5
( DEF K0000 )
1
8
0
( DEF K0000 )
( DEF K0000 )
9
2
3
( DEF K0000 )
( DEF K0000 )
1
2
0
( DEF K0000 )
( DEF K0000 )
8
6
4
16 ( DEF K0000 )
( DEF K0000 )
1
2
0
( DEF K0000 )
4
0
0
( DEF K0000 )
NXT
STR
SPCL
0
( DEF K0000 )
NXT
LD
K(CON)
SHFT
( DEF K0000 )
NXT
F(H)
F(H)
F(H)
F(H)
( DEF K0000 )
NXT
V
2
0
0
( DEF K0000 )
NXT
( DEF K0000 )
NXT
Counts/
Step
16
Output
Pattern
0
( DEF K0000 )
Last rungs
0
skip over
unused steps
OUT
(Go to next column)
unused steps
STR
CNT
Y(OUT)
0
0
0
NOTE: You may use the NXT and PREV keys
to skip past entries for unused outputs or steps.
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction
Programming
The handheld programmer can also enter or edit drum instructions. The diagram
below lists the keystrokes for entering the drum example on the previous page.
Drum Instruction
Programming
6--20
Drum Instruction Programming
The Masked Event Drum with Word Output features outputs organized as bits of a
single word, rather than discrete points. It operates according to the general
principles of drum operation covered in the beginning of this section. Below is the
instruction in chart form as displayed by DirectSOFT.
Masked
Event Drum with
Word Output
(MDRMW)
X X Counter Number
430 440 450
Step Preset
Timebase
Word Output Assignment
Output Mask Word
Start
Control
Inputs
Jog
Reset
Step Number
Counts per Step
Event per step
Output Pattern
f= Off, F= On
The Masked Event Drum with Word Output features sixteen steps and sixteen outputs. Drum
outputs are logically ANDed bit-by-bit with an output mask word for each step. The Gggg field
specifies the beginning location of the 16 mask words, creating the final output (Ffff field).
Step transitions occur on timed and/or event basis. The jog input also advances the step on
each off-to-on transition. Time is specified in counts per step, and events are specified as
discrete contacts. Unused steps and events can be left blank (this is the default entry).
Drum Parameters
Field
Data Types
Ranges
Counter Number
aaa
--
0 -- 177
Preset Step
bb
K
1 -- 16
Timer base
cc
K
0 -- 99.99 seconds
Counts per step
dddd
K
0 -- 9999
Event
eeee
X, Y, C, GX, GY, S, T, ST
see page 3--42
Word Output
Fffff
V
see page 3--42
Output Mask
Gggg
V
see page 3--42
Whenever the Start input is energized, the drum’s timer is enabled. As long as the event is
true for the current step, the timer runs during that step. When the step count equals the
counts per step, the drum transitions to the next step. This process stops when the last step is
complete, or when the Reset input is energized. The drum enters the preset step chosen
upon a CPU program-to-run mode transition, and whenever the Reset input is energized.
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction Programming
6--21
Counter Number
Ranges of (n)
Function
Counter Bit Function
CTA(n)
0 -- 374
Counts in step
CTn = Drum Complete
CTA( n+1)
1 -- 375
Timer value
CT(n+1) = (not used)
CTA( n+2)
2 --376
Preset Step
CT(n+2) = (not used)
CTA( n+3)
3 --377
Current Step
CT(n+1) = (not used)
The following ladder program shows the MDRMD instruction in a typical ladder
program, as shown by DirectSOFT. Steps 1 through 11 are used, and all sixteen
output points are used. The output mask word is at V2000. The final drum outputs
are shown above the mask word as a word at V2001. The data bits in V2000 are
logically ANDed with the output pattern of the current step in the drum, generating
the contents of V2001. If you want all drum outputs to be off after powerup, write
zeros to V2000 on the first scan. Ladder logic may update the output mask at any
time to enable or disable the drum outputs. The preset step is step 1. The timebase
runs at (K50 X 0.01) = 0.5 seconds per count. Therefore, the duration of step 1 is (5 x
0.5) = 2.5 seconds. Note that step 1 is time-based only (event is left blank). In the last
rung, the Drum Complete bit (CT14) turns on output Y0 upon completion of the last
step (step 10). A drum reset also resets CT14.
NOTE: The ladder program must load constants in V2000 through
V2012 to cover all mask registers for the eleven steps used in this drum.
DL405 User Manual, 4th Edition, Rev. A
Drum Instruction
Programming
Drum instructions use four counters in the CPU. The ladder program can read the
counter values for the drum’s status. The ladder program may write a new preset
step number to CTA(n+2) at any time. However, the other counters are for
monitoring purposes only.
Drum Instruction
Programming
6--22
Drum Instruction Programming
The handheld programmer can also enter or edit drum instructions. The diagram
below lists the keystrokes for entering the drum example on the previous page.
NOTE: Drum editing requires Handheld Programmer firmware version 5.5 or later.
Handheld Programmer Keystrokes
Handheld Programmer Keystrokes cont’d
skip over unused event
Start
STR
X(IN)
0
1 ( DEF 0000 )
Jog
STR
X(IN)
1
( DEF 0000 )
Y(OUT)
4
0
Reset
STR
X(IN)
2
( DEF 0000 )
X(IN)
2
1
Drum Inst.
SHFT
M
D
R
( DEF 0000 )
X(IN)
2
2
SHFT
( DEF 0000 )
C(CR)
0
( DEF 0000 )
C(CR)
1
( DEF 0000 )
X(IN)
3
0
( DEF 0000 )
X(IN)
3
5
( DEF 0000 )
X(IN)
3
3
( DEF 0000 )
Y(OUT)
1
7
( DEF 0000 )
C(CR)
2
0
( DEF 0000 )
NXT
( DEF 0000 )
NXT
( DEF 0000 )
NXT
M
D
0
0
NXT
CNT
1
4
Output Mask
( DEF V00000)
2
0
Preset Step
( DEF K0000 )
1
Time Base
( DEF K0000 )
6
4
Output Word
( DEF V00000)
2
0
( DEF K0000 )
5
( DEF K0000 )
2
0
( DEF K0000 )
1
5
( DEF K0000 )
4
5
( DEF K0000 )
1
8
0
( DEF K0000 )
9
2
3
( DEF 0000 )
NXT
( DEF K0000 )
1
2
0
16 ( DEF 0000 )
NXT
( DEF K0000 )
8
6
4
1 ( DEF K0000 )
2
6
8
8
( DEF K0000 )
1
2
0
( DEF K0000 )
9
8
1
2
( DEF K0000 )
4
0
0
( DEF K0000 )
2
8
9
4
( DEF K0000 )
NXT
( DEF K0000 )
4
4
7
6
( DEF K0000 )
NXT
( DEF K0000 )
5
1
6
9
( DEF K0000 )
NXT
( DEF K0000 )
9
3
4
3
( DEF K0000 )
NXT
( DEF K0000 )
4
4
8
6
( DEF K0000 )
NXT
( DEF K0000 )
9
4
5
9
( DEF K0000 )
NXT
( DEF K0000 )
3
8
SHFT
A(H)
( DEF K0000 )
5
8
6
4
( DEF K0000 )
8
4
4
7
1
Counts/
Step
16
Events
0
1
0
0
skip over
unused steps
(Go to next column)
Output
Pattern
skip over
unused steps
( DEF K0000 )
( DEF K0000 )
unused steps
( DEF K0000 )
( DEF K0000 )
16 ( DEF K0000 )
Last rungs
NOTE: You may use the NXT and PREV keys
to skip past entries for unused outputs or steps.
DL405 User Manual, 4th Edition, Rev. A
OUT
STR
CNT
Y(OUT)
0
0
STR
SPCL
0
LD
K(CON)
SHFT
F(H)
F(H)
F(H)
F(H)
V
2
0
0
0
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