You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old July 16th, 2019, 05:52 PM   #1
JZerb
Member
United States

JZerb is offline
 
Join Date: Oct 2016
Location: Highland
Posts: 282
Machine sequence logic, multiple instances vs one master

So, i have a machine that I'm programming say the sequence is 1-2-3-4-5.

If the operator hits the 'start' button it will step through the sequence 1-2-3-4-5.

now, there is another button that the operator can press at a different time, while the machine is not moving of course, that will do a FEW of the same movements that the aforementioned sequence would do. so say this button is 'go here' and then the machine would go through the sequence 2-3-4.

now the way i have it written is that the 'start' button and 'go here' button each have their own respective sequence logic, so Start sequence is 1-2-3-4-5 and Go here sequence is 1-2-3 does that make the most sense? or should i set it up so that there is one "master" sequence and depending upon which button is pressed it would start at its respective part of the sequence?

i think the way i have it written is best, but im no expert so i was curious of other opinions.
  Reply With Quote
Old July 16th, 2019, 06:06 PM   #2
chavak
Member
Malaysia

chavak is offline
 
chavak's Avatar
 
Join Date: Jul 2002
Posts: 623
Hi,

There is no right or wrong way I guess, the way you written it is good, in such it is much easier to trouble shoot, readable, and also easier to modify it when necessary.

Regards
  Reply With Quote
Old July 16th, 2019, 06:15 PM   #3
James Mcquade
Member
United States

James Mcquade is offline
 
Join Date: Oct 2007
Location: Tennessee
Posts: 2,532
if I understand you correctly.

the start button operates sequence 1,2,3,4,5
and when the machine is not running the operator can push go here
then when you press the start button, you get sequence 2,3,4

are the sequences 2,3,4 involving the same steps?
how do you determine what sequences to run if the go there button is a pushbutton as well as the start button?

if you can create a signal to separate which sequences to run.

create subroutines 1,2,3,4,5, 6, and 7
subroutine 6 - jump to subroutines 1,2,3,4,5
subroutine 7 - jump to subroutines 2,3,4
when the start button is pushed and the go there signal is not on, execute subroutine 6.
when the start button is pushed and the go there signal is on, execute subroutine 7.


food for thought
james
  Reply With Quote
Old July 16th, 2019, 06:30 PM   #4
JZerb
Member
United States

JZerb is offline
 
Join Date: Oct 2016
Location: Highland
Posts: 282
Quote:
Originally Posted by James Mcquade View Post
if I understand you correctly.

the start button operates sequence 1,2,3,4,5
and when the machine is not running the operator can push go here
then when you press the start button, you get sequence 2,3,4

are the sequences 2,3,4 involving the same steps?
how do you determine what sequences to run if the go there button is a pushbutton as well as the start button?

if you can create a signal to separate which sequences to run.

create subroutines 1,2,3,4,5, 6, and 7
subroutine 6 - jump to subroutines 1,2,3,4,5
subroutine 7 - jump to subroutines 2,3,4
when the start button is pushed and the go there signal is not on, execute subroutine 6.
when the start button is pushed and the go there signal is on, execute subroutine 7.


food for thought
james

so maybe i can explain it a bit clearer. the machine has 7 'setpoints' per-say.

so when you hit START you get to go through those setpoints 1-2-3-4-5-6-7. done.

if you hit GO HERE you are hitting those same setpoints, but only needing to go 1-2-3. done.

the way i have it written now i determine which button was hit by a seal in circuit in the logic. so if you hit START that sets a START RUN bit and then steps through its own index to tell you where you are within that sequence. Same thing applies for the GO HERE sequence. what i was unsure of was having to use two different sequences that both could in turn set the same bit to move the machine to say setpoint 1.

xic---(start sequence step index)EQU--------OTE
|
xic---(go here sequence step index)EQU---

the more i type it out and read my code i think what i did is the clearest in regards to being able to 'follow' each sequence separately if need be. but again i was just curious of other opinions, the JSR idea crossed my mind but i didnt see it through as of yet.
  Reply With Quote
Old July 16th, 2019, 07:42 PM   #5
wimpiesplc
Member
Netherlands

wimpiesplc is offline
 
Join Date: Feb 2012
Location: Netherlands
Posts: 330
I would first draw it out in SFC/GRAFCET, and consider "done" as step 0.

the basic sequence stays the same, but after step 3 - when "START" is high, you got to step 4 and when "GO HERE" is high, you branch to step 0 (done)

maybe an extra step to unseal/reset the "START" and "GO HERE" flags
  Reply With Quote
Old July 17th, 2019, 02:08 AM   #6
Jieve
Member
United States

Jieve is offline
 
Join Date: Feb 2012
Location: USA
Posts: 195
I recently wrote a program with a similar situation, where I had multiple sequences with overlapping steps. I started out with them combined, but in the end revised the code so that each sequence was separate because I felt like it was easier to read and troubleshoot (this was in ladder). I've seen it done both ways though, I'd agree that there's no real right way.
  Reply With Quote
Old July 17th, 2019, 03:33 AM   #7
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,386
Can't you instead have one sequence and at the end of step 3 decide whether to go on to step 4 or complete the sequence based on which button you pushed to start it?

This is, in my opinion, a lot clearer as there would only really be one sequence to take care of (assuming the steps will always be the same).

Which is basically what wimpiesplc wrote.
  Reply With Quote
Old July 17th, 2019, 03:36 AM   #8
rQx
Member
Sweden

rQx is offline
 
Join Date: Oct 2010
Location: Trelleborg
Posts: 687
Quote:
Originally Posted by wimpiesplc View Post
I would first draw it out in SFC/GRAFCET, and consider "done" as step 0.

the basic sequence stays the same, but after step 3 - when "START" is high, you got to step 4 and when "GO HERE" is high, you branch to step 0 (done)

maybe an extra step to unseal/reset the "START" and "GO HERE" flags
This is what I would do
  Reply With Quote
Old July 17th, 2019, 06:22 AM   #9
JZerb
Member
United States

JZerb is offline
 
Join Date: Oct 2016
Location: Highland
Posts: 282
Quote:
Originally Posted by Jieve View Post
I recently wrote a program with a similar situation, where I had multiple sequences with overlapping steps. I started out with them combined, but in the end revised the code so that each sequence was separate because I felt like it was easier to read and troubleshoot (this was in ladder). I've seen it done both ways though, I'd agree that there's no real right way.
this was my initial thoughts as well. keeping the different sequences separate for ease of troubleshooting. But I also get the idea behind the single sequence with just different stopping or starting points.
  Reply With Quote
Old July 17th, 2019, 07:11 AM   #10
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,386
Quote:
Originally Posted by JZerb View Post
this was my initial thoughts as well. keeping the different sequences separate for ease of troubleshooting. But I also get the idea behind the single sequence with just different stopping or starting points.
How easy to troubleshoot is it when you're looking at the wrong sequence?

Of course, two sequences have the advantage that if in the future they are to be different, the code is halfway there.

On the other hand, any change to the sequence will require two modifications.
  Reply With Quote
Old July 17th, 2019, 06:55 PM   #11
bill4807
Member
United States

bill4807 is offline
 
Join Date: Mar 2013
Location: michigan
Posts: 144
Quote:
Originally Posted by cardosocea View Post
Can't you instead have one sequence and at the end of step 3 decide whether to go on to step 4 or complete the sequence based on which button you pushed to start it?

This is, in my opinion, a lot clearer as there would only really be one sequence to take care of (assuming the steps will always be the same).

Which is basically what wimpiesplc wrote.
The above is the way i acomplish this, whenever it comes up.
  Reply With Quote
Old July 18th, 2019, 04:41 AM   #12
parky
Member
United Kingdom

parky is offline
 
Join Date: Oct 2004
Location: Midlands
Posts: 1,186
If it is a true sequence then use a sequence word for example start puts a 1 in the sequence word, compare to 1 to run the sequence (routine), at the end of the sequence increment the word to 2 & so on until say last sequence.
To start a sequence of say 3,4,5. On the press of other button put a 3 in the sequencer and set a bit, when the sequencer runs and gets to seq. 5 at the end of seq. 5 test the bit and exit (put the sequencer back to 0).
Or if you need a more complex one you could put values into an array. i.e. 1,3,6,4,5,0 or 1,2,3,4,5,6 or 5,3,4,2,0,0 and increment the array, this will run the sequence number in order of the values in the array you would need to test for unused values in the array to end the seq. if 0 is found.
  Reply With Quote
Old July 18th, 2019, 10:24 AM   #13
JZerb
Member
United States

JZerb is offline
 
Join Date: Oct 2016
Location: Highland
Posts: 282
thanks for all of the suggestions!

i have it setup right now with step index's for each sequence depending upon what button is pressed. But the more i test, and the more 'can it do this too and then what if we stop it can it go to here' that i keep getting requests for, the more i think i will need to take a step back and re-evaluate what i need to do from scratch. I like James Mcquade's angle of attack, i think that leaves me the most open for interpenetration in the field at final setup.
  Reply With Quote
Old July 18th, 2019, 10:45 AM   #14
parky
Member
United Kingdom

parky is offline
 
Join Date: Oct 2004
Location: Midlands
Posts: 1,186
I used the step sequencer on a pallet strap machine, due to varying customer requirements, speed etc. it required different sequences depending on the pallet type, size & various other parameters. These were determined by sensors for example length, number of runners, blind or open (if blind bottom of pallet had continuous running boards or if open only top boards) this determined if swords to apply strap were used, if not blind then feed straps without swords or if blind then swords inserted to feed strap between runners. size determined if one or two out of three strap positions used, rotation to strap both ways & the list goes on. The solution I posted earlier worked a treat it also had to position the pallet depending on the length, width of the runners.
I created many routines for each function including moving back/forward if sensors detected feed area was blocked on a go forward/back a couple of times & alarm if routes not clear. I can't remember how many routines I had to create but written long hand it would not fit into the PLC memory and meant reproducing similar logic for many routines. All known functions were called via a recipe arrays of types coded into memory i.e. 1,5,1,3,4 and each number represented the routine to run so some routines ran more than once and in the order of the array. It also meant that a recipe could be added if another type of pallet was introduced, providing that the function was available.
  Reply With Quote
Old July 18th, 2019, 12:42 PM   #15
James Mcquade
Member
United States

James Mcquade is offline
 
Join Date: Oct 2007
Location: Tennessee
Posts: 2,532
Jzerb,

in any machine, and I mean any machine!
you have to have manual controls to reset the machine to the home position and clean it out or restart the operation.

what I was talking about was the following and maybe you understood.

if start and not go there
jsr seq 1
jsr seq 2
jsr seq 3

jsr seq 7
cycle end
wait for next start instruction.

if start pb and go there
jsr seq 2
jsr seq 3
jsr seq 4

cycle end
wait for next start instruction

as I said earlier, you must have manual logic to home the machine AND in the proper order to prevent you from tearing up the machine.

I saw a machine that cost 2.5 million tore to pieces when the company lost power and when power was restored, they hit the home button per the instructions. everything went home all at once and did $250k in damage and took 9 months to rebuild. the programmers were fired by the oem and the oem was not happy having to pay the repair costs and lost revenue bill.

james
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
logic master RPD LIVE PLC Questions And Answers 8 October 9th, 2007 01:40 PM
Allen-Bradley “Latches” vs. Direct Logic “Sets” ... round 1 ... Ron Beaufort LIVE PLC Questions And Answers 38 May 18th, 2005 07:52 AM
Using Bit Logic to Sequence Guido LIVE PLC Questions And Answers 6 May 10th, 2005 07:21 AM
RSLogix: Multiple Machine Support GBrinkworth LIVE PLC Questions And Answers 17 November 15th, 2002 08:21 AM
Machine Control Logic jthornton LIVE PLC Questions And Answers 7 September 17th, 2002 09:02 AM


All times are GMT -5. The time now is 05:42 PM.


.