Sign in to follow this  
Followers 0
Guest Jerry Desaulniers

Step-step next sequence

7 posts in this topic

First I like that there is a place where someone can go to learn Omron as Omron has the worst manuals in the world. Anyways I'm learning Omron at home and have Syswin 3.4, Cable and CPM2A. I downloaded the step step next sequence program (from download code section) and was very excited to give it a try as step and stepnext are functions that have me baffled. As a matter of fact they were on my list as the next functions to play with, Well now I'm even more confused, I'm sure this template is good but I didn't understand it's purpose. Where do you insert the parts of the program to control(steps)? What keeps the steps from functioning at the same time? Maybe an explanation of the functions might make it clear, keep in mind that I allready have the manual and have read step and step next and still dont understand. It's not for lack of trying! And by the way the other Program control functions came in as clear as a bell to me.

Share this post


Link to post
Share on other sites
Ok I played a little more with STEP(08) and SNXT(09) I'm starting to get it but I'm still a mile off.  I'm attaching the program I was using to test the functions, if you look at is you will see that I was just trying to get it to operate like a drum sequencer. In each step I have an input coming from another PLC to simulate an actuator reaching it's limit switch. These inputs are 1.01, 1.02. and 1.03. When I ran the program it would cycle through twice and freeze. I played some more and had to bury a reset inside of step 2 to get it to continually cycle. What am I missing? I'm sure I really don't understand these function very well. By the way I tried using duplicated outputs and was amazed that they work. Step3.swp

Share this post


Link to post
Share on other sites
Jerry! Welcome to Mr.PLC.com.  Thankyou for taking a look at our section on Omron PLCs.  Your contribution on other forums is phenomenal! ;) A little background on STEP/STEP NEXT sequences: Definitions: STEP does no useful work in the program.  It is a marker to the beginning of a step.  The length of a step runs from STEP marker to the next STEP Marker. Ladder instructions placed between these markers are bounded by that particular STEP.  Usually, but not mandatory, only one STEP at a time is active., i.e. the CPU processes and executes only that active STEP.  All other ladder bounded by STEP markers is dead and does not execute.  The last STEP in the sequence is bounded by a STEP instruction with no operand(bit number). STEP NEXT (SNXT) is the action instruction of the pair.  It's like a BASIC GOTO.  "Where do I go NEXT?"  When SNXT is executed, the ladder in the STEP from which it is located goes dead(inactive) and program control flows to the STEP that SNXT activates.  This property of inactive steps not executing ladder allows the use of duplicate coils.  Unless you accidently cause two steps to be on at the same time, only one coil actually gets written to the I/O image table.  To end a sequence, execute a SNXT to an undefined STEP (STEP to nowhere) - an unused bit.  I usually use the last bit in the word I have chosen for STEP control.  If you want to recycle the sequence, then in the last STEP, SNXT to the beginning step. Branching is possible in a particular STEP.  Let's say you want that if input A is on, you want to follow the normal sequence.  But if input B is on, you might want to skip around a STEP.  It's a simple matter to place two conditional rungs with each input executing a different SNXT location. Multiple STEP/SNXT sequences can be executed at the same time in the same processor.  An example, let's say you are controlling a drilling, reaming, deburring index table.  You might have one STEP sequence control the indexing portion of the table.  When the index is complete, you start three simultaneous STEP sequences: one for drilling, one for reaming and one for deburring.  When these sequences have all finished, you branch back to the index sequence. OK, analysis of your STEP sequence yields the following: 1.   You have started your sequence with an input from a pushbutton which executes the first STEP.  (Excellent! This is the classic way to start a sequence.) 2.  Entering the first STEP, you actuated three coils and then wait for an input (1.01) to become active to go to the next STEP (right on!) 3.   Entering the second STEP, you acctuated the same three coils and wait for an input(1.02) to go to the next step (Perfectly legitimate - duplicate coils are appropriate.) 4.  Now the assumption is made that to recycle the sequence it will automatically start over at the beginning STEP.  A natural assumption, but it is necessary for you to execute a SNXT which activates the beginning STEP if this in truly the entry point that you want to goto.  In this case, the SNXT would be SNXT 200.00. 5.  To bring this sequence to an orderly end, in the last STEP, place a SNXT to nowhere ( an unused bit - 200.15?) and all STEPS will be deactivated. I have developed a number of Dos and Don't for STEP sequences and they follow: 1. Prevent energizing SNXT functions with a differentiated (DIFU) contact.  The SNXT function is already a leading edge instruction. 2. Prevent energizing two steps at a time that include the same output coil number.  The step closest to the END function will take precedence over previous steps. 3. To use the true diagnostic power of STEP/SNXT, make only one change in the output structure in each step.  If you are doing two actions in one STEP, then there should be two STEPs. 4. JMP,JME,IL,ILE,SBN, and RET functions should not be included in a step as they use the same internal mechanism as STEP/SNXT. 5. Contrary to all Omron documents, unless your CPU is a CxxK PLC,  the control bits do not have to be contiguous and in the same channel. 6. If it is necessary to trigger a differentiation (DIFU) upon entering the STEP, use a normally closed contact of 25407 (Step Start Flag) to energize the differentiated instruction. 7. If you have multiple STEP sequences in your program, make sure that the final STEP in each sequence is bounded by a separate STEP with no operand.  (Overflow can occur!)

Share this post


Link to post
Share on other sites
Thanks Jay, Since my previous post I had more time to play with this function and I think I'm starting to get it and see its purpose. At this point I see this function useful for starting up process equipment and as I learn it better I will see more uses. I still have to try it six ways to Sunday before I will become proficient at it. I have another question but that is for another thread.                             Jerry Desaulniers PS I clipped your post for my notebook as it is far superior to the japlish explanation Omron supplied.

Share this post


Link to post
Share on other sites
Jerry, the STEP/SNXT pair is the Omron solution to give the programmer the possibility to directly program Grafcet. To get more info on Grafcet, search the web. There are numerous articles on it, unfortunately most of them are in French. After all, Grafcet is a French invention. If you know Dutch, read the course on designingmethods I hav on my website: www.sectieplc.brugge.yucom.be. I'm sorry, but up to now I haven't found the time to translate it to English yet! Jay, thanks for your info on the adressing. I use CQM1 and have always restricted my STEPs to be within one channel. I will shurely try out to get them scattered. In this way I won't be restricted to a maximum of 16 steps. Would be great! Jean Pierre Vandecandelaere

Share this post


Link to post
Share on other sites
Something better then Step-Step........................it's called an ASL (arithmic shift left), if it's used correctly it's comparable to a logical CAM. ------||----------( DIFF-UP FUNC 13) 000.00 13.00 ---------------------------------------------------------------- --------||----------( MOVE FUNC 21 / #0001 into LR03) LR13.00 ---------------------------------------------------------------- -------||-------------||---------------( ASL FUNC(25) LR03) lr03.00.........TIM001 | -------||-------------||------| lr03.01.........TIM002 | -------||-------------||------| lr03.02.........TIM003 | -------||-------------||------| ------------------------------------------------------------ ________ -------||-------------| TIM001 | lr03.00 |_#0003_| ------------------------------------------------------------- ________ -------||------------| TIM002 | lr03.01 | _#0003_| ------------------------------------------------------------ _________ -------||------------| TIM003 | lr03.02 |_#0003_| ------------------------------------------------------------ -------||-----------------( )---| LR03.00............10.00 ------------------------------------------------------------ -------||------------------( )---| LR03.01..............10.01 ------------------------------------------------------------ -------||------------------( )---| LR03.02...............10.02 ----------------------------------------------------------- -----( FUNC-01 END) Here's how it works you take your execution bit and diff a move function. Move a #0001 into LR03. LR03 then starts, lr03.00 starts timer and will not continue until tim001 times out, and so on. You can have LR03.00 fire a valve, start a motor, set a keep, whatever. Then lr03.01 can do something else. You can have additional conditions on the rungs of the ASL to make conditionals sequences. For this particula ASL the sequesnce is (LR03.00-TIM001) (LR03.01-TIM002) (LR03.02-TIM003) then continue with this same pattern up to LR03.15 If anyone want SYSwin code for this I have it. Tons of it! Edited by myerz

Share this post


Link to post
Share on other sites
Shift Registers are a great way to do sequential logic. Why don't you post this code in Syswin format in the Omron PLC section. I'm sure it would look better. Be sure to ZIP the file as .swp is not one of the legal upload extensions. If you post it, I will make a .pdf of the code so those that don't have Syswin can look at it. Upload Omron PLC Code

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