Home
Chapter 10 - AutomationDirect
Contents
1. Step 5 Many people are tempted to add alarm or monitoring operations earlier in the Add Alarm or flowchart design process It is almost always easier to add them last because then Monitoring you know how they should affect the main part of the program The following Operations flowchart adds an operation that monitors for the conditions that will stop the press Wait for Start Press Start Switch Y y Monitor for Stop Check for Part t Stop Switch Part in place No Part Y Reset all Operations Jump to Lock the Clamp Move Conveyor Y Clamp On Jump to Wait ee for Start _ F Clamp Limit Switch y Press the Part Press On Press Lower Limit Switch y Unlock the Clamp a Up Clamp a Unclamp Limit Switch y Move Conveyor Conveyor On Conveyor Index Limit Switch Y Check Mode N 2 a Oo Y a Check 1 cycle Switch ON Check 1 cycle Switch OFF a3 Jump to Wait Jump to T E for Start Check for pe Part D A DL305 User Manual Rev D RLLPLUS Programming Basics Step 6 You can number the stages any way you would like but it s usually best to follow Determine Stage some type of sequence that matches the flow of the program This makes it much Numbering easier to understand There are a few guidelines we have used to determine
2. We did not absolutely have to use a SET instruction in the example We could have used a Jump since you can jump to more than one stage We just used a SET to show how it works If you examine Stage 150 you ll notice we do three things when the stop switch is pressed e The RST 020 022 instruction makes sure all the outputs are turned off We ll discuss this in more detail in the next section e The RST SO S6 instruction resets turns off stages 0 through 6 We reset the entire range so that we guarantee we can stop the press no matter which stage is currently executing Notice we reset stages that were not necessarily turned on with the SET instruction The Reset RST instruction can be used to turn off stages no matter how they were turned on This is especially handy in larger more complex programs e The program jumps back to Stage 0 and starts over again Note just because Stage 0 is an initial stage does not mean it can only be active at a transition to Run Mode You can return to an Initial Stage at any time It s just the CPU automatically activates Initial Stages at the Run Mode transition DL305 User Manual Rev D RLLPLUS Programming Basics Power Flow You do not always have to use a Jump Only executes logic in stages that are active Transitions instruction to move from stage to sta
3. An RLLP LYS Solution The RLLPLUS instructions keep the simplicity of the contacts and coils while removing some of the problems associated with the enormous amount of interlocks There are several RLL YS instructions but the most often used are the Initial Stage ISG Stage SG and Jump JMP instructions Here s the example press program created using RLL YS instructions There are two things you should notice e Control Relay interlocks are not Only executes logic in stages that are activi required ee e The program directly follows the Sooo Melb foretent flowchart of the press operation Star cabs How can this happen Simple The 000 interlocks were added to the RLL 3G oon Check for a part program to keep the outputs from coming a on at the improper time This is because Present r every rung of the RLL program was bot examined on every scan Present s5 The Stage instructions and the logic 001 a between the Stage instruction and the Sa o Ldk inerti next stage instruction are not necessarily examined on every scan Clamp Only stages that are on are examined a 020 Locked Each stage instruction has a status bit JMP that is on when the stage is active and off ne when the stage is inactive On every scan SG so
4. Q set 3 Z3 J Q gJ ped 2 9 n snidild RLLPLUS Programming Basics Using Counters There will also be times when you need E to count things that happen throughout the process For example you may want a to know the number of parts produced soo Lock the clamp during any given shift or you may know the presses generally require some type SE of maintenance after a certain number of Locked 3 cycles me 002 If we wanted to count the number of widgets made on our simple press we Sa E Press the part could just add a counter to Stage 4 to press monitor how many times the press is 021 used We re also going to use the counter as an automatic shutdown when the y press has made 5000 parts so weve Lower added a new rung in Stage 150 to perform the shutdown operation Notice the counter does not have a reset MP leg This is true only when you usea counter with the DL330P The other CPUs have counters with reset legs Eventhough this counter does not havea CNT C600 SG 150 Monitor for stop reset leg it can be reset with a Reset instruction This works just like an output ai rst reset so you could place this reset 010 wherever it is appropriate We ve placed rst itin Stage 150 for this example Y When the parts count reaches 5000 the JMP prog
5. JMP DL305 User Manual Rev D a fe Co Q D 3 3 5 Co y D o O a RLLPLUS Programming Basics Unusual Operations in Stages 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 Using the Same In the program shown it appears output Output Multiple 021 will be turned on at three separate Times times before the program jumps to the next stage However the only time the output actually comes on is when the TMR T600 final condition has been met Why Remember if you use multiple aa our outputs in a program the last rung containing the output controls the status Toe eae EOD ee our that will be written to the module This is 7 no different in a program that uses T600 900 021 RLLPLUS instructions i on In this example the last comparison rung Sui ie JMP says the output should be off until the 001 l timer value reaches 90 seconds In the previous example the same output was used multiple times in the same stage The last use of the output coer controlled the status of the output There may be occasions when you have our the same output in different stages Even 001 though it s not advisable to do this in so02 normal RLL programs this is perfectly M
6. transition conditions for our one station press Wait for Start Transition Symbol Press Start Switch 7 y Check for Part Part in place No Part L Jump to Lock the Clamp Move Conveyor Clamp Limit Switch y Press the Part Press Lower Limit Switch y Unlock the Clamp Unclamp Limit Switch y Move Conveyor Conveyor Index Limit Switth y U a Check Mode amp e w 3 5 Check 1 cycle Switch ON Check 1 cycle Switch OFF Q l i p rN Jump to Wait Jump to QD for Start Check for i Part DL305 User Manual Rev D RLLPLUS Programming Basics Step 3 After you determine the events that cause a transition from step to step you should Add Actions 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 y Check for Part Part in place No Part L Jump to Lock the Clamp Move Conveyor Clamp On Clamp Limit Switch od i Action Y Symbol Press the Part Press Press Lower Limit Switch y Un
7. JMP 002 SG S003 Press the part Press Down 021 Lower Limit S4 JMP 004 SG S004 Unclamp the part Top Limit Clamp RST 005 S140 Part Unlocked S5 JMP 003 SG S005 Index the conveyor Move Conveyor 022 Conveyor Moved S6 JMP 006 SG g S006 One cycle or automatic One Cycle So A ne 007 QR s1 JMP 007 DL305 User Manual Rev D A SG S140 Clamp lamp OUT 020 SG 150 Check for Stop Stop So S140 RST l 010 S000 JMP RLLPLUS Programming Basics This diagram shows how a portion of the program would look when viewed as a Stage Diagram in DirectSOFT Wait forStart Check for a Part Clamp the part Clamp ISG SG SG SG PS hH H l a SG Press the part aoin S6 Check for Stop ISG gt Dat PH s S1 ie 4 a O Ke Q D 3 3 5 Co D o O 2 DL305 User Manual Rev D
8. has a unique status bit No Duplicate Numbers you cannot have stages with the same address number For example since the SG SG example program already has a Stage1 S001 1 S002 we wouldnt want to use that number again There s another advantage to having a Skip Numbers if Necessary status bit for each stage This allows you to skip stage numbers as necessary This SG SG SG is a good practice to follow because it 5020 2090 makes it easier to insert stages later without affecting the appearance of the program flow The stage numbers do not necessarily Non sequential Numbering have to be numbered sequentially but it can be extremely helpful to use 2G aap te SG S0 sequential numbers if you are working with large programs Also the stages do not have to be gt entered sequentially with the Only executes logic in stages that are active programming device For example you SG could have Stage 100 be the first entry in ee Famers pan the program This is not a good Bowe programming practice but since the an 021 CPU looks at the active status bits to Cini JMP determine which stages to execute it bo4 doesn t care where the stages are ISG S000 Wait for start physically located in
9. in how you use outputs with the RLLPLUS 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 i 2 N Oo aa is fan pes e pe oO Setting Outputs with the SET Instruction If you examine Stage 2 you ll notice we use a SET instruction to clamp the part in place Why a set Simple If we used a regular output the clamp will be deactivated when the program transitions to Stage 3 Remember when you leave a stage the CPU no longer scans that stage until it is turned on again So if we had used a regular OUT instruction the CPU would have automatically turned off the output which would have unclamped the part The first example shows the program execution in Stage 2 The second example shows what happens on the next scan after the part is locked Notice the clamp output is still on even though the CPU is not scanning this portion of 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 The clamp will stay on until the program enters Stage 4 Stage 4 unlocks the part by resetting output 020 when the press returns to the top limit DL305 User Manual Rev D ISG S000 Wait for
10. it or by having a transition from it either by a Jump ora 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 DL305 User Manual Rev D 1 jg ISG S000 Wait for start Start S1 1 JMP 000 150 SET SG soot Check for a part Part Present S2 JMP 001 P preatht S5 JMP 001 SG 002 Lock the Clamp SET Part 140 Locked s3 JMP bol 02 Next Scan after part is locked SG 002 Lock the clamp SET Part 140 Locked S3 JMP 002 SG S003 Press the part Pr
11. not executed The SET OUT RST instruction will work 160 in an active stage as long as the input transitions from off to on while the stage is active became active the SET OUT RST re 001 160 SET OUT RST 021 OUT Output Placement As you ve seen in some of the previous examples we always place Incorrect Placement unconditional outputs immediately SG following the Stage Instructions There s a reason for doing this 901 CNT C600 If you look at the example stage shown here the output is placed after a counter val box The DirectSOFT software and the Handheld Programmer will allow you to 003 s enter this as shown However the CPU JMP 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 Correct Placement placing any unconditional actions at the SG very beginning of the stage Then the es output will work the way you expect OUT 0010 0010 901 CNT C600 snidild 003 a O Co Q D 3 3 5 Co W D o O 2 S11 JMP DL305 User Manual Rev D RLLPLUS Programming Basics Two Ways to View RLL YS Programs DirectSOFT Stage View ISG SO Throughout the example programs we ve consi
12. start S1 o9 Sya SG S001 Check for a part Part Present JMP S150 SET 001 Part Present 001 SG S002 Lock the clamp Part Lopkad bob Next Scan after part is locked SG S002 Lock the clamp Part Boeken bob SG S003 Press the part SG S004 Unlock the clamp To Limit Clamp RST 005 Part Unlocked 020 S5 003 JMP Using the OUT Instruction One other benefit with RLL 4YS 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 somet
13. v ie Q set 3 Z3 J Q gJ ped 2 9 n DL305 User Manual Rev D RLLPLUS Programming Basics Initial Stage 0 Wait for Start Press Start Switch j y y Stage 150 Stage 1 Monitor for Stop Check for Part Stop Switch Part in place No Part y Reset all Operations Stage 2 Jump to Lock the Clamp rae Y Clamp On Jump to Wait for Start aA Clamp Limit Switch 1 y Stage 140 Stage 3 Clamp Press the Part Press r A Press Lower Limit Switch y Stage 4 Unlock the Clamp Press Up Clamp Off Unclamp Limit Switch y Stage 5 Move the Conveyor Conveyor On Conveyor Index Limit Switth y Stage 6 Check Mode Check 1 cycle Switch ON Check 1 cycle Switch OFF Jump to Wait Jump to for Start Check for Part i 2 N Oo aa fan pes e pe oO DL305 User Manual Rev D RLLPLUS Programming Basics Step 7 The final step before you enter the program is to assign the I O addresses and the Assign I O destinations for any Jump Set or Reset instructions Addresses Initial Sta
14. CPU DL305 User Manual Rev D RLLPLUS Programming Basics An Example Machine Machine Operation Mostany application can be described as a sequence of events The PLC program merely makes sure the events are completed in a specific order Not only does the program control normal operation but it also has to allow for machine failures and emergency omot conditions Consider a simple example Switch 1 The operator presses the start switch Part 2 The machine checks for a part If the Detection part is present the process Sensor continues If not the conveyor moves until a part is present 3 The part is locked in place with a clamp 4 The press stamps the part 5 The clamp is unlocked and the finished piece is moved out of the press 6 Theprocess stops ifthe machine is in one cycle mode or the process continues if automatic mode is selected Press Arm Part Machine Flowchart The following diagram provides a flowchart of this operations sequence The flowchart breaks the program into logical steps Wait for Check for Lock the Press the Unlock Move Start Part clamp Part clamp Conveyor Step 1 Step 2 Step 3 Step 4 Step 5 Step 6 Continuous One Cycle Step7 x U Check la Mode Kej Inputs Outputs YD 37 Start Switch 000 Clamp 020 35 Part Present 001 Press 021 B m Part Locked 002
15. Conveyor 022 O Part Unlocked 003 y Lower Limit 004 v Upper Limit 005 P Conveyor Indexed 006 One Cycle Switch 007 DL305 User Manual Rev D i 2 N oO aa is fan pes o gt e oO RLLPLUS Programming Basics An RLL Solution Why is RLL so popular Simple Before Executes all rungs Left to Right Top to bottom the PLC arrived control problems were gt generally solved with hardwired relays i i E V4 our and switches About 30 years ago people 160 ve on ieo started experimenting with a way to iat make quick and easy changes without 000 changing the actual panel wiring Thus RUN Present ae the PLC was born Since the people ieo oor developing and using this new Part TIS technology were familiar with the relay Sai Ja P and switch solution it made sense to 003 162 020 have this new technology emulate Te something that was familiar to them 020 ee aes ae That s why RLL programs emulate a eis ee our relay panel solution ot boa cos a When you supply power to a relay panel nee the combination of contact and coil status 161 determines what actions take place Part Lower oP T Since the RLL program emulates the 14 I4 our relay panel solution the entire program Ha oo S is scanned left to right top to bottom The program executes the operations sequence when a certain combination
16. RLL LUS Programming Basics In This Chapter Introduction An Example Machine An RLL Solution An RLLP US Solution Stage Instruction Execution Activating Stages Using Outputs in Stages Using Timers and Counters in Stages Using Data Instructions in Stages Using Comparative Contacts in Stages Parallel Branching Concepts Unusual Operations in Stages Two Ways to View RLL Y S Programs Designing a Program Using RLLP YS Instructions 10 2 RLLPLUS Programming Basics i 2 N oO aa is fan pes eo e pe oO Introduction If you ve ever been around some really accomplished RLL programmers you have probably been amazed at how easily they seem to be able to create programs of incredible complexity Well not everyone has years of experience in programming PLCs Because of this the DL380P CPU has RLLP YS instructions that make it considerably easier to design and create programming solutions These instructions are especially useful to those of you who aren t that familiar with the interlocking concepts commonly used in RLL programs You can still use the normal instructions you ve already seen plus you only have to become familiar with a few new instructions that help you organize your program into manageable pieces This programming method is similar to Sequential Function Chart programming and literally allows you to design a flowch
17. art of the program operation sequence and load it into the CPU You can expect to see several benefits by using this method e Considerably reduced program design time We ve seen many many cases where these few instructions have cut program design time by well over 50 e Shorter more simple programs Later in this chapter we ll show you why your programs sometimes end up being a lot larger than you first anticipated The RLL LYS instructions can help make your programs simple for everyone to understand e Easier program troubleshooting How many times have you tried to troubleshoot or modify a program that was written by someone else If you ve done this very often you know it s not an easy task This chapter will show you a few instructions that will also help with this problem as well The following paragraphs discuss several RLL YS programming concepts We ll use asimple example to show you how to use the various types of instructions Also we ll show you the equivalent program without RLL YS instructions to give you an idea of the differences between the two approaches NOTE The DL330P has several instructions that do not operate quite the same as the equivalent instructions in the DL330 or DL340 If you want to take advantage of the benefits associated with the RLLPLUS instructions make sure you also take time to review Chapter 12 This chapter discusses the instructions that are unique or different with the DL830P
18. asics 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 al Jump to Start Station A Wait for Check for Lock the Press the Unlock Wait for Move Check Start Parts in clamp Part clamp Station B Conveyor Mode A amp B A Stage 0 Stage 10 gt Stage 20 Stage 21 Stage 22 Stage 23 Stage 40 Stage 50 ry ry No Part in A NG T Program must converge into Station B a single path In Lock the Press the Unlock Station B aga clamp Part clamp Finished B a Stage 30 Stage 31 Stage 32 Stage 33 No Part in B z One Continuous Cycle la y 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 v ie Q set 3 Z3 J Q gJ ped 2 9 n DL305 User Manual Rev D i 2 N Oo aa is fan pes e e oO RLLPLUS 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 indicate
19. be times when you need more than one initial stage There is nothing at all wrong with this If your application has a need for more than one starting point you can use more than one initial stage For example if you had three initial stages then those three stages would all be active when the CPU entered the Run Mode i 2 N Oo aa is fan pes o gt e oO DL305 User Manual Rev D RLLPLUS Programming Basics Using Jump When the operator presses the start Only executes logic in stages that are active Instructions switch input 000 comes on When 000 55 comes on the CPU executes the Jump sooo Wait for start instruction and jumps to Stage 1 sian si Now the CPU only scans Stage 1 Stage ak ae 0 is no longer scanned after the program F SG Check for a part jumped to stage 1 This means the Jump S001 instruction did two things Present s2 e It activated the destination stage In bot ae this case it activated stage 1 pratt s5 e It deactivated the stage it came 001 ue from which was stage 0 in this SG case 002 Lock the clamp So you can jump to a stage to turn it on Clamp and when you jump from a stage it turns ane 020 off Locked s3 i z This example only shows an action that initiates a jump to one destination You can use several jumps ORed together if necessary Examples of this will be shown la
20. d to R400 with the DOUT Dor Foo instruction i REU This is just one example of how you can JMP use the various types of data i IS Siso monitor for stop instructions There are many other possibilities Just remember ifthe stage SOP ast is active the instructions can be 010 executed If the stage isn t active the esr instructions will not even be examined y JMP Parts Count Index C600 5000 Conveyor CTO Pl RST 006 S0 S6 RST so JMP snidild v ie Q Zi set 3 Z3 J Q gJ sed 2 i n DL305 User Manual Rev D RLLPLUS Programming Basics Using Comparative Contacts in Stages You may recall you had to use a p lt comparative instruction with the timers and counters The DL330P provides several comparative contacts that are Sa Press the part very useful You can use these contacts ress to examine the relationship between a 021 counter or timer value and aconstantor register value Gin ar ee For example let s assume the pressed __ boa widgets move off the conveyor intoa DSTR g holding bin The bin can only hold 1000 widgets so we ll add another counter sas aa C601 to note how many widgets arein the bin Also we want to use different Bin counter ie se col
21. ess ponn 021 Lower mime 7 S4 hol JMP 04 SG S004 Unlock the clamp Te Linit Clamp RST 005 S140 Part Unlocked S5 JMP 003 SG 140 Clamp vente 020 RLLPLUS Programming Basics 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 Qnly executes logic in stages that are active SG S004 Unlock the clamp Top Limit Clamp RST 005 020 Part Unlocked S5 JMP 003 SG 005 Index the conveyor Move Conveyor 022 i TMR T600 i i 1 TEW ae S6 taal JMP SG 006 One cycle or automatic One Cycle so JMP 007 One Cycle S1 JMP 007 DL305 User Manual Rev D v ie
22. ge If M g you only move to one stage instead of s000 Wait for start multiple stages you can use what it is Set i caled a power flow transition For f JMP example we used Jump instructions in i S150 our sample program For those stages SEN that did not have multiple transition SG oot Check for a part possibilities we could have just used matt si power flow transitions JMP Look at Stage 2 Notice how the aie S transition contact 002 now is directly I JMP connected to the next stage Stage 3 You can only do this if you are moving soos Lock the clamp from one stage to one other stage bone If you examine Stage 1 you ll notice we SET have to use the Jump instructions Locked because the program can transition to hob more than one stage j E S003 Press the part Bown 021 ae boa saan 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 snidild v a O Ke Q D 3 3 5 Co o D y DL305 User Manual Rev D RLLPLUS Programming Basics Using Outputs in Stages Since the CPU only examines the logic in stages that are on you have a lot more flexibility
23. ge 0 Wait for Start Press Start Switch 000 y y Stage 150 Stage 1 Monitor for Stop Check for Part Stop Switth 010 Part in place 001 No Part y Reset All Operations Stage 2 Jump to Lock the Clamp Move SO S140 Conveyor Y Clam Jump to SET Wait for Start RA Clamp Limit Switch Qo2 5140 y Stage 140 Stage 3 Clamp Press the Part Clam Press On OUT ou 020 Press Lower Limit Switch 004 021 y Stage 4 Unlock the Clamp Press Up Clam RST 005 140 Unclamp Limit Switch 003 y Stage 5 Move the Conveyor Conveyor OUT Conveyor Index Limit Switch 006 022 y Stage 6 Check Mode F Check 1 cycle Switch ON Check 1 cycle Switch OFF amp 007 Closed 007 Open 5 3 Jump to Jump to S Wait for Start Check for Q Part UJ iat QD O a DL305 User Manual Rev D i 2 N Oo aa is fan pes e pe oO RLLPLUS Programming Basics The following diagram shows how the program would look when viewed as a ladder Enter the Program program ISG r S000 Wait forStart Start S1 JMP 000 150 JMP SG 001 Check for a Part Part Present 2 JMP 001 pratt S6 JMP 001 SG 002 Clamp the part Clamp SET Bak S140 Locked s3
24. he 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 YS 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 Add any actions that must occur in each step Add any conditions that control the actions Add any special monitoring or alarm steps that must be performed Assign numbers to the stages steps Add the I O instructions and addresses input contacts output coils jump instructions etc 8 Enter the program oe OS OG Use DirectSOFT to The DirectSOFT programming package allows you to quickly and easily create Save Time programs with RLL US instructions The software has special features that allow you to create the flowcharts add the transitions actions etc Even if your programs are fairly small DirectSOFT can make the job much easier 4 a O Ke Q D 3 3 5 Co D o O 2 DL305 User Manual Rev D RLLPLUS Programming Basics Step 1 There are many different ways to design a flowchart of the application problem but Design a Top level there are a few guidelines that will make the job easier Flowchart 1 Start with a top level flowchart that breaks the operation sequence into simple pieces 2 Each piece of the top level flowchart sho
25. imes 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 Stage On Any outputs on last scan RLLPLUS Programming Basics ISG S000 Wait for start Start S1 t JMP 000 S150 SET SG 001 Check for a part Part Present S2 JMP 001 P preatht S5 JMP 001 SG 002 Lock the clamp 4 f Clamp i OUT i q Part 020 Locked S3 JMP bol 02 Next Scan after part is locked SG 002 Lock the clamp Clamp OUT 020 Part Locked s3 JMP bol 02 SG 003 Press the part I 1 ress own 021 1 j Clamp OUT 020 Lower Limit S4 JMP 004 SG S004 Unlock the clamp Top Part Limit Unlocked S5 JMP bo5 bog Execute Examine Logic Skip to next Logic AND results active stage with O DL305 User Manual Rev D 4 a O Ke Q D 3 3 5 Co D o O a snidild i 2 N Oo aa is fan pes o gt e oO RLLPLUS 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
26. ive 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 S300 JMP In this example you use one transition Only executes logic in stages that are active contact to activate several stages a e The SET instruction sets a range of Sooo I Waltfor start stages These stages would remain Start 20 30 on until they were reset or until Me SET any transition instructions contained JMP within the stages were executed A e There are two Jump instructions JMP both activating different stages In this example notice the stage that gets Only executes logic in stages that are active activated depends on an extra condition 55 For example if the machine was capable sooo Wait for start of producing three different patterns Sen m ae there may be a section of program for JMP each pattern a sy There are other types of contacts that ser _ ir can be used For example you may 999 ey recall we used Comparative contacts in Start Patte
27. iz MP acceptable with a program that uses RLLPLUS instructions However if both stages are active at the same time then Soe the logic in the last stage will control the status of the output 7 oat In the example shown if both stages are 010 on active then the logic in Stage 70 will S002 control the output status Mn We i 2 N Oo aa is fan pes o gt e oO DL305 User Manual Rev D RLLPLUS Programming Basics Using a Set Out Many normal RLL programs use Scan N Reset SET OUT one shot instructions In the DL305 RST Instruction instruction set this instruction is called a ee One Shot is executed Set Out Reset SET OUT RST 001 160 SET OUT RST In the program shown input 001 will trigger the SET OUT RST 160 160 021 instruction which will in turn activate OUT output 021 for one scan However what happens if 001 stays on Scan N 10 and Stage 10 is activated deactivated Se i Stage off and then activated again At first glance M One Shere nob exec ted it appears the one shot only gets 001 ca executed one time since 001 stayed on while Stage 10 was turning on and off It 160 nor doesn t work this way Our The logic in an inactive stage is not executed So even though the stage Scan N 20 S0010 One shot must see off to on instruction did not see an off to on transition so the instruction is
28. lock the Clamp Clamp a Unclamp Limit Switch y Move Conveyor Conveyor On Conveyor Index Limit Switth y Check Mode N 2 a Oo Y a Check 1 cycle Switch ON Check 1 cycle Switch OFF oA Jump to Wait Jump to T for Start Check for Part D e A DL305 User Manual Rev D RLLPLUS Programming Basics Step 4 Some actions may only take place if certain conditions are met Examine the Add Conditions for program carefully to determine any conditions that should be added The following Actions flowchart adds any conditions for the actions that take place during each part of the program Wait for Start Press Start Switch y Check for Part Part in place No Part L Jump to Lock the Clamp Move Conveyor Clamp Clamp Limit Switch y Press the Part Press Press Lower Limit Switch y Unlock the Clamp Press Up Clamp yf Unclamp Limit Switch 9 au Y Condition Symbol Move Conveyor Conveyor On Conveyor Index Limit Switch y Check Mode v ax e ce Check 1 cycle Switch ON Check 1 cycle Switch OFF 5 l 3 Jump to Wait Jump to 3 for Start Check for Part jus o o O oO DL305 User Manual Rev D RLLPLUS Programming Basics
29. n output 2 d A stage can be turned on when the program has power flow between two stages that are tied together by a single transition element 3 You can turn stages off by the following methods 3 a An active stage is automatically turned off ifthe program jumps from the active stage to another stage 3 b You can use the Reset RST instruction to turn off a stage just like you use Reset to turn off an output point 3 c The current stage is automatically turned off if the program has power flow between the current stage and the next stage snidild 4 a O Ke Q D 3 3 5 Co D o O 2 DL305 User Manual Rev D RLLPLUS Programming Basics Activating Stages Using Initial Stages Any initial stages ISG instructions are Only executes logic in stages that are active automatically turned on when the CPU x goes from Program Mode to Run Mode sooo Wait for start For example when the CPU executing en a our example program enters Run Mode MP the Initial Stage ISG 000 will be turned oa on automatically The other stages are SG 901 Check for a part off so the CPU only scans the portion of pat E the program associated with ISG 000 JMP Since there s only one rung in Stage O Pat a the CPU continually monitors the start 14 JMP switch Nothing else will happen until the sai start switch is pressed Although it is unusual there may
30. n3 S300 some earlier examples hb Ls me Notice we had to repeat the start switch in a separate rung each time At first glance 5G you would think you could simply have soooo Wait for start one Start switch contact and OR the Sia Sean remaining switches The DL305 CPUs lob do support midline outputs which is what this is called but only in an AND situation n You can also use midline outputs to _ amp control branching conditions Here s an S000 Sy example of branching instructions that Sidd 3t follow the guidelines for midline outputs SET 35 3 000 001 37 This example is not for the press ag cic program but merely shows how the JMP y midline outputs would appear 002 2 n boo 023 DL305 User Manual Rev D RLLPLUS Programming Basics Joining Parallel There are many times you have to bring parallel branches back together at some Branches 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 i 2 N Oo aa fan pes o gt e oO DL305 User Manual Rev D RLLPLUS Programming B
31. of chee mt nS contacts are activated This process is I im a known as interlocking Since many PLCs do not have yen instructions to help manage the ae ee operations sequence the programmer iia rid li i our has to make sure the program carries out 161 oa 006 022 the correct sequence by adding the Rin ipa required interlocks One great thing 160 001 about the RLL solution is the individual Index rungs are easy to understand By pe Ser our examining the contacts you can easily 007 008 163 determine if the output will be on or off Interlock Many accomplished RLL programmers use things such as Master Control Relays and Subroutines to reduce the amount of interlocking required However these instructions can sometimes make the program more difficult to understand There are several things you should notice about our simple press program e Most all rungs use some amount of interlocking e The number of interlocks is usually proportional to the number of tasks in the operations sequence e Most of the instructions are devoted to processing the interlocks Plus since the program is larger it takes more time to process e It usually requires several attempts until a program is designed that is not susceptible to inadvertent activation and deactivation e The program can be difficult to debug if you do not have a considerable amount of RLL programming experience DL305 User Manual Rev D RLLPLUS Programming Basics
32. ored lights mounted on top of the press to alert a forklift driver the bin MP needs to be carried to the next operation We ll use the following indicators SG 0020 Monitor lights for forklift Indicator Meaning Address Stage ee E Green OK 040 21 l I Yellow Soon 041 22 RST Red Urgent 042 23 _ Reset Emptied 030 RST Notice we ve added a few more stagesto Reif 500 R601 K899 SET monitor this condition For this example i I assume the press has made 750 RST widgets This means the Yellow indicator PERE a Stage 22 should be active gt SET We also need a way to reset the bin RST counter whenever the forklift driver 3G empties the bin If you examine Stage 21 s0021 _ _ Blnleverors through Stage 23 you ll notice we reset 040 the bin counter whenever the bin reset OUT 030 is active Emplied eo This example doesn t show it but you bso would also have to make some changes SG to other parts of the program For GR Empty bin soon 2 example you d need to modify the Stop our 2 Stage to shut off these stages when the Bi an a S machine was stopped ii RST ai s aj S0023 Empty bin now ae Co 042 OUT e Bin aia RST 030 DL305 User Manual Rev D RLLPLUS Programming Basics Parallel Branching Concepts Branching As you examined some of the previous examples you saw we could have more than Methods one stage being processed on any given scan The CPU scanned the first act
33. os Press the part the CPU examines which stage status iess bits are on and only examines the logic in 021 those stages If a stage is inactive the Lower z CPU skips the logic between that stage lok JMP and the next active stage SG The following pages will talk about soo4 Unlock the clamp several different aspects of the CPU Top sant execution for the Stage Instructions It RST 005 020 will help to understand the pieces of an Bea individual stage Unlocked JMP Stage Nomenclature 203 As we discuss the examples it will be SS Soos Index the conveyor necessary for you to understand the cM Oke or various pieces that can make up a 022 program stage y Gonveyor s JMP bob U e Stages a instruction that denotes a fa a piece of the program s006 One cycle or automatic 5 is e Actions an event in the program Gee so 3 Z such as an output jump or some Me g other instruction ee SSS 3i S e Transitions the event that causes As MP 9 the program to move to the next Fi stage DL305 User Manual Rev D RLLPLUS Programming Basics Stage Instruction Execution Stage Instruction Stages are numbered in octal so you Octal Numbering Numbering can t have any stages with the numbers 8 or 9 in them Notice the stages skipped from 7 to 10 since the numbers 8 and9 SG 007 ae tee are not used There are 128 decimal stages available in the DL830P CPU numbered 0 through 177 Since each stage
34. ram will finish the current cycle reset the part counter and jump to Stage Gane ona Conve ee C800 0 to wait for another start cycle You may P RST notice we added an additional input 006 oe 50 S6 This is what allows the program to finish RST the current cycle You may recall 006 JMP only came on after the part was unlocked and the conveyor was indexed i 2 N Oo aa is fan pes o gt e oO DL305 User Manual Rev D RLLPLUS Programming Basics Using Data Instructions in Stages Even though there are a few differences gt in the way some of the instructions operate between the various CPUs x x SG there are many of the normal instructions sooo2 Lock the clamp that can be used inside an individual stage For example you may need to Bet load data into the accumulator to perform Locked S 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 Lower ress own 021 Limit count stored in R600 and load itintothe i oe eee accumulator with the DSTR instruction e Then this 4 digit BCD count will be R600 move
35. s 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 callita 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 030 Lock the clamp Clamp SET Part 020 Locked S31 i MP 023 SG 031 Press the part press own 021 Lower Limit 32 bal MP 24 SG 031 Unlock the clamp Te Limit Clamp RST 025 020 Part Unlocked 33 JMP 023 Station B Finished SG 0033 Check for Stop Stage 150 Reset all stages rg Jump to Start Station A Wait for Check for Lock the Press the Unlock Wait for Move Check Start Parts in clamp Part clamp Station B Conveyor Mode A amp B A Stage 0 Stage 10 a Stage 20 Stage 21 Stage 22 Stage 23 Stage 40 Stage 50 ry ry No Part in A NS g Program must converge into Sta
36. stently 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 HD L gt amp O sito Se Dai iaa ISG i gt L gt S LD si S140 Da Ei J ge Reference to Transition a Stage Logic gt Jump lt gt serstage DirectSOFT Ladder View i 2 N Oo aa is fan pes e pe oO lt gt Reset Stage ISG s S000 Wait for start Start F S1 JMP bob SG gt s001 Check for a part Part Present S2 JMP 001 Pregl S5 JMP 001 SG s002 Lock the clamp Clamp SET Part 020 Locked S4 MP 002 SG 003 Press the part Press pe 021 Lower Boalt S4 JMP 004 DL305 User Manual Rev D 10 27 RLLPLUS Programming Basics Designing a Program Using RLL YS 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 RLLPLYS instructions provide an easy way to load the plan of execution directly into the CPU T
37. ter There s also another type of Jump Only executes logic in stages that are active instruction called a Not Jump This instruction only works if the input sooo Wait for start conditions are not true whereas the San regular JMP instruction only works if the JMP input conditions are true sis In the previous example we examineda_ 001 single contact to determine which part of pba s2 the program to jump to next If the partis hot mP present 001 closed the program jumps to Stage 2 If a part is not present 001 L NUMP open the program jumped to Stage 5 We could have used a single contact and SG the NJMP instruction Clamp The program example to the right shows SET how the NJMP instruction would be used Patty E in this situation Notice there is one less hob JMP instruction required in this example compared to the previous one Check for a part 002 Lock the clamp 999 NOTE We strongly recommend you avoid using the NJMP instruction This is because program debugging can become more difficult especially for those who are not so familiar with structured programming concepts snidid ek fe Ke Q D 3 3 5 Co y D o O a DL305 User Manual Rev D n 2 N Oo aa is fan pes o gt e pe oO RLLPLUS Programming Basics Using Set Instr
38. the best numbering sequence You don t have to follow these guidelines but they may help You can typically find these types of operations in any program e Sequential Operations a certain sequence of events one after the other This is usually the main part of the program It s usually best to number these first For example you may want to always number these stages from 0 127 octal e Independent Operations these operations usually only perform one task such as activating a motor or turning on a horn For example you may want to number all independent operations starting from 130 147 octal e Alarm and Monitoring Operations These operations usually monitor the main parts of the program Since you may want to reset parts of the program during an alarm condition it is usually best to number these last This way you can use one Reset RST instruction to reset almost the entire program Use stages 150 177 for alarming and monitoring stages These guidelines are especially helpful if you have many different programs By using a standard numbering scheme you always know where to look for the various types of operations The example shows how we assigned numbers for the example press Notice we ve also made a separate stage for the clamp This was not an absolute requirement because there are several ways you could have done this We just did it to show you an example of an independent operation snidild
39. the program ii ii NOTE Remember machines do break bob D We recommend you use numbering that so Ao matches the machine flowchart Also we 001 Check for a part recommend you enter the program in the Part Y a same order whenever possible This will oe MP aS make troubleshooting much easier Y au zati E Present S5 RE The section on Designing an RLLPLUS si MP Program at the end of this chapter provides guidelines for assigning numbers to the stage instructions DL305 User Manual Rev D RLLPLUS Programming Basics A Few Since the CPU will only examine the logic in those stages that are active it is Simple Rules for important you understand how stages can be turned on and off There are a few Execution simple rules that dictate how this works This may seem like quite a few things to remember but it s really pretty simple We ll show examples in the following pages that show how each of these rules apply to the program execution 1 Only active stages are executed If a stage is inactive the CPU skips the logic between that stage and the next active stage 2 You can turn stages on by the following methods 2 a Initial Stages are automatically turned on when the CPU transitions from Program Mode to Run Mode 2 b A stage can be turned on when the program jumps from stage to stage with the Jump JMP instruction 2 c You can use the SET instruction to set a stage status bit just like you would SET a
40. tion B a single path again Lock the Press the Unlock Station B g clamp Part clamp Finished B Stage 30 Stage 31 Stage 32 Stage 33 No Part in B z One Continuous Cycle y e DL305 User Manual Rev D 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 RLLPLUS Programming Basics _Only executes logic in stages that are activi Station A SG S020 Clamp the part Clamp SET Part 020 Locked 21 J JMP ress own 021 Limit S22 J JMP Unlock the clamp Top Limit Clamp RST 005 020 Part Unlocked 23 JMP 003 SG 023 Wait for Station B to finish aB Finished S40 JMP beh e SG S040 Index the conveyor A Finished RST 33 Conveyor 022 Conveyor Moved S50 J JMP 006 SG S050 One cycle or automatic One Cycle so JMP 007 Jae 10
41. uctions with Stages When you examine the instruction set more carefully you ll notice the DL330P CPU offers a Set SET instruction that works similarly to a latching operation For example you could use a SET instruction to latch an output point The output point can then be unlatched with the Reset RST instruction You can also use a SET instruction to turn on a stage To show how this works were going to add a stage to the program You may have noticed the original flowchart did not contain a stop switch Well we don t want to make these little widgets forever so we re adding Stage 150 which monitors for a stop switch This is also a good example of how you can skip stage numbers Notice we added a SET instruction in the first stage Now when the start switch is pressed two stages will be activated The CPU examines Stage 1 which monitors for a part and it also examines Stage 150 which monitors the stop switch Only executes logic in stages that are active ISG S000 Wait for start TLE os SG S001 Check for a part Part Present S150 SET S2 001 Part Present JMP S5 001 SG S002 Lock the clamp JMP Clamp SET Part Lopkad 020 s3 bob SG S150 Monitor for stop JMP 020 022 RST SO S6 RST so JMP
42. uld only represent one action Resist the temptation to group several operations into one part of the flowchart 3 Don ttry 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 Check Lock Press Unlock Move Start for Part Clamp Part Clamp Conveyor One Meine Cycle Check Mode i 2 N Oo aa is fan pes o gt e oO DL305 User Manual Rev D Step 2 Add Flowchart Transitions RLLPLUS Programming Basics 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
Download Pdf Manuals
Related Search
Related Contents
組立説明書 【GR-150S/H/J GR Atmel AT04467: Wireless SoC Reference Design with RFMDs RF6555 SERVICE MANUAL Franklin EST-5114 electronic dictionary schema di DSS - Comune di Vicchio Pro Air 2 / MC Lite User Guide Point Two ´s Pro Air 2 inflatable body EpiScope® Promoter qPCR Array (Human) CrossFire CX and CrossCode BT Kenmore 19 cu. ft. Bottom-Freezer Refrigerator - Black Manufacturer's Warranty (Espanol) MANUAL DE INSTALACIÓNY OPERACIÓN Typ S601 Copyright © All rights reserved.