The text of a manual · part 4 of 38
DL06 Micro PLC User Manual, Volume 2 of 2, pages 30 to 39
Pages 30 to 39 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.
Page 30
Chapter 6: Drum Instruction Programming
1 Step Transitions Drum Instruction Types 2 There are two types of Drum instructions in the DL06 CPU: • Timed Drum with Discrete Outputs (DRUM) 3 • Time and Event Drum with Discrete Outputs (EDRUM) The two drum instructions include time-based step transitions, and the EDRUM includes 4 event-based transitions as well. Each drum has 16 steps, and each step has 16 outputs. Refer to the figure below. Each output can be either a Y or C coil, offering programming flexibility. We assign Step 1 an arbitrary unique output pattern. 5 Timer-Only Transitions 6 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. 7 Step 1 Outputs : F f f f F f F f f f f F F f f f 8 9 Increment count timer 10 11 Ha s counts per No step expired? 12 Yes 13 Step 2 Outputs : f f f F f f f f F F f F f f F F 14 U s e next transition criteria A The drum stays 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 B unique counts per step, which you program. 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 C Step 2. The drum spends a specific amount of time in each step, given by the formula: D Time in step = 0.01 seconds X Timebase x Counts per step
6–4
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 31
Chapter 6: 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:
1 2 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 3 10% increments. Other steps with longer durations allow optimizing by even smaller increments (percentagewise). 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. 4 Timer and Event Transitions 5 Step transitions may also occur based on time and/or external events. The figure below shows how step transitions work in these cases. 6 Step 1 Outputs : F f f f F f F f f f f F F f f f 7 8 No Is Step event true? 9 Yes 10 Increment count timer 11 12 Has step No counts expired? 13 Yes 14 f f f F f f f f F F f F f f F F Step 2 Outputs : A U s e next tra ns ition criteria B 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 C 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 D timer increments as long as the event (X0) remains true. When the counts for Step 1 have Max Time per step = 0.01 seconds X 9999 X 9999 = 999,800 seconds = 277.7 hours = 11.6 days expired, then the drum moves to Step 2.The outputs change immediately to match the new pattern for Step 2.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
6–5
Page 32
Chapter 6: Drum Instruction Programming
Event-Only Transitions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Step transitions do not require both the event and the timer criteria 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:
Is Step event true? Yes
Step 2
Outputs:
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 the counter bit precisely indicate the progress of the drum instruction, and can be monitored by your ladder program. Counter Assignments Suppose we program a timer drum to have 8 Counts in step V1010 1528 CT10 steps, and we select CT10 for the counter number Timer Value V1011 0200 CT11 (remember, counter numbering is in octal). Preset Step V1012 0001 CT12 Counter usage is shown to the right. The right Current Step V1013 0004 CT13 column holds typical values, interpreted below. 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 leastsignificant-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 200). 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 changes only if the ladder program writes to it, or the drum instruction is edited and the program is restarted. Counter bit CT10 turns on when the drum cycle is complete, and turns off when the drum is reset.
6–6
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 33
Chapter 6: Drum Instruction Programming
Last Step Completion 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 met, the drum sets the counter bit corresponding to the counter named in the drum instruction box (such as CT10). Then it moves to a final “drum complete” state. The drum outputs remain in the pattern defined for the last step. 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 CT10), and then goes directly to the appropriate step number defined as the preset step. Las t step
No
Outputs :
Are tra ns ition conditions met?
F F F f f f F f f F f F F FfF
(Timer a nd/or Event criteria )
Yes Set CT10 = 1
S et Drum Complete bit
Complete
No
Outputs :
F F F f f f F f f F f F F Ff F
R es et Input Active? Yes R es et CT10 = 0
Res et Drum Complete bit
G o to Pres et Step
DL06 Micro PLC User Manual, 3rd Edition Rev. A
6–7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Page 34
Chapter 6: Drum Instruction Programming
1 Overview of Drum Operation Drum Instruction Block Diagram 2 The drum instruction utilizes various inputs and outputs in addition to the drum pattern itself. Refer to the figure below. 3 Inputs DRUM INSTRUCTION Outputs Block Diagram 4 5 6 7 8 9 10 Counter Assignments 11 V1010 Counts in step xxxx V1011 Timer Value xxxx 12 V1012 Preset Step xxxx V1013 Current Step xxxx 13 The drum instruction accepts several inputs for step control, the main control of the drum.The inputs and their functions are: 14 • 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 A 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 B increments the drum to the next step on each off-to-on transition (only EDRUM supports the jog input). C • 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 D this step whenever Reset is on, and whenever the CPU first enters run mode. Start
Real time Input s (from ladder )
Jog
Reset
Preset Step
Counts/Step
Drum
Step Control
Step Poi nter
Timebase
Programming Selections
Events
Counter #
Pattern
CTA10
CTA11
CTA12
CTA13
6–8
DL06 Micro PLC User Manual, 3rd Edition Rev. A 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
Final Drum Outputs
Page 35
Chapter 6: Drum Instruction Programming • 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.
1 • Timer Value – the current value of the counts/step timer. • Counter # – The counter number specifies the first of four consecutive counters which the drum 2 uses for step control. You can monitor these to determine the drum’s progress through its control cycle. The DL06 has 128 counters (CT0 – CT177 in octal). 3 • Events – Either an X, Y, C, S, T, or CT type discrete point serves as step transition inputs. Each step has its own event. However, programming the event is optional. 4 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 current step of the 5 drum. This initial step number depends on the counter memory configuration: non-retentive versus retentive. 6 Powerup State of Drum Registers 7 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 8 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. 9 Initialization on Powerup Counter Number Function Non-Retentive Case Retentive Case 10 11 12 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 13 default option is the retentive case. This means that if you initialize scratchpad V-memory, the memory will be retentive. 14 A B C D CTA(n) CTA(n + 1) CTA(n + 2) CTA(n + 3)
Current Step Count Counter Timer Value Preset Step Current Step #
Initialize = 0 Initialize = 0 Initialize = Preset Step # Initialize = Preset Step #
Use Previous (no change) Use Previous (no change) Use Previous (no change) Use Previous (no change)
DL06 Micro PLC User Manual, 3rd Edition Rev. A
6–9
Page 36
Chapter 6: Drum Instruction Programming Start 1 Drum Control Techniques Setup Jog Drum Control Inputs Outputs Info 2 Now we are ready to put together the concepts Reset on the previous pages and demonstrate general 3 control of the drum instruction box. The Steps drawing to the right shows a simplified generic drum instruction. Inputs from ladder logic 4 control the Start, Jog, and Reset Inputs (only the EDRUM instruction supports the Jog 5 Input). The first counter bit of the drum (CT10, for example) indicates the drum cycle is done. 6 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 7 number (typically it is Step 1). When the Start input turns on the drum begins running, waiting for an event and/or running the timer (depends on the setup). 8 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 9 turns off. After the drum has entered step 3, the Start input goes off momentarily, halting the drum’s 10 timer until Start turns on again. 11 12 13 14 A B When the drum completes the last step (Step 16 in this example), the Drum Complete bit C (CT10) turns on, and the step number remains at 16. When the Reset input turns on, it turns off the Drum Complete bit (CT10), and forces the drum to enter the preset step. D X0 X1 X2 f f f F f f f f
S tart drum
Inputs S tart
1 0
J og
1 0
Reset
1 0
Drum S tatus S tep #
1
Reset drum
1
2
1
Hold drum
1
2
3
Resume drum
3
4 ...
f f f F F F F F
F f f f F F f F f f f F f f f f
Drum Reset Complete drum
15 16
16 16 1
1
1
Drum Complete (CT10) 0 1 Outputs (x 16) 0
NOTE: The timing diagram shows all steps using equal time durations. Step times can vary greatly, depending on the counts/step programmed.
6–10
DL06 Micro PLC User Manual, 3rd Edition Rev. A f f F F F F F F f f f f f f F F F
Page 37
Chapter 6: 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. Jog drum Inputs S tart
1 0
Jog
1 0
R es et
1 0
Drum Completed R es et Jog drum drum
Jog drum
Drum S tatus 1
S tep # Drum Complete (CT0) Outputs (x 16)
2
3
3
3
4
5
6,7
8
...
14
15
16
16
16
1
1 0 1 0
Self-Resetting Drum 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 CT10, so we logically OR the drum complete bit (CT10) with the Reset input. When the last step is done, the drum turns on CT10 which resets itself to the preset step, also resetting CT10. Contact X2 still works as a manual reset.
X0
Start
X1
Start
X2
R es et
CT10
Setup Info. Steps
Outputs 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
Initializing Drum Outputs 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.
Using Complex Event Step Transitions 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 ladder logic, you may use C0 as an output coil, making it dependent on many other “events” (contacts).
DL06 Micro PLC User Manual, 3rd Edition Rev. A
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
6–11
Page 38
Chapter 6: Drum Instruction Programming
1 Drum Instruction The DL06 drum instructions may be programmed using DirectSOFT 5 or for the EDRUM instruction only you can use a handheld programmer (firmware version v2.21 or later). This 2 section covers entry using DirectSOFT 5 for all instructions plus the handheld mnemonics for the EDRUM instruction. 3 Timed Drum with Discrete Outputs (DRUM) The Timed Drum with Discrete Outputs is the most basic of the DL06’s drum instructions. 4 It operates according to the principles covered on the previous pages. Below is the instruction in chart form as displayed by DirectSOFT 5. 5 6 7 8 9 10 11 12 The Timed Drum features 16 steps and 16 outputs. Step transitions occur only on a timed 13 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, 14 or C types, or may be left unused. The output pattern may be edited graphically with DirectSOFT 5. Whenever the Start input is energized, the drum’s timer is enabled. It stops when the last step A 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. B Drum Parameters Field Data Types Ranges C D Direct SOFT 5 Display
Step Preset
Counter Number
Timebase
Discrete Output Assignment
Start
Control Inputs
{
Reset
Step Number
Counts per Step Output Pattern 쏔= Off, 쐽= On
Counter Number Preset Step Timer base Counts per step Discrete Outputs
6–12 aaa -bb cccc dddd Fffff
DL06 Micro PLC User Manual, 3rd Edition Rev. A
0 --174 K K K X, Y, C
1 -- 16 0 -- 99.99 seconds 0 -- 9999 see memory map
Page 39
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. 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+3) = (not used)
The following ladder program shows the DRUM instruction in a typical ladder program, as shown by DirectSOFT 5. 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 second 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
Direct SOFT 5 Display
DL06 Micro PLC User Manual, 3rd Edition Rev. A
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
6–13