Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 43 of 68

DL405 User Manual: Chapter 6: Drum Instruction Programming (DL450 CPU only), pages 377 to 384

Pages 377 to 384 of 608, from DL405 User Manual

The original document is the PDF (8.2 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 D4-08B-1, AutomationDirect D4-08ND3S, AutomationDirect D4-16TA, PLC Direct D4-16TD2, AutomationDirect D4-32ND3-1, Konnect-It D4-08B-1, Koyo D4-08B-1, Konnect-It D4-08ND3S, and 6 more models

Page 377

Drum Instruction Programming (DL450 CPU only) In This Chapter. . . ., Introduction, Step Transitions, Overview of Drum Operation, Drum Control Techniques, Drum Instructions

16

Page 378

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

Page 379

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

Drum Instruction Programming

Drum Chart Representation

Page 380

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

Page 381

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

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

Page 382

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

Page 383

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

Drum Instruction Programming

Last Step Completion

6--7

Page 384

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

DL405 User Manual, 4th Edition

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.