# EXOR statement

**URL:** <https://tech-community.robotics.abb.com/t/exor-statement/3354>\
**Category:** Robot Controller\
**Created:** [February 10, 2010, 4:07pm UTC](https://tech-community.robotics.abb.com/t/exor-statement/3354 "2010-02-10T16:07:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dup](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@Dup](https://tech-community.robotics.abb.com/u/Dup)\
**Post date:** [February 10, 2010, 4:07pm UTC](https://tech-community.robotics.abb.com/t/exor-statement/3354/1 "2010-02-10T16:07:56Z")

</div>

Hi All

I would like to use an exclusive or statement to wait for a specific DI input to be true. I cannot seem to get the syntax right. Is it possible to do something similar to the statement below;

WaitUntil DItemp1=1 EXOR DItemp3=1 EXOR DItemp3=1;

---

<div class="post-metadata">

**Author:** ![frpa](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/frpa/32/3390_2.png) [@frpa](https://tech-community.robotics.abb.com/u/frpa)\
**Post date:** [February 11, 2010, 11:20am UTC](https://tech-community.robotics.abb.com/t/exor-statement/3354/2 "2010-02-11T11:20:48Z")

</div>

Hello,  
In RAPID, you use XOR, not EXOR.

However, you have to consider what you want to do. Do you want to go forward if one, and only one of the inputs is 1? That is not what happens in your example.

Hope this helps you, otherwise, please explain in more detail what behaviour you want!

BR frpa

---

<div class="post-metadata">

**Author:** ![Dup](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@Dup](https://tech-community.robotics.abb.com/u/Dup)\
**Post date:** [February 11, 2010, 12:16pm UTC](https://tech-community.robotics.abb.com/t/exor-statement/3354/3 "2010-02-11T12:16:59Z")

</div>

Thanks for the syntax

My firt post had a bit of a typo

WaitUntil DItemp1=1 XOR DItemp2=1 XOR DItemp3=1;

If i am right this should allow it to move on if only one of the inputs are true.

---

<div class="post-metadata">

**Author:** ![frpa](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/frpa/32/3390_2.png) [@frpa](https://tech-community.robotics.abb.com/u/frpa)\
**Post date:** [February 11, 2010, 1:11pm UTC](https://tech-community.robotics.abb.com/t/exor-statement/3354/4 "2010-02-11T13:11:32Z")

</div>

Hello,  
No, this does not work.

The statement will be evalutated like this:  
WaitUntil (DItemp1=1 XOR DItemp2=1) XOR DItemp3=1;

Consider the situation where all of the IOs are 1.

The first evaluation will be FALSE, which gives us  
WaitUntil FALSE XOR DItemp3=1;  
which gives us TRUE…

I can’t think from the top of my head how to do this with logic, but it can probably be done. Ideas, anyone?

BR frpa

---

<div class="post-metadata">

**Author:** ![frpa](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/frpa/32/3390_2.png) [@frpa](https://tech-community.robotics.abb.com/u/frpa)\
**Post date:** [February 11, 2010, 1:21pm UTC](https://tech-community.robotics.abb.com/t/exor-statement/3354/5 "2010-02-11T13:21:06Z")

</div>

This should work…

WaitUntil (di1+di2+di3=1);

BR frpa

---

<div class="post-metadata">

**Author:** ![Dup](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@Dup](https://tech-community.robotics.abb.com/u/Dup)\
**Post date:** [February 11, 2010, 6:35pm UTC](https://tech-community.robotics.abb.com/t/exor-statement/3354/6 "2010-02-11T18:35:58Z")

</div>

Excellent thanks, I will give it a wack.
