Sequences

userxyz

Member
Join Date
May 2002
Location
any
Posts
2,768
I have a little question.

My job in the last years was automation in a Carpet Factory. Now I started in a new job. I'm the programmer of machines that they build.

I never used lot's of steps, but now I have too use alot of steps.

So, I've seen a way of doing steps by someone that I really like.

I did it allways in this was:

L #STEP
L #1
==I
JCN NEX2

// CODE FOR STEP ONE
// L 2
// T #STEP

NEX2: L #STEP
L #2
==I
JCN NEX3



But his method is like this:

Making a DB with an ARRAY of BOOLS, the ARRAY is called STEP.

So He does this:

A DB_DATA.STEP[1]
JCN __2

// CODE FOR STEP 1
R DB_DATA.STEP[1]
S DB_DATA.STEP[2]

__2: A DB_DATA.STEP[2]

// CODE FOR STEP 2


...



ARE THERE BETTER METHODS ? Are how are you guys doeing this ?
 
Yes, there is a better way

Use the JL instruction. If is perfect for executing state machines. Use the current state or step as an index into a jump table. The index is loaded into the acc1 before executing the JL instruction.

The JL is one of the better features of programming using STL.
 
I use a method similar to the array of bools, but, I use named variables (Step1, Step2 etc. ) instead of an array of bools. Using named variables means you can insert a step in the DB, (e.g. Step1, Step1a, Step2) and then recompile the source. Inserting a step using an array means either using an out of sequence number, or renumbering all the following steps.
 

Similar Topics

Hey guys, A couple of quick questions but first a layout of what I'm working with. Compactlogix 1769-L37erm controller. The current system we...
Replies
2
Views
1,232
While programming sequences I usually have each step represented by individual bits. In other cases it makes sense using Integer representation...
Replies
34
Views
14,899
Hi dear programmers, Im a newbie in plc programming, i start using s7-graph to program a palletizer i wrote a typical program but im facing a...
Replies
3
Views
3,119
Hi all! I have one question: How do i create in a STEP7 GRAPH object in which more than one (2,3...) sequence running? Thx!
Replies
7
Views
1,939
Dear all, I would like to do several logical sequences to do implement in an auto mode using fbd for exemple : 1 move motor forward until stop...
Replies
4
Views
3,262
Back
Top Bottom