Sequencers

I did recognize that the question was asked in terms of an "AB" Sequencer...

HOWEVER....

Taken from "NEW HERE?"

5. Tips for Posting

When posing your question, remember that the various PLC’s use some terms and symbols that are unique to their product line. If you specify a question strictly in the unique terms used by your particular PLC you might be excluding some people from helping you. This is because some people won't recognize or understand the specific terms you are using.

...

So, try to be as general as possible so as to include all of the possible respondents, and yet be as specific as necessary to clearly identify the problem.

If questions are asked and answered in this manner, then many more stand to benefit! That is, after all, why we are here!


The intent of this Rule includes a certain implied "duality". That is, while petitioners are asked to pose their questions in as general a way as possible, respondents are also asked to provide answers which not only attempt to answer the specific question, but also to address the general concept.

The idea is to learn the various "concepts" which apply to logic in general, while still attempting to address the unique ways that a particular concept might be used/abused/misused in one PLC or another.

It is through the learning of the CONCEPTS that one can move more easily between the various platforms.

From Allen Nelson...

Gerry, you're right about how AB does it's masks.

Mask is not the same as an AND. That's why they use differnt words.

Which I know, when I think about it - that's why I use a mask, to leave the bits that don't correspond to the mask unchanged (OFF or ON).

I've seen Terry's description of MASK before, and I just didn't give it any critical thought. I should have. Even Terry Woods can make mistakes, and he did.



You said it yourself, Allen...
"Just to supplement what Terry said, the AB uses an AND mask in the SQO (and all other masks, such as MVM (MoVe with Mask) "

And later you said...
"Mask is not the same as an AND. That's why they use differnt words. "

As you said, the function is called "Move WITH Mask" ... doesn't that indicate more than one operation?

And, as you said, they use "different words". They have to use "different words" because they are doing more than performing a simple Masking Operation.

The function begins with a Masking Operation. In this particular case, they use the AND-Method. Then, going beyond the Masking Operation, the results of the Masking Operation are applied to something.

Each of the descriptions that were posted included an AND-Mask Operation followed by at least one other operation. The subsequent operations applied the result of the Masking Operation to something else.

I described the Orange; you described the Fruit Salad.

If you only think of Masking in terms of those functions that contain it, then, if there isn't a function containing a Masking Operation available, a Masking Operation can't be done! That's called Tunnel-Vision.

I will stick to, and continue to promote, my description of a mask - it is CORRECT.


MASKING is a logical concept! NOT just a part of an AB Function!
 
Terry:

Perhaps we're just arguing semantics. Or maybe we are just thinking of different PLC (you S7-200, me SLC).

When I hear the word "MASK", I always think in terms of a filter. In a Move instructoin, if the bit is 1 the move is allowed; if 0 the move is not allowed. I've never seen a system when there is choice of boolean done with the MASK (AND, OR, XAND, XOR), and then some other operation is done. If you have, which one?

The AB has a MEQ, where two words are compared through a mask. Again the mask is the filter that permits comparison. Although you might think of it as an AND filter, the destination doesn't go anywhere.

If you only think of Masking in terms of those functions that contain it, then, if there isn't a function containing a Masking Operation available, a Masking Operation can't be done! That's called Tunnel-Vision.

Huh?

I use the Instruction set in the PLC that I've got.
Some instructions include Masks, some don't.

If I need to do something, I'll find the combination of instructions to do it for me. If I want to do a Move with Mask, à la AB, and the instruction doesn't exist for that PLC, I'll do it as Gerry said, AND with the Mask word, then OR with the Output, into the Output.
 
Masking existed as a logical tool long before PLC's were invented.

They were, and still are, used in "real" computer hardware (static Masking) and software (Dynamic Masking).

There are two aspects to MASKING... the MASK itself and the Masking Operation. To speak of MASKING is to speak of the MASK and the specified MASK Operation. MASKING consists of a MASK (user defined) and a MASK OPERATION (user defined). They are "user defined" unless a canned routine is used which might force either the MASK, the MASK OPERATION, or both, to some pre-defined condition.

The AB Function that you guys have been describing is a canned routine. This routine can be performed by any middle-ground PLC without using that Function at all. The MASK OPERATION can be performed, via software programming, simply by Logically-AND'ing, or Logical-OR'ing the given data with the MASK.

The NAND version takes a little more effort and the XOR version takes more than that - but it is not unmanageable.

You can then use the result of the MASK OPERATION directly or use the result to modify (through a logical function) something else.

If you look through the manual and find that there is no Masking Function available... Roll yer Own! It is as basic a concept as AND or OR!

From Allen...
The AB has a MEQ, where two words are compared through a mask. Again the mask is the filter that permits comparison. Although you might think of it as an AND filter, the destination doesn't go anywhere.

And you couldn't do this without the MEQ Function?

MEQ Function:


Data-1 1011
Data-2 0011
Mask 1001
Result 0001


.
Roll yer Own:


Data-1 1011
AND-MASK 1001
Result-1 1001

Data-2 0011
AND-MASK 1001
Result-2 0001

Result-1 1001
Result-2 0001
AND 0001


.
This is basic stuff.

And even if "the destination doesn't go anywhere", the result is used for something... else, why do it?

As far as the "semantics" of this issue goes, it has nothing what-so-ever to do with the type of PLC (bottom-end excluded).

The "semantic issue" is, while I'm talking about MASKING which consists of a Mask and a Mask Operation (called MASKING - not a semantic problem), you are talking about a Function which uses a mask and a masking operation and then applies the result of that operation to something else (MoVe with Mask, or variations there of - that is a semantic problem).

Splitting hairs? I don't think so. Details count. In fact, the details are everything, especially in logic!
 
MEQ Function:




Data-1 1011


Data-2 0011


Mask 1001


Result 0001

....
This is basic stuff.
Basic - yet so easy to get wrong! As Allen mentioned, MEQ is a compare instruction. The result is true or false. In your example, the result is false (0).

If you number the bits 0-3, right to left, then a MEQ as above will check bits 0 and 3 in Data-1 and Data-2 for equality and ignore bits 1 and 2. Since bits 3 are not equal, the instruction evaluates as false.
Details count. In fact, the details are everything, especially in logic!
 
Terry Woods said:

The "semantic issue" is, while I'm talking about MASKING which consists of a Mask and a Mask Operation (called MASKING - not a semantic problem), you are talking about a Function which uses a mask and a masking operation and then applies the result of that operation to something else (MoVe with Mask, or variations there of - that is a semantic problem).

I think I see what you are trying to say, and it is a semantic difference.

When a function contains a Mask, the mask enables or disables the function on a bitwise fashion.

A mask (like you wear on Halloween), covers some things, and reveals others. What is "uncovered" in a PLC mask (bit set to 1), are the bits that the function can manipulate.

You can't seperate the mask from the function that contains the Mask.

What you are talking about is manipulating data bitwise by AND, OR, XOR, etc., with some "control word". You could call that "control word" a "mask" if you want, but I wouldn't.
 
IMMHO, This has got some good stuff in it, so y'all should read it all!

I think I see what you are trying to say, and it is a semantic difference.

Yeah, just like the difference between Right and Wrong is only a matter of opinion.

When a function contains a Mask, the mask enables or disables the function on a bitwise fashion.

The MASK does not enable or disable anything. The interpretation of the result by the function does.

A mask (like you wear on Halloween), covers some things, and reveals others. What is "uncovered" in a PLC mask (bit set to 1), are the bits that the function can manipulate.

That is so, only if the function interprets the results of the Masking Operation that way.

You can't seperate the mask from the function that contains the Mask.

Masking Operations can operate quite nicely on their own - without a function.

What you are talking about is manipulating data bitwise by AND, OR, XOR, etc., with some "control word". You could call that "control word" a "mask" if you want, but I wouldn't.

If the MASK ain't a control word, then what the hell is it?

And how do you think the processor looks at it?

I don't know the MEQ Function, so I used your (Allen's) description.

MEQ Function:
.

Data-A = 1011
Data-B = 0011
Mask = 1001
Result = 0001
Function Result = Non-Zero, therefore, FALSE (according to Gerry)


.
As I said, I don't know the MEQ Function, so I used Allen's description, as far as it went.

This is how the processor executes the function (that is, as the Function has been described to me).

Load 1011 into ACC-A <-- Data-A
Load 1001 into ACC-B <-- This is the MASK, be it user defined or Function defined.
Do a Bit-Wise "AND" on ACC-A and ACC-B
Result-1 = 1001 --> Save Result-1

Load 0011 into ACC-A <-- Data-B
Load 1001 into ACC-B <-- This is the MASK, be it user defined or Function defined.
Do a Bit-Wise "AND" on ACC-A and ACC-B
Result-2 = 0001 --> Save Result-2

At this point, "MASKING" OPERATIONS are DONE! It's not "MASKING" anymore.

However, the MEQ FUNCTION, as has been described to me, calls for other operations to be performed.

Load Result-1 (1001) into ACC-A
Load Result-2 (0001) into ACC-B
Do a Bit-Wise "AND" on ACC-A and ACC-B
Result-3 = 0001 --> Save Result-3


Load MASK (1001) into ACC-A
Load Result-3 (0001) into ACC-B
Do a Bit-Wise "XOR" on ACC-A and ACC-B
Result-4 = 1000 --> Save Result-4

At this point, it is worth noting that most processors do NOT have the capability to perform an "XOR" operation directly. Nor can they do an "OR" operation directly. That is, they simply don't have the hardware to do so. This is also the case for Subtraction. The hardware just ain't there to make it happen! So, the operations are "manipulated" via software.

In the case of Subtraction, the result is obtained via 2's Compliment. The 2's Compliment versions of the numbers are sent to the "ADDER".

In the case of "OR", the result is obtained by... NOT (NOT-A & NOT-B).

In the case of XOR, the result is obtained by... (A & NOT-B) OR (NOT-A & B).

So, in order to perform the "XOR" operation, the processor does a much longer string of operations...

Load MASK (1001) into ACC-A
Load the NOT'd version of Result-3 into ACC-B <-- this actually took a few extra steps in itself.
Do a Bit-Wise "AND" on ACC-A and ACC-B
Result-4a = 1000 --> Save Result-4a

Load the NOT'd version of the MASK into ACC-A <-- this actually took a few extra steps in itself.
Load Result-3 into ACC-B
Do a Bit-Wise "AND" on ACC-A and ACC-B
Result-4b = 0000 --> Save Result-4b

Now the "OR" operation calls for, NOT (NOT-A & NOT-B).

Load the NOT'd version of Result-4a into ACC-A
Load the NOT'd version of Result-4b into ACC-B
Do a Bit-Wise "AND" on ACC-A and ACC-B
Result-4c = 0111

The final step is to...
"NOT" Result-4c = 1000

Now, on the ACC that holds the result, there is a Flag. That Flag indicates whether or not the contents of the ACC is ZERO. The Flag is called the "Zero-Flag". If the content of the ACC is Zero, then the Zero-Flag is turned ON (it is TRUE that the content is ZERO), else, not.

So, when the MEQ Function finally gets to go-ahead to read the "Zero-Flag" and it sees a "0" (It is NOT-TRUE that the content is Zero), the result, as stated by Gerry, is FALSE.

Notice that the function does not look at the content, but rather, the Zero-Flag.

Now, if this isn't a "BIT-WISE" function, then I'll be happy to kiss your A$$.

If you can't or don't want to see things from the processor point of view, just say so.

The processor is KING! You ought to see things from his point of view.
 
At this point, it is worth noting that most processors do NOT have the capability to perform an "XOR" operation directly. Nor can they do an "OR" operation directly. That is, they simply don't have the hardware to do so. This is also the case for Subtraction. The hardware just ain't there to make it happen! So, the operations are "manipulated" via software.

PLEASE CHECK YOUR FACTS!

Start by looking up the instruction sets for Motorola 6800 and Zilog Z80.
 
The length of this thread and the nearly religious vehemence of the arguments there-in has given me yet another reason never to use sequencer instructions.

Amen.

(8{)} ( .)

(Yosi)
 
mask

A mask is a mask. This is a filter. In all computer applications it defines what passes and what is ignored.
Same as the TCPIP subnet mask. :)
 
Just a quick gotcha a sequncer starts at position zero but never naturally goes back to zero ie if you have 5 positions the sequencer will start at zero and count to 4 (or 5 not really positive on this) then go back to one.

This can be handy if you are using a sequencer to control a process and want to initalize all the outputs on power up.
 
Sequencers are not all bad!

The length of this thread and the nearly religious vehemence of the arguments there-in has given me yet another reason never to use sequencer instructions.
Don't Limit yourself.

There will be plenty of opportunities in the future to use Sequencers.
I repeat... Don't let this thread or any other convince you to stay away from sequencers.
 
gbradley said:

Don't let this thread or any other convince you to stay away from sequencers

Sequencers in A-B controllers are horid archaic beastly thing-oids. They are hold-overs from the PLC-2. Feh!

Sequencers are limited. They only go one direction.

Sequencers are expensive. They need a control structure.

Sequencers are more difficult to understand than a simple and more powerful home-grown replacement. Just look at the length of this (and other sequencer related) thread.

Sequencers generate unnecessary interference in the sub-ether. Want proof, just look at the length of this thread.

A move with mask (MVM) instruction with an indirectly addressed destination address will do anything an SQO will do. It's cheaper (one word pointer vs. 3 word control structure and the instruction takes less space too) and you can simply jump to any position just by changing the pointer. If you want to be really hairy you can modify the mask on the fly (indirect addressing) and even the destination on the fly (even more indirect addressing).

Yes, I used to use the sequencer instruction extensively in the PLC-2. A-B then invented the PLC-5 and I haven't used a sequencer since and G-d willing I never will.

Amen

(8{)} :) .)
 

Similar Topics

Hi All, I need some clarification on sequencers, I researched this forum but haven't been able to find a good explanation, including the ones...
Replies
10
Views
5,056
I am trying to program the traffic control simulation on logixpro using sequencers. I have done the previous simulations with the stop light but i...
Replies
1
Views
1,786
First of all, I want to thank everyone for all the help on previous questions. My new job is proving to be a challenge (in a good way)and your...
Replies
10
Views
5,066
hi, I looked on google and faq but with no result.. My questions are: -how do i call a subroutine from structured text? -i was looking at the...
Replies
3
Views
2,016
I was wondering how I might go about using my sequencer in such a way that I can set a time at each step or positon in the sequence. What will be...
Replies
1
Views
1,568
Back
Top Bottom