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

The text of a manual · part 26 of 41

DL305 User Manual: Chapter 10: RLLPLUS Programming Basics, pages 212 to 221

Pages 212 to 221 of 357, from DL305 User Manual

The original document is the PDF (3.4 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 PLC Direct D3-08TD1, PLC Direct D3-16NA, Koyo D3-08TD1 and Koyo D3-16NA

Page 212

RLL PLUS Programming Basics Power Flow Transitions

You do not always have to use a Jump instruction to move from stage to stage. If you only move to one stage, instead of multiple stages, you can use what it is called a power flow transition. For example, we used Jump instructions in our sample program. For those stages that did not have multiple transition possibilities, we could have just used power flow transitions. Look at Stage 2. Notice how the transition contact, 002 now is directly connected to the next stage, Stage 3. You can only do this if you are moving from one stage to one other stage. If you examine Stage 1, you’ll notice we have to use the Jump instructions because the program can transition to more than one stage.

10--11

Only executes logic in stages that are active ISG

Wait for start

S000 Start

S1 JMP

000

SG

S150 SET

Check for a part

S001

Part Present

S2 JMP

001 Part Present

S5 JMP

001 SG

Lock the clamp

S002

Part Locked

Clamp SET 020

002

SG

Press the part

S003

Press Down 021 Lower Limit 004

NOTE: We suggest you use Jump Instructions instead of power flow transitions. This is because we’ve seen many cases where we had to come back and add things to the program. If you used Jumps from the beginning, you only have to add another Jump instruction. If you used power flow transitions, the program edits can take a little longer.

RLLPLUS Programming Basics

DL305 User Manual, Rev. D

Page 213

10--12

RLL PLUS Programming Basics

Using Outputs in Stages

Setting Outputs with the SET Instruction

Since the CPU only examines the logic in stages that are on, you have a lot more flexibility in how you use outputs with the RLL PLUS instructions. Also, you don’t have to worry about adding several permissive contacts to keep the output from coming on at an inappropriate time. (If the stage is not on,the CPU doesn’t even scan the stage, so the output can’t possibly be turned on by the logic in that stage.) If you examine Stage 2, you’ll notice we use a SET instruction to clamp the part in ISG Wait for start S000 place. Why a set? Simple. If we used a regular output the clamp will be Start S1 JMP deactivated when the program 000 S150 transitions to Stage 3. Remember, when SET you leave a stage the CPU no longer SG Check for a part S001 scans that stage until it is turned on Part again. So if we had used a regular OUT S2 Present JMP instruction, the CPU would have 001 automatically turned off the output, which Part S5 Present would have unclamped the part. JMP 001 The first example shows the program SG execution in Stage 2. The second Lock the clamp S002 example shows what happens on the Clamp next scan after the part is locked. Notice SET 020 the clamp output is still on even though Part Locked S3 the CPU is not scanning this portion of JMP 002 the program. This is why we use the SET instruction in this case. We want the clamp to stay on while the press completes the cycle. Next Scan after part is locked The clamp will stay on until the program SG enters Stage 4. Stage 4 unlocks the part Lock the clamp S002 by resetting output 020 when the press Clamp returns to the top limit. SET Part Locked

020 S3 JMP

002 SG

Press the part

S003

Press Down 021 Lower Limit

S4 JMP

RLLPLUS Programming Basics

004 SG

Unlock the clamp

S004 Top Limit 005

Part Unlocked 003

DL305 User Manual, Rev. D

Clamp RST 020 S5 JMP

Page 214

RLL PLUS Programming Basics Using the OUT Instruction

One other benefit with RLL PLUS is the ability to use the same output in multiple places. Instead of using the SET instruction in Stage 2, we could have just put the clamp output, 020, in all the stages where we wanted the part to remain clamped. If you examine Stage 2 you’ll notice output 020 is on because the stage is active. The next example shows what happens after the part is locked in place. The program moves to Stage 3 from Stage 2. Notice output 020 is now off in Stage 2. However, since we included the same clamp output in Stage 3, the part remains clamped in place. The clamp will automatically turn off when the program enters Stage 4. Notice Stage 4 does not have to have any kind of Reset instruction, since the output is automatically turned off when the program exits Stage 3. The concept of automatically turning off the outputs sometimes confuses many people. However, the CPU just uses a very simple algorithm to determine if the output should be turned off. The following diagram shows how this algorithm works.

ISG

Wait for start

S000 Start

S1 JMP

000

SG

10--13

S150 SET

Check for a part

S001

Part Present

S2 JMP

001 Part Present

S5 JMP

001 SG

Lock the clamp

S002

Clamp OUT 020 S3 JMP

Part Locked 002

Next Scan after part is locked SG

Lock the clamp

S002

Clamp OUT 020 S3 JMP

Part Locked 002 SG

Press the part

S003

Press Down 021 Clamp OUT 020 Lower Limit

Stage=On

No

S4 JMP

004 SG

Yes Any outputs on last scan?

No

Unlock the clamp

S004 Top Limit

Part Unlocked

005

003

S5 JMP

Yes

Examine Logic, AND results with 0

Skip to next active stage

DL305 User Manual, Rev. D

RLLPLUS Programming Basics

Execute Logic

Page 215

10--14

RLL PLUS Programming Basics

Latching Outputs with Stages

There’s one more way to control outputs with the Stage instructions. You may recall once a stage is turned on, you can only turn it off by resetting it, or by having a transition from it, either by a Jump or a power flow. What happens if you have a stage that does not have any kind of transition? What if it doesn’t have a Jump instruction or any other kind of transition contact leading to another stage? Simple. The stage will stay on until it is reset by some other part of the program that uses a Reset instruction. This makes it easy to use a stage without a transition to latch an output. For example, if you examine Stage 2 you’ll notice we’ve now changed this part of the program again. Now this stage sets Stage 140,which will be used to control the clamp. Notice Stage 140 does not have any type of transition. The only way to turn off the clamp is to Reset Stage 140. This instruction has now been included in Stage 4. So, after the program transitions to Stage 4, the Reset instruction will turn off Stage 140.

ISG

Wait for start

S000 Start

S1 JMP

000

SG

S150 SET

Check for a part

S001

Part Present

S2 JMP

001 Part Present

S5 JMP

001 SG

Lock the Clamp

S002

Part Locked

SET S140 S3 JMP

002

Next Scan after part is locked SG

Lock the clamp

S002

Part Locked

SET S140 S3 JMP

002 SG

Press the part

S003

Press Down 021

Lower Limit

S4 JMP

004 SG

Unlock the clamp

S004 Top Limit

Clamp RST S140

005 Part Unlocked

S5 JMP

003

RLLPLUS Programming Basics

SG

S140

Clamp Clamp 020

DL305 User Manual, Rev. D

Page 216

RLL PLUS Programming Basics

10--15

Using Timers and Counters in Stages Time Based Transitions

Up to this point we’ve been using certain events that triggered the transition from stage to stage. There will probably be many cases where the transition should be related to a timer value. For example, if you know the speed of the conveyor you could use a timer to control the conveyor movement. If we used this approach we would modify Stage 5 as shown. Notice the timer does not have a preset value. The timer begins incrementing as soon as it becomes active. Since the timer does not have a preset value, you do not have a timer contact, so you have to use a comparative instruction. In the example shown, the conveyor will be turned on for 5 seconds and then the program will jump to the next stage.

Only executes logic in stages that are active

SG

Unlock the clamp

S004 Top Limit

Clamp RST 020

005 Part Unlocked

S5 JMP

003 SG

Index the conveyor

S005

Move Conveyor 022 TMR

T600 50

SG

T600

S6 JMP

One cycle or automatic?

S006

One Cycle 007 One Cycle

S0 JMP S1 JMP

007

RLLPLUS Programming Basics

DL305 User Manual, Rev. D

Page 217

10--16

RLL PLUS Programming Basics There will also be times when you need to count things that happen throughout the process. For example, you may want to know the number of parts produced during any given shift, or you may know the presses generally require some type of maintenance after a certain number of cycles. If we wanted to count the number of widgets made on our simple press, we could just add a counter to Stage 4 to monitor how many times the press is used. We’re also going to use the counter as an automatic shutdown when the press has made 5000 parts so we’ve added a new rung in Stage 150 to perform the shutdown operation. Notice the counter does not have a reset leg. This is true only when you use a counter with the DL330P. (The other CPUs have counters with reset legs.) Even though this counter does not have a reset leg, it can be reset with a Reset instruction. This works just like an output reset, so you could place this reset wherever it is appropriate. We’ve placed it in Stage 150 for this example. When the parts count reaches 5000, the program will finish the current cycle, reset the part counter, and jump to Stage 0 to wait for another start cycle. You may notice we added an additional input, 006. This is what allows the program to finish the current cycle. (You may recall 006 only came on after the part was unlocked and the conveyor was indexed.)

RLLPLUS Programming Basics

Using Counters

DL305 User Manual, Rev. D

SG

Lock the clamp

S002

SET S150 S3 JMP

Part Locked 002 SG

Press the part

S003

Press Down 021

Lower Limit

CNT

C600

004 S4 JMP

SG

Monitor for stop

S150 Stop

020 -- 022 RST

010 S0 -- S6 RST S0 JMP

Parts Count C600 K5000

Index Conveyor 006

C600 RST S0 -- S6 RST S0 JMP

Page 218

RLL PLUS Programming Basics

10--17

Using Data Instructions in Stages Even though there are a few differences in the way some of the instructions operate between the various CPUs, there are many of the normal instructions that can be used inside an individual stage. For example, you may need to load data into the accumulator to perform some type of math, or, you may need to store values into register locations. If you examine Stage 3, you’ll notice we’ve added a couple of instructions. These instructions store the current parts count in a register. Now the CPU will take the current parts count, stored in R600, and load it into the accumulator with the DSTR instruction. Then this 4-digit BCD count will be moved to R400 with the DOUT instruction. This is just one example of how you can use the various types of data instructions. There are many other possibilities. Just remember, if the stage is active, the instructions can be executed. If the stage isn’t active, the instructions will not even be examined.

SG

Lock the clamp

S0002

SET S150 S3 JMP

Part Locked 002 SG

Press the part

S0003

Press Down 021

Lower Limit

CNT

C600

004 DSTR F50 R600 DOUT F60 R400 S4 JMP SG

Monitor for stop

S150 Stop

020 -- 021 RST

010 S0 -- S6 RST S0 JMP

Parts Count C600 5000

Index Conveyor 006

CT0 RST S0 -- S6 RST S0 JMP

RLLPLUS Programming Basics

DL305 User Manual, Rev. D

Page 219

10--18

RLL PLUS Programming Basics

RLLPLUS Programming Basics

Using Comparative Contacts in Stages You may recall you had to use a comparative instruction with the timers and counters. The DL330P provides several comparative contacts that are very useful. You can use these contacts to examine the relationship between a counter or timer value and a constant or register value. For example, let’s assume the pressed widgets move off the conveyor into a holding bin. The bin can only hold 1000 widgets, so we’ll add another counter, C601, to note how many widgets are in the bin. Also, we want to use different colored lights mounted on top of the press to alert a forklift driver the bin needs to be carried to the next operation. We’ll use the following indicators. Indicator Meaning Address Stage Green OK 040 21 Yellow Soon 041 22 Red Urgent 042 23 Reset Emptied 030 Notice we’ve added a few more stages to monitor this condition. For this example, assume the press has made 750 widgets. This means the Yellow indicator (Stage 22) should be active. We also need a way to reset the bin counter whenever the forklift driver empties the bin. If you examine Stage 21 through Stage 23, you’ll notice we reset the bin counter whenever the bin reset (030) is active. This example doesn’t show it, but you would also have to make some changes to other parts of the program. For example, you’d need to modify the Stop Stage to shut off these stages when the machine was stopped.

SG

Press the part

S0003

Press Down 021 Lower Limit

CNT

C600

004 DSTR F50 R600 DOUT F60 R400 CNT

Bin counter

C601

S4 JMP SG

Monitor lights for forklift

S0020

R601 K499

S21 SET S22 RST S23 RST

R601 500

R601

K899

S22 SET S21 RST

R601 K900

S23 SET S22 RST

SG

Bin level OK

S0021

040 OUT Bin Emptied

C601 RST

030 SG

Empty bin soon

S0022

041 OUT Bin Emptied

C601 RST

030 SG

Empty bin now

S0023

042 OUT Bin Emptied 030

DL305 User Manual, Rev. D

C601 RST

Page 220

RLL PLUS Programming Basics

10--19

Parallel Branching Concepts Branching Methods

As you examined some of the previous examples you saw we could have more than one stage being processed on any given scan. The CPU scanned the first active stage and then moved on to the next active stage, skipping any inactive stages in between. For some complex applications, you can easily have as many parallel paths as necessary. This is often called branching or divergence. There are a couple of approaches you can take when you want to turn on more than one stage. The diagrams shown don’t necessarily apply to our press example, but instead show the various approaches. Only executes logic in stages that are active In this example, you use one transition contact to activate several stages. ISG Wait for start S000 S The SET instruction sets a range of Start S20 -- S30 stages. These stages would remain SET on until they were reset, or, until 000 S2 any transition instructions contained JMP within the stages were executed. S50 JMP S There are two Jump instructions, both activating different stages. In this example, notice the stage that gets activated depends on an extra condition. For example, if the machine was capable of producing three different patterns, there may be a section of program for each pattern. There are other types of contacts that can be used. For example, you may recall we used Comparative contacts in some earlier examples. Notice we had to repeat the start switch in a separate rung each time. At first glance you would think you could simply have one Start switch contact and OR the remaining switches. The DL305 CPUs do support midline outputs (which is what this is called), but only in an AND situation.

Only executes logic in stages that are active ISG

Wait for start

S000 Start

Pattern 1

000

020

Start

Pattern 2

000

021

Start

Pattern 3

000

022

ISG S0000

S100 JMP

S200 JMP

S300 JMP

Wait for start Start

Pattern 1

000

020 Pattern 2

S100 JMP

S200 JMP

021 Pattern 3

S300 JMP

022

ISG

S000 S100 SET 000

001 S200 JMP 002 S300 JMP

000

023

DL305 User Manual, Rev. D

RLLPLUS Programming Basics

You can also use midline outputs to control branching conditions. Here’s an example of branching instructions that follow the guidelines for midline outputs. (This example is not for the press program, but merely shows how the midline outputs would appear.)

Page 221

10--20

RLL PLUS Programming Basics There are many times you have to bring parallel branches back together at some point in the program. You may recall the stages have status bits associated with them. You can use this status bit as a contact to easily converge the parallel paths. To illustrate this method, we’re going to use a simple press with two stations. Now a widget must get pressed at each station before it is a finished product. Since there are two stations, we must make sure both operations are complete before we move the conveyor.

RLLPLUS Programming Basics

Joining Parallel Branches

DL305 User Manual, Rev. D