The text of a manual · part 27 of 41
DL305 User Manual: Chapter 10: RLLPLUS Programming Basics, pages 222 to 231
Pages 222 to 231 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 222
RLL PLUS Programming Basics
10--21
Here’s a flowchart that describes the two-station press. Please note we’ve changed some of the stage numbers, input numbers, and output numbers, so they won’t necessarily match the previous examples. Check for Stop Stage150
Reset all stages Jump to Start
Check for Parts in A&B Stage 10
Lock the clamp
Press the Part
Unlock clamp
Wait for Station B
Move Conveyor
Check Mode
A Stage 20
Stage 21
Stage 22
Stage 23
Stage 40
Stage 50
Station A Wait for Start Stage 0
No Part in A
Station B Lock the clamp
Press the Part
Unlock clamp
Station B Finished
B Stage 30
Stage 31
Stage 32
Stage 33
Program must converge into a single path again
No Part in B
One Cycle
Continuous
You’ve already seen how the basic sequence of operations was executed. so we’re only going to show the portions of the program that describe how the branches are joined together.
RLLPLUS Programming Basics
DL305 User Manual, Rev. D
Page 223
10--22
RLL PLUS Programming Basics
Using Stage Bits as Contacts
If you examine the flowchart you’ll notice once the part is unclamped in station B, the program transitions to Stage 33 which indicates Station B is complete. If you look at that portion of the program shown here, you’ll notice there are no other instructions or actions that take place in this stage. This is why we call it a “dummy” stage. We’re just going to use the status of the stage bit associated with this dummy stage as a contact elsewhere in the program to indicate station B is finished. You may be wondering how we can turn off this stage. Since it does not have any type of jump or power flow transition, the only other option is to Reset the stage. We’ll do this later in the program.
Station B SG
Lock the clamp
S030
Clamp SET 020 S31 JMP
Part Locked 023 SG
Press the part
S031
Press Down 021
Lower Limit
S32 JMP
024 SG
Unlock the clamp
S031 Top Limit
Clamp RST 020
025 Part Unlocked
S33 JMP
023 SG
S0033
Station B Finished
Check for Stop Stage 150
Reset all stages Jump to Start
Check for Parts in A&B Stage 10
Lock the clamp
Press the Part
Unlock clamp
Wait for Station B
Move Conveyor
Check Mode
A Stage 20
Stage 21
Stage 22
Stage 23
Stage 40
Stage 50
Station A Wait for Start Stage 0
No Part in A
RLLPLUS Programming Basics
Station B Lock the clamp
Press the Part
Unlock clamp
Station B Finished
B Stage 30
Stage 31
Stage 32
Stage 33
No Part in B One Cycle
Continuous
DL305 User Manual, Rev. D
Program must converge into a single path again
Page 224
RLL PLUS Programming Basics Stage Contact Example
Since each stage has a status bit that is either on or off, you can use this bit as a contact in the program. If you examine Stage 23 you’ll notice we’ve used a contact labeled S33. This contact reflects the status of Stage 33, which indicated Station B was finished. When S33 is on, the contact labeled S33 is also on and the program will transition to Stage 40. In Stage 40 we use a reset instruction to reset Stage 33 before we move the conveyor.
10--23
Only executes logic in stages that are active
Station A SG
Clamp the part
S020
Part Locked
Clamp SET 020 S21 JMP
002 SG
Press the part
S021
Press Down 021 Lower Limit
S22 JMP
004 SG
Unlock the clamp
S022 Top Limit
Clamp RST 020
005 Part Unlocked
S23 JMP
003 SG
Wait for Station B to finish
S023
B Finished
S40 JMP
S33 SG
Index the conveyor
S040
B Finished RST S33 Conveyor 022
Conveyor Moved
S50 JMP
006 SG
One cycle or automatic?
S050
One Cycle
S0 JMP
007 One Cycle
S10 JMP
007
RLLPLUS Programming Basics
DL305 User Manual, Rev. D
Page 225
10--24
RLL PLUS Programming Basics
Unusual Operations in Stages
Using the Same Output Multiple Times
Over the last few pages you’ve learned how the CPU executes the Stage instructions. However, there are a few unusual circumstances that may not work exactly as the appear. In the program shown it appears output 021 will be turned on at three separate SG times before the program jumps to the S0010 next stage. However, the only time the TMR T600 output actually comes on is when the final condition has been met. T600 K100 021 Why? Remember if you use multiple OUT outputs in a program, the last rung 021 T600 K200 T600 K500 containing the output controls the status OUT that will be written to the module. This is 021 T600 900 no different in a program that uses OUT PLUS instructions. RLL Finished S20 In this example, the last comparison rung JMP 001 says the output should be off until the timer value reaches 90 seconds.
RLLPLUS Programming Basics
In the previous example the same output was used multiple times in the same stage. The last use of the output controlled the status of the output. There may be occasions when you have the same output in different stages. Even though it’s not advisable to do this in normal RLL programs, this is perfectly acceptable with a program that uses RLL PLUS instructions. However, if both stages are active at the same time, then the logic in the last stage will control the status of the output. In the example shown, if both stages are active, then the logic in Stage 70 will control the output status.
DL305 User Manual, Rev. D
SG
S0010 021 OUT 001 S002 JMP 002
SG
S070 021 OUT 010
011 S002 JMP
006
Page 226
RLL PLUS Programming Basics
Using a Set Out Reset (SET OUT RST) Instruction
Output Placement
Many normal RLL programs use one-shot instructions. In the DL305 instruction set, this instruction is called a Set Out Reset (SET OUT RST). In the program shown, input 001 will trigger the SET OUT RST 160 instruction, which will in turn activate output 021 for one scan. However, what happens if 001 stays on and Stage 10 is activated, deactivated, and then activated again? At first glance it appears the one shot only gets executed one time since 001 stayed on while Stage 10 was turning on and off. It doesn’t work this way. The logic in an inactive stage is not executed. So even though the stage became active the SET OUT RST instruction did not see an off to on transition, so the instruction is not executed. The SET OUT RST instruction will work in an active stage as long as the input transitions from off to on while the stage is active.
Scan N SG
One Shot is executed
S010 001
160 SET OUT RST
160
021 OUT
Scan N + 10 SG
Stage off, One Shot is not executed
S0010 001
160 SET OUT RST
160
021 OUT
Scan N + 20 SG
S0010
One shot must see off to on 001
160 SET OUT RST
160
021 OUT
Incorrect Placement SG
S0010 001
CNT
C600
021 OUT 003
S11 JMP
Correct Placement SG
S0010 021 OUT 001
CNT
003
DL305 User Manual, Rev. D
C600
S11 JMP
RLLPLUS Programming Basics
As you’ve seen in some of the previous examples, we always place unconditional outputs immediately following the Stage Instructions. There’s a reason for doing this. If you look at the example stage shown here, the output is placed after a counter box. The DirectSOFT software and the Handheld Programmer will allow you to enter this as shown. However, the CPU will only turn on output 021 when the counter input 001 is turned on. This is because the CPU interprets the output as being tied to the counter input leg instead of the Stage power rail. You can easily avoid this problem by placing any unconditional actions at the very beginning of the stage. Then, the output will work the way you expect.
10--25
Page 227
10--26
RLL PLUS Programming Basics
Two Ways to View RLL PLUS Programs Throughout the example programs, we’ve consistently shown how the instructions appear in when viewed as ladder instructions. However, with DirectSOFT, you also have the capability to view the program as a flowchart. You can even view the program flowchart (in Stage View) and view the ladder program at the same time with a split screen feature. The DirectSOFT manual provides detailed information on how to view the programs in this manner. DirectSOFT Stage View ISG S0
J
J
SG
Stage
SG S1
SG S150
Reference to a Stage
DirectSOFT Ladder View
J
SG S2
S
SG S140
J
SG S6
J
SG S3
J
ISG S0
R
SG S140 Transition Logic
ISG
J
Wait for start
S000 Start
S1 JMP
000 SG
Check for a part
S001
Part Present
S2 JMP
001 Part Present
S5 JMP
001
RLLPLUS Programming Basics
SG
Lock the clamp
S002
Part Locked
Clamp SET 020 S4 JMP
002 SG
Press the part
S003
Press Down 021 Lower Limit 004
DL305 User Manual, Rev. D
S4 JMP
Jump
S
Set Stage
R
Reset Stage
Page 228
RLL PLUS Programming Basics
10--27
Designing a Program Using RLL PLUS Instructions As with most any application problem, a thorough understanding of the tasks combined with a good plan of execution often results in success. The RLL PLUS instructions provide an easy way to load the plan of execution directly into the CPU. The easiest way to make sure you understand the tasks is to make a flowchart. This is often the most critical part of creating a program that uses RLL PLUS instructions. There are a few simple steps you can follow to create a detailed flowchart. 1. Create a top-level flowchart. 2. Expand the flowchart by adding things that cause the transitions from step to step. 3. Add any actions that must occur in each step. 4. Add any conditions that control the actions. 5. Add any special monitoring or alarm steps that must be performed. 6. Assign numbers to the stages (steps). 7. Add the I/O instructions and addresses (input contacts, output coils, jump instructions, etc.) 8. Enter the program. Use DirectSOFT to The DirectSOFT programming package allows you to quickly and easily create programs with RLL PLUS instructions. The software has special features that allow Save Time you to create the flowcharts, add the transitions, actions, etc. Even if your programs are fairly small, DirectSOFT can make the job much easier.
RLLPLUS Programming Basics
DL305 User Manual, Rev. D
Page 229
10--28
RLL PLUS Programming Basics
Step 1: Design a Top-level Flowchart
There are many different ways to design a flowchart of the application problem, but there are a few guidelines that will make the job easier. 1. Start with a “top-level” flowchart that breaks the operation sequence into simple pieces. 2. Each piece of the top-level flowchart should only represent one action. Resist the temptation to group several operations into one part of the flowchart. 3. Don’t try to add input or output addresses to the flowchart. Only use words to describe the things that are taking place. 4. Don’t worry about special conditions, such as stop conditions, alarms, etc at this point. These will be added later when you fully understand how the main part of the operations sequence is organized. You can draw the flowchart horizontally or vertically at any point in the design process, the choice is yours. Here’s an example top level flowchart for our simple one-station press. The flowchart breaks the program into logical steps
Wait for Start
RLLPLUS Programming Basics
One Cycle
DL305 User Manual, Rev. D
Check for Part
Continuous Check Mode
Lock Clamp
Press Part
Unlock Clamp
Move Conveyor
Page 230
RLL PLUS Programming Basics Step 2: Add Flowchart Transitions
10--29
Once you have designed the basic operating sequence you should determine the events that cause a transition from step to step. During this phase you may find things need to be added to the flowchart. All you’re really doing is adding more detail to the top-level flowchart. Once again, don’t try to use addresses yet. Concentrate on using words to describe the events taking place. The following flowchart adds the transition conditions for our one-station press. Wait for Start
Transition Symbol Press Start Switch
Check for Part
Part in place
No Part
Lock the Clamp
Jump to Move Conveyor
Clamp Limit Switch
Press the Part
Press Lower Limit Switch Unlock the Clamp
Unclamp Limit Switch Move Conveyor
Conveyor Index Limit Switch
Check 1-cycle Switch ON Jump to Wait for Start
Check 1-cycle Switch OFF Jump to Check for Part
DL305 User Manual, Rev. D
RLLPLUS Programming Basics
Check Mode
Page 231
10--30
RLL PLUS Programming Basics
Step 3: Add Actions
After you determine the events that cause a transition from step to step you should add any actions that need to take place during the sequence. Again, don’t try to use addresses yet. Concentrate on using words to describe the actions taking place. The following flowchart adds the actions that take place during each part of the program. Wait for Start
Press Start Switch
Check for Part
Part in place
No Part Jump to Move Conveyor
Lock the Clamp Clamp On Clamp Limit Switch
Action Symbol
Press the Part Press Press Lower Limit Switch Unlock the Clamp Clamp Off Unclamp Limit Switch Move Conveyor Conveyor On Conveyor Index Limit Switch
RLLPLUS Programming Basics
Check Mode
Check 1-cycle Switch ON Jump to Wait for Start
DL305 User Manual, Rev. D
Check 1-cycle Switch OFF Jump to Check for Part