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

The text of a manual · part 5 of 38

DL06 Micro PLC User Manual, Volume 2 of 2, pages 40 to 49

Pages 40 to 49 of 370

The original document is the PDF (6.0 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 Direct Logic DL06

Page 40

Chapter 6: Drum Instruction Programming

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

Event Drum (EDRUM)

6–14

The Event Drum (EDRUM) features time-based and event-based step transitions. It operates according to the general principles of drum operation covered in the beginning of this chapter. Below is the instruction as displayed by DirectSOFT 5. Direct SOFT 5 Display

Counter Number

Step Preset Discrete Output Assignment

Timebase Start Control Inputs

{

Jog Reset

Step Number Counts per Step Event per Step Output Pattern 쏔= Off, 쐽= On

The Event Drum features 16 steps and 16 discrete 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 assigned. Drum Parameters

Field

Data Types

Ranges

Counter Number Preset Step Timer base Counts per step Event Discrete Outputs aa bb cccc dddd Eeeee ffff

-K K K X, Y, C, S, T, CT, SP X, Y, C

0 -- 174 1 -- 16 0 -- 99.99 seconds 0 -- 9999 see memory map see memory map

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.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 41

Chapter 6: 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.

1 2 Counter Number Ranges of (n) Function Counter Bit Function 3 4 The following ladder program shows the EDRUM instruction in a typical ladder program, as 5 shown by DirectSOFT 5. 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. 6 Therefore, the duration of step 1 is (1 x 0.1) = 0.1 second. 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 7 on output Y0 upon completion of the last step (step 11). A drum reset also resets CT4. 8 9 10 11 12 13 14 A B C D CTA(n) CTA( n+1) CTA( n+2) CTA( n+3)

0 -- 174 1 -- 175 2 -- 176 3 -- 177

Counts in step Timer value Preset Step Current Step

CT(n )= Drum Complete CT(n+1) = (not used) CT(n+2) = (not used) CT(n+3) = (not used)

Start Jog

Reset

Drum Complete

Direct SOFT 5 Display

DL06 Micro PLC User Manual, 3rd Edition Rev. A

6–15

Page 42

Chapter 6: Drum Instruction Programming

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

Handheld Programmer Drum Mnemonics The EDRUM instruction can also be programmed using a handheld programmer. This section explains entry via the handheld programmer. X0 First, enter Store instructions for the ladder rungs Start Setup Outputs controlling the drum’s ladder inputs. In the X1 Info J og example to the right, the timer drum’s Start, Jog, Ma s k f f F f f f and Reset inputs are controlled by X0, X1 and X2 Steps X2 R es et f f f f f f respectively. The required keystrokes are listed f f f f F f F F f F F f beside the mnemonic. f F F f F f f F F f F F These keystrokes precede the EDRUM instruction f F f f F F mnemonic. Note that the ladder rungs for Start, f F F f f F Jog, and Reset inputs are not limited to being Handheld Programmer Keys trokes single–contact rungs. Store X0

$

A STR

0

E NT

(Repeat for Store X1 and Store X2) Handheld Programmer Keystrokes

EDRUM CNT4

SHFT

E

4

D

3

R ORN

U

ISG

M ORST

E 4

ENT

After the Store instructions, enter the EDRUM (using Counter CT0) as shown: After entering the EDRUM mnemonic as above, the handheld programmer creates an input form for all the drum parameters. The input form consists of approximately fifty or more default mnemonic entries containing DEF (define) statements. The default mnemonics are already “input” for you, so they appear automatically. Use the NXT and PREV keys to move forward and backward through the form. Only the editing of default values is required, thus eliminating many keystrokes. The entries required for the basic timer drum are in the chart below. NOTE: Default entries for output points and events are “DEF 0000”, which means they are unassigned. If you need to go back and change an assigned output as unused again, enter “K0000”. The entry will again show as “DEF 0000”.

Drum Parameters

Multiple Entries

Mnemonic / Entry

Default Mnemonic

Valid Data Types

Ranges

Start Input Jog Input Reset Input Drum Mnemonic Preset Step Timer base Output points Counts per step Events Output pattern

----1 1 16 16 16 16

STR (plus input rung) STR (plus input rung) STR (plus input rung) DRUM CNT aa bb cccc ffff dddd dddd gggg

----DEF K0000 DEF K0000 DEF 0000 DEF K0000 DEF K0000 DEF K0000

---CT K K X, Y, C K X, Y, C, S, T, CT, SP K

---0 -- 174 1 -- 16 1 -- 9999 see memory map 0 -- 9999 see memory map 0 -- FFFF

6–16

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 43

Chapter 6: Drum Instruction Programming Using the DRUM entry chart (two pages before), we show the method of entry for the basic time/event drum instruction. First, we convert the output pattern for each step to the equivalent hex number, as shown in the following example.

1 2 3 The following diagram shows the method for entering the previous EDRUM example on the HHP. The default entries of the form are in parenthesis. After the drum instruction entry (on 4 the fourth row), the remaining keystrokes over-write the numeric portion of each default DEF statement. NOTE: Drum editing requires Handheld Programmer firmware version 2.21 5 or later. NOTE: You may use the NXT and PREV keys to skip past entries for unused outputs or steps. 6 7 8 9 10 11 12 13 14 A B C D Step 1

Outputs :

- converts to:

f f f f F f f F f f f F F f F f

15

0

9

1

0

A

Handheld Programmer Keystrokes

Start Jog Reset

$ $ $

Drum Inst.

Time Base

1

Outputs

16

B

STR

C

STR

SHFT

Preset Step

A

STR

E

4

D

ENT

0

Note: You may use the NXT and PREV keys to skip past entries for unused outputs or steps.

ENT

1

ENT

2

R ORN

3

( DEF K0001)

NEXT

( DEF K0000 )

G

( DEF 0000 )

SHFT

( DEF 0000 )

SHFT

6

E

C C

U

4 2 2

H B

( DEF 0000 )

SHFT

( DEF 0000 )

SHFT

Y MLS

E

( DEF 0000 )

SHFT

Y MLS

F

( DEF 0000 )

SHFT

Y MLS

G

( DEF 0000 )

SHFT

C

E

C

B

C

( DEF 0000 )

SHFT

( DEF 0000 )

SHFT

Y MLS

A

( DEF 0000 )

SHFT

Y MLS

C

C

B

2

( DEF 0000 )

SHFT

( DEF 0000 )

SHFT

C

( DEF 0000 )

SHFT

Y MLS

G

( DEF 0000 )

SHFT

Y MLS

H

( DEF 0000 )

SHFT

C

D

( DEF 0000 )

SHFT

2 2

2

Y MLS

4

ENT

Handheld Programmer Keystrokes cont’d

NEXT

Y MLS

2

E

M ORST

ISG

D

B

7 1 1 4 5 6 4 2 0 2 1 3 6 7 3 1

1 ( DEF K0000 )

NEXT

A

0

( DEF K0000 )

NEXT

NEXT

( DEF K0000 )

NEXT

( DEF K0000 )

NEXT

( DEF K0000 )

NEXT

( DEF K0000 )

NEXT

( DEF K0000 )

NEXT

Counts/ Step

( DEF K0000 )

F

C B E B J

B I

5 2 1 4 1 9 1 8

( DEF K0000 )

B

( DEF K0000 )

E

NEXT

( DEF K0000 )

NEXT

NEXT

( DEF K0000 )

NEXT

NEXT

( DEF K0000 )

NEXT

NEXT

( DEF K0000 )

NEXT

( DEF K0000 )

NEXT

16 ( DEF K0000 )

NEXT

NEXT NEXT

E A

E

4 0

4

NEXT

NEXT

1 4

NEXT

A F F I

C C

G C A

0 5 5 8 2 2 6 2 0

NEXT

A

NEXT

0

NEXT

A

D A E A A

0 3 0 4 0 0

NEXT NEXT NEXT NEXT

A

0

NEXT

NEXT skip over unused steps

(Continued on next page )

DL06 Micro PLC User Manual, 3rd Edition Rev. A

6–17

Page 44

Chapter 6: Drum Instruction Programming

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

Handheld Programmer Keystrokes cont’d ( DEF 0000 )

1

SHFT

E

SHFT

X SET

B

SHFT

X SET

C

SHFT

C

A

( DEF 0000 )

SHFT

C

( DEF 0000 )

SHFT

X SET

A

( DEF 0000 )

SHFT

X SET

F

SHFT

X SET

D

Y MLS

H

C

C

( DEF 0000 ) ( DEF 0000 ) ( DEF 0000 )

Outputs

6–18

( DEF 0000 ) ( DEF 0000 )

16 skip over unused event

NEXT Y MLS

( DEF 0000 )

SHFT

( DEF 0000 )

SHFT

( DEF 0000 )

NEXT

( DEF 0000 )

NEXT

( DEF 0000 )

NEXT

( DEF 0000 )

NEXT

( DEF 0000 )

NEXT

Handheld Programmer Keystrokes cont’d

2 2

2

B

4 1 2 0 1 0 5 3 7 2

1

NEXT

( DEF K0000 )

NEXT

( DEF K0000 )

NEXT

( DEF K0000 )

NEXT NEXT NEXT

Output Pattern

NEXT NEXT

0

NEXT

Last rung

C E

( DEF K0000 )

J

( DEF K0000 )

E

( DEF K0000 )

J

( DEF K0000 )

16

J

F

( DEF K0000 )

step 1 pattern = 0000

NEXT

( DEF K0000 )

( DEF K0000 )

NEXT A

( DEF K0000 )

D F I

9 2 4 5 9 4 9 3 5 8

I I E B D E E I I E

( DEF K0000 )

NEXT

( DEF K0000 )

NEXT

( DEF K0000 )

NEXT

( DEF K0000 )

NEXT

( DEF K0000 )

NEXT

$

GY CNT

E

Y MLS

A

STR

SHFT

8 8 4 1 3 4 4 8 8 4

B J H G E I F

1 9 7 6 4 8 5

C E G J D G J

SHFT

A

G

E

E

6 4

H

2 4 6 9 3 6 9 0 4 7

NEXT NEXT NEXT NEXT NEXT NEXT NEXT NEXT NEXT NEXT unused steps

4

0

NEXT NEXT

NOTE: you may use the NXT and PREV keys to skip past entries for unused outputs or steps. NOTE: For ease of operation when using the EDRUM instruction, we recommend using DirectSOFT 5 over the handheld programmer.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 45

Chapter 6: Drum Instruction Programming

Masked Event Drum with Discrete Outputs (MDRMD)

1 2 3 4 5 6 7 8 9 10 The Masked Event Drum with Discrete Outputs features sixteen steps and sixteen outputs. 11 Drum outputs are logically ANDed bit-by-bit with an output mask word for each step. The Ggggg 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. 12 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). Whenever the Start input is energized, 13 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 14 energized. The drum enters the preset step chosen upon a CPU program-to-run mode transition, and whenever the Reset input is energized. A Drum Parameters Field Data Types Ranges Counter Number B Preset Step Timer base C Counts per step Event D Discrete Outputs 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 5. Direct SOFT 5 Display

Counter Number

Step Preset

Discrete Output Assignment

Timebase

Output Mask Word

Start

Control Inputs

{

Jog

Reset

Step Number

Counts per Step

Event per Step

Output Pattern 쏔= Off, 쐽= On

Output Mask aaa

–

0 – 174 bb

K

1 – 16 cccc

K

0 – 99.99 seconds dddd

K

0 – 9999 eeee

X, Y, C, S, T, ST, GX, GY. CT, SP

Fffff

X, Y, C, GX, GY

Ggggg

V see memory map

DL06 Micro PLC User Manual, 3rd Edition Rev. A

6–19

Page 46

Chapter 6: Drum Instruction Programming

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 6–20

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) CTA( n+1) CTA( n+2) CTA( n+3)

0 – 174 1 – 175 2 –176 3 –177

Counts in step Timer value Preset Step Current Step

CT(n) = Drum Complete CT(n+1) = (not used) CT(n+2) = (not used) CT(n+1) = (not used)

The following ladder program shows the MDRMD instruction in a typical ladder program, as shown by DirectSOFT 5. 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, 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. Start Jog Reset

Drum Complete Set Mask Registers

Direct SOFT 5 Display

NOTE: The ladder program must load constants in V2000 through V2012 to cover all mask registers for the eleven steps used in this drum

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 47

Chapter 6: Drum Instruction Programming

Masked Event Drum with Word Output (MDRMW)

1 2 3 4 5 6 7 8 9 10 The Masked Event Drum with Word Output features sixteen steps and sixteen outputs. 11 Drum outputs are logically ANDed bit-by-bit with an output mask word for each step. The Ggggg field specifies the beginning location of the 16 mask words, creating the final output (Fffff field). Step transitions occur on timed and/or event basis. The jog input also advances 12 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 13 entry). 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 14 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 a CPU program-to-run mode transition, and whenever the Reset input is energized. Drum Parameters Field Data Types Ranges B Counter Number Preset Step C Timer base Counts per step D Event 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 5. Direct SOFT 5 Display

Counter Number

Step Preset

Word Output Assignment

Timebase

Output Mask Word

Start

Control Inputs

{

Jog

Reset

Step Number

Counts per Step

Event per Step

Output Pattern 쏔= Off, 쐽= On

Word Output Output Mask aaa

–

0 – 174 bb

K

1 – 16 cccc

K

0 – 99.99 seconds dddd

K

0 – 9999 eeee

X, Y, C, S, T, ST, GX, GY, SP see memory map

Fffff

V see memory map

Ggggg

V see memory map

DL06 Micro PLC User Manual, 3rd Edition Rev. A

6–21

Page 48

Chapter 6: Drum Instruction Programming

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 6–22

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) CTA( n+1) CTA( n+2) CTA( n+3)

0 – 174 1 – 175 2 –176 3 –177

Counts in step Timer value Preset Step Current Step

CT(n) = Drum Complete CT(n+1) = (not used) CT(n+2) = (not used) CT(n+1) = (not used)

The following ladder program shows the MDRMD instruction in a typical ladder program, as shown by DirectSOFT 5. 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.

Start Jog Reset

Drum Complete Set Mask Registers

Direct SOFT 5 Display

NOTE: The ladder program must load constants in V2000 through V2012 to cover all mask registers for the eleven steps used in this drum

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 49

PLUS

RLL STAGE PROGRAMMING

CHAPTER

7

In This Chapter... Introduction to Stage Programming . . . . . . . . . . . . . . . . . . . . . . . .7–2 Learning to Draw State Transition Diagrams . . . . . . . . . . . . . . . . . .7–3 Using the Stage Jump Instruction for State Transitions . . . . . . . . . . .7–7 Stage Program Example: Toggle On/Off Lamp Controller . . . . . . . .7–8 Four Steps to Writing a Stage Program . . . . . . . . . . . . . . . . . . . . . .7–9 Stage Program Example: A Garage Door Opener . . . . . . . . . . . . . .7–10 Stage Program Design Considerations . . . . . . . . . . . . . . . . . . . . . .7–15 Parallel Processing Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–19 RLLPLUS (Stage) Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–21 Questions and Answers about Stage Programming . . . . . . . . . . . .7–27