PLC Ladder Logic Instructions

Siemens PLC Programming This chapter covers the following topics (AND, OR, and Exclusive OR (XOR) Instructions , Inversion , Instructions that Set and Reset Bits , Additional Ladder Diagram Instructions )


AND, OR, and Exclusive OR (XOR) Instructions

  • LAD programs incorporate configurations of instructions that represent logical conditions derived from the Boolean logic used to design computer circuits.
  • Some of the most common Boolean logic functions are the AND, OR, and Exclusive OR (XOR) functions.
  • For example the network in the graphic is an AND function.
siemens
PLC Ladder Logic



  • For this network as the associated truth table shows the only condition that causes the output coil to turn on and the Q3.2 status bit to be set to 1 is when the I2.4 and I3.5 status bits are both 1.
  • In other words when the status bits for both normally open contact instructions are 1's both contacts will be closed and there will be power flow to the output coil instruction.
  • When normally open contact instructions are placed in parallel leading to an output coil instruction an OR function is formed.
  • For this network as the associated truth table shows if the status bits for either or both of the normally open contact instructions are 1 the Q3.2 status bit is set to 1.
  • The XOR function is formed using normally open and normally closed contact instructions leading to an output coil instruction.
  • As the truth table for this function shows Q3.2 is 1 if either I2.4 or I3.5 is 1 but not if both are 1's.

Logic Gates Programming Videos

Inversion

  • The inverted output coil instruction is one example of inversion which means changing 1 to 0 or 0 to 1 and is sometimes called negation.
  • To understand this better consider the networks shown in the graphic.
Ladder Logic
Inverted output coil 


  • The AND and OR functions previously described are shown along with similar logic that uses an inverted output coil instruction.
  • This results in logical operations that are sometimes referred to as NAND and NOR functions.
  • Notice that the truth tables for these functions show the resulting states for Q3.2 to be inverted in comparison to the truth tables for the AND and OR functions.
  • The NOT contact instruction shown in the graphic is another example of a logic inverter.

ladder logic
Inverted output coil NOT

  • If there is no power flow to the NOT contact instruction there is power flow after the NOT contact instruction and vice versa.
  • Note that the truth table for the network with the NOT contact instruction shows the states of output Q3.2 as inverted from the states shown for the network without the NOT contact instruction.
  • Because the inversion occurs each time the network is scanned the NOT contact instruction does not have an operand.
siemens plc
S7-200, S7-300, and S7- 400 PLC'S

  • Although S7-200, S7-300, and S7- 400 PLC'S do not have an inverted coil output instruction adding a NOT contact instruction prior to an output coil instruction has the same effect.

Instructions that Set and Reset Bits


  • There are a variety of LAD instructions for setting and resetting bits.
  • For example the graphic shows networks with set and reset coil instructions.
ladder logic
Reset set flip-flop

  • When there is power flow to the Set coil instruction the bit specified by the instruction's operand is set to 1.
  • When there is power flow to the Reset coil instruction the bit specified by the instruction's operand is reset to 0.
  • In this example when I2.4 is set to 1 the normally open contact closes there is power flow to the set coil instruction and Q3.2 is set to 1.
  • Output Q3.2 remains a 1 even if I2.4 later goes to 0.
  • When I4.3 is 1, there is power flow to the reset coil instruction and Q3.2 resets to 0.
  • The graphic shows a set reset flip-flop another instruction that sets and resets bits.
  • When there is power flow to the set (S) input the output (Q) and the memory bit specified by the operand at the top of the instruction are both set to 1.
  • They remain a 1 even if there is no power flow at the set input until there is power flow at the reset (R) input.
  • For the set reset flip-flop the reset input is dominant.
ladder logic
Set and Reset Bits

  • In other words with power flow at both the set and the reset inputs the output and memory operand for the set reset flip-flop are both 0.
  • Next consider the lower network in the graphic which includes a reset set flip-flop instruction.
Ladder Logic
set reset flip-flop

  • This instruction functions the same as a set reset flip-flop instruction except that the set input is dominant In other words with power flow at both the set and the reset inputs the output and memory operand for the set reset flip-flop are both 1.
  • In the examples shown note that a bit memory (M) address is used as an operand.
  • Using a bit memory address rather that an input (I) or output (Q) operand avoids the problem of picking an operand that could otherwise be used by the PLC'S I/O modules.

Additional Ladder Diagram Instructions

  • The instructions shown in this lesson are only a few of the many types of instructions that can be included in a Siemens PLC LAD program.
  • A LAD program can include a variety of basic and extended instructions.
  • The Basic instructions are grouped in the following categories
     
    ladder logic
    Basic instructions

  1. Bit Logic Instructions
  2. Timers
  3. Counters
  4. Compare Instructions
  5. Math Instructions
  6. Move Instructions
  7. Convert Instructions
  8. Program Control Instructions
  9. Word Logic Instructions and
  10. Shift and Rotate Instructions
  • The extended instructions are grouped in the following categories
  1. Clock and Calendar
  2. String and Character
  3. Program Control
  4. Communications
  5. Interrupts
  6. PID
  7. Motion Control and
  8. Pulse
  • In combination the basic and extended instructions provide an extensive set of instructions that allow Siemens PLC'S to perform the full range of Automation tasks.


Next Chapter we will discuss about ( Basic Function block diagram) Topics.

SIEMENS PLC Class for Beginners


Please Share this article, with your friends and colleagues

Comments

Popular posts from this blog

QElectro Tech Software Overview

Danfoss VLT micro drive FC 51 Name Plate

SIEMENS V20 VFD DRIVE FAULTS CODE LIST PART-1

SIEMENS V20 VFD DRIVE MAIN PARAMETERS LIST

Siemens RDG400KN Thermostat Parameter List