What Instruction Can I Use To Reverse The Status Of Specific Bits?

Modified on Sun, 11 May, 2025 at 10:39 PM



Use the EXCLUSIVE OR instruction (XORW) to reverse the status of specific bits in a specific word.
EXCLUSIVE OR Instruction (XORW) Specifications

1.An EXCLUSIVE OR of the corresponding bits in input 1 and input 2 are taken and the results are output to the result word, R.

2.As can be seen in the truth table on the right, when the EXCLUSIVE OR is executed, the bits with different status in inputs S1 and S2 will be 1 in the result word, while the bits with the same status will be 0.
Program and Operation

By using this basic specification of the EXCLUSIVE OR instruction (XORW), specific bits in a specific word can be inverted.
1. Ladder Programming


 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article