Sign in to follow this  
Followers 0
igel

my first program!

8 posts in this topic

ok here goes, i wrote this as a starting point for learning purposes. The setup is a pick and place, 3 cylinders extend and retract on each as well as part present prox at entrance and one at exit. the methodology is from a book called cascading logic, maybe overkill I'll let you guys decide that. The bonus is ease of adding elements and functions to it later which I plan to do as I learn more. Any and all comments (constructive) are welcomed and encouraged. Especially in the area of program style, organization etc. it is in pdf format so anybody can slam me:)PICK_N_PLACE1.pdf forgot to add that I haven't ran it as I haven't got all my i/o wired to switches on my desktop plc yet, only verified in rslogix, so maybe some N.O. should be N.C. and vice versa. thank you all

Share this post


Link to post
Share on other sites
K, Program looks ok i guess, but im used to automating gas plants and oil refineries. I do however have a question for you. I noticed your using an OV16 output card. I dont know about code in the U.S., but in Canada, i believe switching the neutrals instead of the source is against code. Is this not true in the states??

Share this post


Link to post
Share on other sites
I don't believe it is against code. Its just a card that I got in the deal via ebay, this is all cobbled together and will not be used on any real machinery, just my desktop and imagination, but I am trying to make it as real life as I can. I understand the concerns about how power is switched with regards to short ckt faults etc.

Share this post


Link to post
Share on other sites
The timer for an air fault is in the wrong position (assuming this is supposed to provide debounce). Looks like you have changed the sense of the reset to prevent the fault latching, but by doing this the fault will automatically reset if the air comes back on. Rung 2 system fault wrong sense

Share this post


Link to post
Share on other sites
I see the mistake of the air and fault reset, also sys fault. do I need to use a one shot bit to control the one shot coil or can i just leave a one shot by itself and address it in the output rungs directly? Also how do i seperate the sections of logic by type i.e. overhead, system layer, motion objects, output rungs etc.? Do i put these into subroutines or?, little shakey on the setup, and this is already on the verge of being unwieldy and is only going to get more so unless I organize it better. Thanks for your input and help

Share this post


Link to post
Share on other sites
Using the one shot bits with a coil is the best way of using them. I like logic to be divided up. With RSlogix 500 the best way of achieving this is to create subroutines. The main routine would then only have the JSR instructions that call each subroutine. It may also be helpful to load a copy of the code so we can open it in RSlogix.

Share this post


Link to post
Share on other sites
it's not bad for start and you alredy got few improvement suggestions. keep on improving until you are satisfied (and program works). i see few things that are already mentioned but without plc program file i'm not going to try to check much, it is too slow if one can't use crossreference. following wraped rungs is hard on eyes too. it would be nice to divide program in logical units. for example i would move alarm logic to separate file etc. all mode control logic could be together so it's easier to find and monitor without scrolling (this is what multiple files are for). there are few places where no and nc contacts are wrong. some rungs would eventually seal in and stay on forever (rung 14 for example). i see only one mode of operation, no home command, manual controls or option to step through sequence. i don't even see what is the first thing supposed to be in the sequence although program is so short. if sequence is supposed to start with rung 13 (lower gripper to pick) how come gripper is expected to be closed? does it reach inside part and then open to hold the part? also isn't transfer supposed to be in pick position before lowering? what happens if you reset cycle in middle of the sequence? if the gripper is not already closed B3:0/15 (rung 13) will never turn on and that means that command to close gripper will never happen (B3:1/2 rung 16). maybe reset is intended to abort sequence and make machine start from begining but if this is what happens, it is not easily seen in a program. also i don't see any interlocks. for example your program is pick and place machine. i assume sequence starts by moving to pick position, lowering, closing gripper, lifting and then transfering etc. if this is the case i would expect to see condition that allows transfer only when gripper is lifted. you might want to put a text inside program with sequence description and then number all commands so it's easier to track.

Share this post


Link to post
Share on other sites
excellent thank you, I will look into all your finds, this was setup off paper and is my first go at any program consisting of more than a few lines. I have been trying to read up on how to use subroutines to organize it better. The homing and manual mode will be added later. I just got my input contraption soldered up (only 1 out of 32 doesn't work!) so now I can test program and play with fault and reset scenarios. I feel a bit under weather lately but hopefully by end of the week I will have problems sorted out and I can start on adding features. I will post both pdf and .rss files for those that like either one when version 2.0 comes out. Thank you all for your help.

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