Sign in to follow this  
Followers 0
JayH

DL05/06 programming questions

20 posts in this topic

Hi everyone, I'm currently trying to learn programming for the DL05 using DirectSOFT5 and potentially the DL06 sometime in the future. The machine it will be used on is a type of thermo former, also known as a "blow form" thermo former. I've only been aware of PLCs for about a year so consider me a newbie to the PLC world. I've had a few courses and done some of my own computer programming so I know I'm pretty capable of grasping the concepts of programming. I'm practicing with the DL05 using 2 switches, 2 push buttons, and 4 lights for the output. I've written up a small program that basically does what I assume will take care of the first two stations of the machine (the heat station and form die/air which is what will form the plastic), however I'm not really sure if what I did is correct programming structure. I was hoping someone might be able to take a look at what I have done so far and let me know if I'm at least heading in the right direction. Any help or comments would be greatly appreciated. The machine I'm sort of trying to design off of has about 5 inputs and 17 outputs and uses a touch screen to get user information such as how long the heat station actuates for, setting the temperature for the heat station, and the count for how many times the machine will cycle. What I'm wondering, is just how advanced the programming will get for something like this? I've read a lot about what PLCs can do and it seems to me that this does not maximize on their capabilities. Would stage programming be necessary? -Jay

Share this post


Link to post
Share on other sites
Welcome to this fascinating and sometime infuriating craft. This is a great site along with others. You can also check the list of sites at my site, www.theplcguy.com. AutomationDirect has their forum. The company which wrote Directsoft for AD (Host Engineering) has theirs and there is a general - multiPLC site at www.plctalk.net\qanda. Our company (www.marq.net) has been using AD PLCs since the mid 90's. The DL06 in our major unit from AD (we also use Allen Bradley products). Please check out these other sites. I would be glad to help by looking at some of your code.

Share this post


Link to post
Share on other sites
first...it sounds like a fairly straightforward application. two....AD programming is easy but not if you've used AB. Like some of the bigger platforms (Siemens/GE) AD doesn't do automatic type changing...ie you'll need to remember what addresses are BCD, Binary, Double Int, or Real. The s/w will allow you to use part of a REAL as a HEX number. You'll get an answer, it just won't make much sense. In this respect the AB stuff is superior and will lead to a lot less headaches...... I also don't believe the AD processors do stage programming. I would probably simply do this in straight ladder. Like any programming language, the hard part won't be learning the instructions.....it'll be putting the instructions together in a logical fashion so that the end result is what you need. No easy method to get there so be prepared to get excited first (as you learn to turn things on and off and set variables) then frustrated as you can't make the logic work as you'd expect or can't figure out how to even proceed in some direction. Good Luck!!! bob

Share this post


Link to post
Share on other sites
Stage Programming in AD is useful if you can break down the machine action into sections of "it does 'this' until 'that happens' at which point it begins doing 'this other thing'". At my site under the 'Handholding for Allen Bradley ..." section I discuss Stage Programming and its usefulness. As our machines yield easily to the definition I mentioned we use it whenever we use an AD PLC.

Share this post


Link to post
Share on other sites
Thank you for all the extra sites, no doubt they will come in handy. From the other posts it seems that I'm not trying a task that's completely out of reach for a first program. If I .zip all the files involved in the project and upload them would someone mind just taking a look to see if I'm going in the right direction with the program? I know what I did works so far, however, I'm not really sure if it's actually something that would work set up on a running thermo former. -Jay Edited by JayH

Share this post


Link to post
Share on other sites
Upload your program. if you think it might help add a diagram of the application setup.

Share this post


Link to post
Share on other sites
Right now what I have works, the last output Y3 doesn't work properly since there's a sensor I need to get input from, but more of less the cycle is what I want. The other thing I'm going to have to add is a way for the user to control how long Y0 is closed for. Any type of direction would be most appreciated.

Share this post


Link to post
Share on other sites
Again, upload the program so we can see. You mentioned a display for the operator so that is the obvious avenue for modifying a time.

Share this post


Link to post
Share on other sites
Sorry, I thought I had uploaded it in my last post, I didn't see the attach button. Thermoformer.zip

Share this post


Link to post
Share on other sites
Label ALL V registers, Timers and Counters which you use. Then re-post. I can't tell what you are attempting to do with this.

Share this post


Link to post
Share on other sites
Everything should be labeled now... I hope its sufficient. thermoformer_edited.zip Edited by JayH

Share this post


Link to post
Share on other sites
That is much better, you yourself will appreciate it later. Now, any place you have a 'K' constant can be a variable, its own 'V' register, The value in each V register will determine the operation. The values, besides being viewed, can be modified from the display. Some of the values may be very critical and need to stay within certain limits. Most displays have the ability to set separate limits on number entry for each target variable. But if someone were to change the value from Directsoft the safety wouldn't be in place. So at the top of the scan you may wish to place rungs which check these value and correct any which are out of limits. All of your outputs depend on timer T1 and it depends on the input X0. But Transport (Y3) only depends on input X1. Is that the intent? I'm sure you have safety measures in place which operate outside of the PLC, actually it's mandatory. Edited by b_carlton

Share this post


Link to post
Share on other sites
Hello Yes limits are critical, also limit your changes to after the process has ended. Do not want to crash the tooling into the transporter. What type of thermoformer? Inline / Offline? Regards Tom

Share this post


Link to post
Share on other sites
I'm not too sure if I know what the difference between Inline/Offline thermoformers are. They are more orientated toward trays and larger single piece forming right? The thermoformers I'm involved with are mostly known as "linear rapid blow thermoformers". A continuous strip of plastic ranging in lengths of 10-400+ meters and widths of 8-88 mm. Think of like super 8mm film... only thicker polystyrene and with pockets.

Share this post


Link to post
Share on other sites
JayH, I thought you might like to see how someone else might have written your program. I used a conventional timer instead of an accumulating timer. Also I discarded the counter you were using for alternation. I was able to use the least significant bit from the other counter accumulator to perform the alternation Copy the text below, save in notepad, open a new instance of Direct Soft (DL06), click on file, import, program. PLC 06 // Rung 1 // Address 0 #BEGIN COMMENT "http://forums.mrplc.com/index.php?showtopic=21813" "" "You could have used a regular timer or perhaps a TMRF instead of an accumulating timer " "by using a TMRF you can get finer resolution in your time periods" "" "This based on your use of X1 not as a reset" "" "I used a Vmem instead of a constant in this timer. You could use a Cmore or Direct Soft to " "change the timer preset." #END STR X1 ANDN T1 TMRF T1 V401 // Rung 2 // Address 4 #BEGIN COMMENT "By ""looking"" at the last bit of the accumulator word (B1001.0) we can determine if the " "count is even or odd. in this case we are looking for the even count." "" "As others mentioned Vmem registers can be used in place of the constants in the inline " "compares." "" "You might be able to use one timer and just change the values in the compares" "" "" #END STR TA1 V1500 ANDN Y1 ANDN CTA1 K10 AND B1001.0 OUT Y0 // Rung 3 // Address 12 STR TA1 V1501 ANDN CTA1 K10 OUT Y1 // Rung 4 // Address 17 #BEGIN COMMENT "By ""looking"" at the last bit of the accumulator word (B1001.0) we can determine if the " "count is even or odd. In this case we are looking for the odd count." #END STR TA1 V1502 ANDN CTA1 K10 ANDN B1001.0 OUT Y2 // Rung 5 // Address 24 #BEGIN COMMENT "This counter now does double duty. By ""looking"" at the last bit of the accumulator word " "(B1001.0) we can determine if the count is even or odd." "" "BTW The accumulator for CT1 in a DL06 is V1001. " "" "B1001.0 is the least significant bit in that Vmem register " #END STR Y1 STRN X1 CNT CT1 K10 // Rung 6 // Address 29 STRN Y0 ANDN Y1 ANDN Y2 AND X0 OUT Y3 // Rung 7 // Address 34 #BEGIN COMMENT "Because I used text to ""deliver"" this program I'm including this rung to put a value in " "V401, V1500, V1501, V1502. In your program you would not use this rung because the " "numbers wold be entered by a CMORE " "" "You may also notice that the numbers are times 10 of those in your program This is " "because I used a TMRF timer that has 10 times the resolution" #END STR SP1 LD K25 OUT V401 LD K10 OUT V1500 LD K100 OUT V1501 LD K120 OUT V1502 // Rung 8 // Address 43 END // Rung 9 // Address 44 NOP #BEGIN ELEMENT_DOC "X0","Transport Sensor","Blue Wire 18ga.","Sensor" "X1","On Switch","Green Wire 18ga.","Switch" "Y0","Heat Station","Green Wire 18ga.","Solenoid" "Y1","Form Die","Green Wire 18ga.","Solenoid" "Y2","Form Air","Yellow Wire 18ga","Solenoid" "Y3","Transport","Red Wire 18ga.","Solenoid" "T1","Sequencing timer","","Timer that controls when Y0, Y1, and Y2 actuate" "CT1","Cycle count","","Advances by 1 every time the forming die actuates (Y1)" "TA1","Y0 Timer","","starts cycle and sets time between Y0, Y1, Y2" "V401","Preset is V401","","" "CTA1","Machine Count","","Y0, Y1, Y2 cycles as long as the amount of times the form die actuates is less then 10 (or whatever the cycle count is)" "V1500","compare is V1500","","" "V1501","compare is v1501","","" "V1502","compare is v1502","","" "B1001.0","","","Bit 0 of the machine counter accumulator (when count is odd this bit is on)" #END

Share this post


Link to post
Share on other sites
milldrone, Thank you for taking the time to show me your version of my program, this gives me a new perspective and also shows how much more efficient I could be with my own code. I really like the way you changed the style of my alternation, my way seemed a little bass ackwards. I'm not entirely sure if I'm understanding how you make use of the variables though. I've always known that you have to first declare a variable, then you can set it to whatever you would need. DirectSOFT obviously already has preset variables declared for you, but how do you see where you "set" the variable? For example in your program, the sequencing timer uses V401, how am I able to actually see what value V401 (or any used variable) holds? EDIT: I also realized that I will need to have fixed intervals for when certain outputs actuate, but, will also need to be able to control the amount of time Y0 (heat station) stays on for. Would an appropriate solution be to use a math function and just use the same variable for all 3 outputs and adjust the amount added accordingly? Edited by JayH

Share this post


Link to post
Share on other sites
This sequence in rung 7 LD K25 OUT V401 initialized V401. The rung is triggered by "STR SP1" so that it only triggers once on program start. Investigate the use of Data Tables - you can enter the address of a variable (like V401) and view its contents, either as they currently are if you are online or as last saved. You can set the number type (because the V registers are not defined as to what type of number they hold - binary - BCD - real - and YOU as the programmer must keep it straight.)

Share this post


Link to post
Share on other sites
Being efficient with code is something that can separate a good programmer from a great one. Prior planning with truth tables and flow charts can help in this. It also helps to remember your boolean logic and reductions (I assume you have this since you said you have a computer programming background) to make the most of the steps in your logic. Too many times I have looked over a program and found that either there is redundancy in the logic, or functions can be used in the place of several rungs of logic. Like the DRUM function in AD to replace a sequence of events. Also if you get into any high speed applications, it is good to know all these things and plan ahead of time so that your structure is proper. It does not seem to get enough mention in this forum but if you have things out of order (this often occurs by programming on the fly) your program may do unexpected things. I ran into a situation helping an associate where the machine would not function correctly. Turns out the time base he was using to determine the sequencing was derived from timer X and the reset from timer X occurred in the logic before the compare statement that determined the output. The last step needed to see the timer done bit. Due to program size and scan time sometimes this would occur but other times not. Also as I mentioned he had a longer scan time than was necessary because he had repetitive logic. Again the truth tables. If A & B & C = D then don't reuse A & B & C, use D. It is a resultant of the and statement and therefor a logical minimized equivalent. I really have found that if you think of your basic structure from a logic standpoint, nothing more than a bunch of and or gates ect, then programming in any software family becomes just a matter of finding out what they call each component.

Share this post


Link to post
Share on other sites
Thank you very much for all your responses, this is one of the best forum experiences I've ever had. I'm gonna rework my code or just restart all together and try and add in the few extra things I skipped over. The whole variable thing I was confused on is much clearer now after rung 7 was pointed out.... not sure how I didn't make the connection. I'm sure there will be more problems I'll seek out help for soon.. Thanks again for all the responses. -Jay

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0