This page has no translation to Deutsch yet. The original English version is below. If you’d like to help, great! See how to translate a documentation page in the contribution guide.
Note This is a web-version of a tutorial chapter embedded right into the XOD IDE. To get a better learning experience we recommend to install the desktop IDE or start the browser-based IDE, and you’ll see the same tutorial there.

Booleans

Screenshot of 007-booleans

In previous lessons we mostly dealt with numbers adjusting counter step and clock interval. Now let’s talk about booleans. They have only two possible values:

  • True (aka logic one, high signal)
  • False (aka logic zero, low signal)

Booleans are extremely useful and common. They may be used to indicate whether some condition is met, should a device be on or off, did some operation succeed, etc.

Exercise #

Let’s learn how boolean values can be combined.

  1. Read the descriptions for and, or and not nodes.
  2. Guess what the output value of and will be.
  3. Run the simulation to confirm it.
  4. Use tweak-boolean nodes to change it to the opposite value.

Check out descriptions for nand, nor and xor nodes. Add them onto the patch along with some additional tweaks to make a more complex processing.

👆 Ladder logic #

If one would use binary sensors like buttons or mechanic switches as a source of boolean values and relays instead of watches, he can use XOD to program PLC devices resembling the ladder programming which is common in industrial applications.

Found a typo or mistake? Want to improve the text? Edit this page on GitHub and open a pull request. If you have a complex proposal or you want to discuss the content, feel free to start a new thread on XOD forum.