Sign in to follow this  
Followers 0
slav321

Programming help

8 posts in this topic

Hi I am trying to build a logic for a machine which has 5 sequences,in other words depending on sequence chosen,outputs will be energized diffrently,using one of 5 logics,i would like to avoid using paralel branches but that's the only way i see.....may be subroutins? Another question regarding subroutins-when subroutin is called,the main program is still implementing the logic in the main program or it's"stack" until subroutin is finished? Can i duplicate outputs in diffrent subroutins which never ran simultaneously? Since my expirience with PLCs is limited,i would appreciate a lot detailed answers. Thanks.

Share this post


Link to post
Share on other sites
Hi Milldrone First,thanks for your quick replay. A few more questions: Is there other way(no stages)? Regarding my question about subroutins - your answer YES standed for that main program continues implementing the logic in the main program when subroutin is called,or it is stack? Are DL PLCs cosidered workhorse?,i heard they have many problems with outputs,espesialy relay outputs. Thanks. ps i'm using DL 250-1.

Share this post


Link to post
Share on other sites
The DL250-1 is considered a workhorse. Relay outputs on any PLC I have worked with have failures somewhere around 1/2 million cycles under light load 100,000 cycles when near their load rating.

Share this post


Link to post
Share on other sites
Hi Milldrone You know,i am kind of scared using stages:),i fill more comfortable with ladder...but i guess i need to take a look at it. In my application DL 250-1 is gonna drive about 25 interposing relays(24vdc,~30mA) and i am undecided of what outputs to use(relays or transistors)...i've seen on automationdirect.com transistor output moduls short circuit protected....what you think is the best choice...advantages,disadvantages?,and generaly speaking which of them better withstands short circuits(the machine has a lot of oil,water leaks) Thanks.

Share this post


Link to post
Share on other sites
The new transistor protected output from Facts Engineering (F2-16TD1P ,F2-16TD2P ) is a much better unit.

Share this post


Link to post
Share on other sites
Here is an example stage program with it's equivalent in std ladder below the end statement. PLC 250-1 // Rung 1 // Address 0 ISG S0 // Rung 2 // Address 2 #BEGIN COMMENT "http://www.plctalk.net/qanda/showthread.php?t=46161" "" "It consists of four tanks." "Tank1 supplies tank3 only when tank3 is below a set level controlled by a trim pot. This is " "the first problem using greater than or equal to logic, which was explained in less than two " "minutes and I still do not understand how this works or even more importantly how to use " "and control this." "When tank 1 has filled tank 3 to a set level controlled by a trim pot level sensor it turns off " "valve 1 and opens valve 2 on tank 2. This continues to fill tank 3 to another set level on " "a different trim pot." "When tank three has reached its set level valve 2 closes and sets off a mixer for a set " "time. Once the mixer unit has completed its set time it stops and valve 3 opens for 10 " "minutes allowing tank 3 to empty. Then the process stops and awaits the start of the next " "cycle." #END STR X100 AND X101 JMP S1 // Rung 3 // Address 5 SG S1 // Rung 4 // Address 7 #BEGIN COMMENT "When you use stages no permissives other than the stage itself are needed. And the item " "turns off when you exit the stage. If this tem were needed in another part of the process it " "could be used in that stage. multiple outs when using stages are not an issue." #END STR X101 OUT Y0 // Rung 5 // Address 9 STR V2001 V2000 AND X101 JMP S2 // Rung 6 // Address 13 SG S2 // Rung 7 // Address 15 STR X101 OUT Y1 // Rung 8 // Address 17 STR V2002 V2001 AND X101 JMP S3 // Rung 9 // Address 21 SG S3 // Rung 10 // Address 23 STR X101 TMR T0 V400 OUT Y3 // Rung 11 // Address 27 STR T0 JMP S4 // Rung 12 // Address 29 SG S4 // Rung 13 // Address 31 STR X101 OUT Y2 // Rung 14 // Address 33 STRE V2001 K0 JMP S0 // Rung 15 // Address 36 END // Rung 16 // Address 37 #BEGIN COMMENT "http://www.plctalk.net/qanda/showthread.php?t=46161" "" "It consists of four tanks." "Tank1 supplies tank3 only when tank3 is below a set level controlled by a trim pot. This is " "the first problem using greater than or equal to logic, which was explained in less than two " "minutes and I still do not understand how this works or even more importantly how to use " "and control this." "When tank 1 has filled tank 3 to a set level controlled by a trim pot level sensor it turns off " "valve 1 and opens valve 2 on tank 2. This continues to fill tank 3 to another set level on " "a different trim pot." "When tank three has reached its set level valve 2 closes and sets off a mixer for a set " "time. Once the mixer unit has completed its set time it stops and valve 3 opens for 10 " "minutes allowing tank 3 to empty. Then the process stops and awaits the start of the next " "cycle." #END STR X100 STR C0 ANDN C1 ORSTR OUT C0 // Rung 17 // Address 42 STRPD C0 OR X102 OR C2 AND X101 OUT C2 // Rung 18 // Address 47 STRPD C0 STR C3 AND C0 ORSTR AND V2000 V2001 OUT C3 // Rung 19 // Address 54 STR C3 AND C2 OUT Y0 // Rung 20 // Address 57 STRND C3 OR C4 AND C0 AND V2002 V2001 OUT C4 // Rung 21 // Address 63 STR C4 AND C2 OUT Y1 // Rung 22 // Address 66 STRND C4 OR C5 AND C0 ANDN T0 OUT C5 // Rung 23 // Address 71 STR Y3 STR T0 AND C1 TMRA T0 V400 // Rung 24 // Address 76 STR C5 AND C2 OUT Y3 // Rung 25 // Address 79 STR C0 ANDND C5 OR C6 ANDNE V2001 K0 OUT C6 // Rung 26 // Address 85 STR C6 AND C2 OUT Y2 // Rung 27 // Address 88 STR C0 ANDND C6 PD C1 // Rung 28 // Address 91 END // Rung 29 // Address 92 NOP #BEGIN ELEMENT_DOC "X100","","","start process push button" "X101","","","stop process push button" "X102","","","continue process pushbutton" "Y0","","","valve 1 (it's on tank 1)" "Y1","","","valve 2 (it's on tank 2)" "Y2","","","valve 3 (it's on tank 3)" "Y3","","","mixer" "C0","","","start process SEALIN" "C1","","","process done" "C2","","","continue" "C3","","","fill tank 3 to correct level with some of tank 1's contents" "C4","","","fill tank 3 to correct level with some of tank 2's contents" "C5","","","mix bit" "C6","","","drain tank 3 bit" "S0","","","start " "S1","","","fill tank 3 to set level with tank 1's contents " "S2","","","fill tank 3 to set level with tank 2's contents" "S3","","","mix" "S4","","","drain tank 3" "T0","","","mix time" "V400","preset mix value","","" "V2000","","","set point to fill tank 3 with tank 1's contents" "V2001","","","tank 3's level" "V2002","","","set point to fill tank 3 with tank 2's contents" #END

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