Skip to main content

Boolean logic in Studio 5000 is the foundation of every PLC control program. In this post, I’ll show you how to implement the AND, OR, NOT, NOR, and NAND logic gates in ladder logic in Studio 5000 Logix Designer.

You’ll learn the XIC and XIO instructions, the OTE output coil, and the OTL and OTU bit instructions, the toolkit that no real control circuit on an Allen-Bradley controller can do without.

This is the third part of our series on Allen-Bradley controllers. Earlier we covered the ControlLogix and CompactLogix hardware and the installation of Studio 5000 and your first program.

Boolean Logic

Boolean logic is the absolute foundation of modern computing – without it there would be no computers, smartphones, or internet. Created in the 19th century by the mathematician George Boole, it rests on a brilliantly simple premise: any piece of information can be reduced to just two states, true (1) and false (0). It is precisely thanks to basic operations such as the AND, OR, and NOT gates that processors are able to process data and make complex decisions in fractions of a second. Although at first glance this sounds like abstract mathematics, we use the principles of this logic every day, for example when refining our queries in internet search engines.

From the previous post we already know what ladder logic is and how normally open and normally closed contacts work, which means we can use the knowledge we’ve already gained to implement logic gates in Studio 5000.

Ladder Logic Elements in Studio 5000 Logix Designer

Normally Open (NO) Contact – the XIC Instruction

The XIC (Examine If Closed) instruction is the equivalent of an NO (normally open) contact. This instruction checks whether the contact is closed (has a value of 1); if the tag assigned to it is active, the instruction passes the signal further along the rung.

In the online view it is highlighted green when the condition is met.

The AND Logic Operation

The OR Logic Operation

Normally Closed (NC) Contact – the XIO Instruction

The XIO (Examine If Open) instruction is the equivalent of an NC (normally closed) contact. It works the other way around, meaning it checks whether the contact is open (has a value of 0). It passes the signal only when the tag assigned to it is inactive, making it ideal for emergency-stop or stop buttons, where the absence of a signal should trigger a defined response.

The NOR Logic Operation

The NAND Logic Operation

Assigning an Output – the OTE Instruction

The OTE (Output Energize) instruction is the output coil. It is an action instruction always placed at the right-hand side of the rung. If all the conditions on the left side (the XIC/XIO contacts) are met and the signal reaches it, the coil writes a value of 1 to the assigned tag. When the conditions are no longer met, the coil immediately changes the tag’s state to 0.

Bit Instructions – Output LATCH/UNLATCH

  • OTL (Output Latch) – This is a conditional instruction that sets the indicated bit in memory to the high state (1) only when the condition preceding it is true; if the condition becomes false, the instruction takes no action and the bit retains its state of 1 until it is reset programmatically.
  • OTU (Output Unlatch) – This is a conditional instruction that forces the low state (0) on the indicated bit only at the moment when the condition preceding it is true; just as with OTL, if the rung conditions are false, this instruction ignores the bit, leaving its current value in memory unchanged.

Summary

You can now build AND, OR, NOR, and NAND logic circuits and apply the XIC, XIO, OTE, OTL, and OTU instructions in Studio 5000. This is a solid foundation for creating more elaborate programs on Allen-Bradley controllers.

Studio 5000 Logix Designer: installation and first program

Previous in the series

Studio 5000 Logix Designer: installation and first program

Install the software, set up the comms and write your first ladder program, step by step.

Author

Jacob Biedulski, MSc

Author Jacob Biedulski, MSc

Automation Engineer and PLC Specialist CTO & Co-Founder at ControlByte I help students and professionals master PLC programming and IIoT technologies.

More posts by Jacob Biedulski, MSc