Functionality of the XOR Instruction?

My point is made.

The only contribution you have made is the initial post and your only reply to the thread thus far does not express appreciation to any of the other posters for their time, knowledge, and expertise, or ask a further question on any of the suggestions offered or even hint at the purpose of the thread (which in my jaded state implies a school project), it is merely to tut-tut me.

There are too many who pose a question, then sit back and wait for the answers to roll in. They get what they need, we presume, and they're never heard from again. The well meaning folks who put up the replies never know whether the question was answered or not. Nary a 'Thank You' or a whoop-te-do.

That's discouraging and irritating. I admire those who consistently reply with little hope of any feedback.

The purpose of this board is communication and communication is a two way street.

In order to escape the accusation of contributing nothing to this thread but attitude, I present:

http://www.plctalk.net/qanda/showthread.php?t=28755
 
I use the XOR instruction quite often. Most recently, I used it to provide feedback to some HMIs to create the effect of radio buttons for a group of configuration options without needing to put the functionality in the HMIs. This of course can be done without an XOR, but it looks a lot cleaner this way.
 
S7Guy said:
... I used it to provide feedback to some HMIs to create the effect of radio buttons for a group of configuration options without needing to put the functionality in the HMIs. .

Hello oh great-one, S7guy... :D

I have tried searching "radio buttons" and I think I know what you are talking about, but can you give your definition or a example, I'm all for the "cleaner look"

Thanks
 
Doug-P said:
Does anyone find it discouraging/irritating that randy741985 has not deigned to reply to this thread?
Yes.
It is irritating. I'm probably too jaded to be discouraged though.
Even more irritating - when he does deign to reply, it is only to complain.
 
I am very appreciative to everyone who has posted there examples and input, I thought this would be a interesting question, But I didnt no I would offend DougP for not responding quickly and with great admiration for his expertise on this subject.
 
Last edited:
I've used the XOR instruction to check for a change in an analog joystick value. The operators' heavy hands wear the mechanism so they don't self center any more. If there hasn't been a change in "X" seconds and the value is near center we presume it's supposed to be on center.
 
PLCs without CMP :)

This morning I was editing a file on the SLC-5/05. It has no CMP instruction. Neither has the 5/04 5/03, the ML 1000 the ML 1100 and the ML 1500. Also under Allen Bradley, The PLC2-30 and the PLC2-15 also. Under Modicon the 584A through the 584C, the 484 and the 984-A120. ( I'm not sure about the 984-A120. we used SUB blocks and XOR for comparision). The Telemacanique DAC47jr has no CMP. Surprise surprise.. The IDEC shoe box PLC HAS the CMP instruction. There are others, I have only worked with these.
 
Bruce99 said:
This morning I was editing a file on the SLC-5/05. It has no CMP instruction. Neither has the 5/04 5/03, the ML 1000 the ML 1100 and the ML 1500. Also under Allen Bradley, The PLC2-30 and the PLC2-15 also. Under Modicon the 584A through the 584C, the 484 and the 984-A120. ( I'm not sure about the 984-A120. we used SUB blocks and XOR for comparision). The Telemacanique DAC47jr has no CMP. Surprise surprise.. The IDEC shoe box PLC HAS the CMP instruction. There are others, I have only worked with these.

What are you considering a CMP? Different manufacturers have the same instruction with different names.

With AB it has a variety of compare instructions, assuming compare is what you mean with CMP, it has EQU to compare 2 values to be the same. It also other compare instructions.

I also agree with Doug-P, its nice to see someone that posts to be involved. This is just speaking for myself but I spend, cuz I can, a lot of time trying to help. I also am not as good or as educated as many here, so a confirmation of what I or others offered is nice to hear.

BTW: XOR, is a logical operation on two operands that results in a logival value of true, if and only if exactly one of the operands has a value of true; therefore it depends, may be used many ways in many situations YOU have to decide when to use.
 
Last edited:
CMP cont......:)

rsdoran said:
What are you considering a CMP? Different manufacturers have the same instruction with different names.

.
I was answering the last post on the first page by Serge. The CMP instruction is close in many PLCs. The instruction is used for comparision which I suggested the XOR can also be used for. The SUB block as well. I was responding to the poster's question as to what the XOR can be used for.
 
xor(a(xor(b(xor(a,b))) will swap the values in word a and b without using any additional memory locations.

Sorry to backtrack on this but I was curious. What in this syntax actually changes the valye of 'a' or 'b'? Is the first argument to the xor also the destination of the operation? This would give:

a XOR b -> a
a XOR b -> b
a XOR b -> a
 
Bruce99 said:
Not all PLCs have a CMP instruction. The poster was asking the applications of XOR in programming, not what is natural or artificial in programming.

Looks to me like you stated not all plc's have a compare instruction. Then you explicitly stated:
This morning I was editing a file on the SLC-5/05. It has no CMP instruction. Neither has the 5/04 5/03, the ML 1000 the ML 1100 and the ML 1500. Also under Allen Bradley, The PLC2-30 and the PLC2-15 also. Under Modicon the 584A through the 584C, the 484 and the 984-A120. ( I'm not sure about the 984-A120. we used SUB blocks and XOR for comparision). The Telemacanique DAC47jr has no CMP. Surprise surprise.. The IDEC shoe box PLC HAS the CMP instruction. There are others, I have only worked with these.

Not all plc's call it CMP but not sure of any that do not have it. AB definitely does but as mentioned does not call it CMP.

Posts like these confuse the issue.
 
CMP again...:)

Allen Bradley has the CMP instruction. Just not the models that I mentioned. I looked for any "compare" instruction. I believe Sergie was commenting why I would use an XOR when I could use CMP. The PLCs I mentioned use the XOR or SUB for comparision. Which instruction you use is not important. The CMP is very powerfull. It also compares numbers of different base. This is off the topic. Xor is a valid tool for the many applications mentioned here, even if they can be programmed by other means.
 

Similar Topics

Hey All, I am sorry to ask this, but i still gotta do it. What happens if I close RS linx? Will it cause network interruption and PLCs will lose...
Replies
5
Views
162
I am wondering if anyone has seen an input IO block that has a built in AND function for the inputs and the output of the block is a normal M12 5...
Replies
13
Views
895
Hello all, I've been working on a siemens PLC system using an S7-1200 and a KTP400 Basic HMI. Essentially this system takes in some setup...
Replies
3
Views
1,397
Insufficient resources exist on SOME_CLX_PLC to support Alarm & Event functionality. Hi All AB question. Please help me sort out this error in FT...
Replies
4
Views
2,242
Hi All, Im used to using DCS software where you can perform active step changes to move logic from the current active SFC step to any other step...
Replies
1
Views
1,215
Back
Top Bottom