PLC Instructions

PLC Instructions

In this article, you will learn the types of PLC instructions such as input, output, timer, counter, data manipulation, and program control instructions.

Programmable logic controllers (PLC) are used to automate a wide range of processes and systems in many different industries. PLCs contain a central processing unit (CPU) that reads input from sensors, performs logic operations based on a program stored in memory, and sends output to actuators to control processes or equipment.

Types of Instructions in PLC

PLC Instructions

There are many different types of instructions that can be used in a PLC program, including:

  1. Input instructions: These instructions read the status of input devices, such as sensors or switches, and store the data in memory.
  2. Output instructions: These instructions control output devices, such as motors or valves, based on the data stored in memory.
  3. Timer instructions: These instructions allow the PLC to perform a specific action after a certain time period has elapsed.
  4. Counter instructions: These instructions allow the PLC to perform a specific action after a certain number of events have occurred.
  5. Data manipulation instructions: These instructions allow the PLC to perform arithmetic operations, compare data values, or move data from one location in memory to another.
  6. Program control instructions: These instructions allow the PLC to branch to a different part of the program, skip over certain instructions, or repeat a section of the program.
  7. Communication instructions: These instructions allow the PLC to communicate with other devices, such as computers or other PLCs, over a network.

PLC Input Instructions

The input instructions typically used in a PLC program include:

  1. On/off input instructions: These instructions read the status of a single input point and store it in a memory bit as either a 1 (on) or 0 (off).
  2. Pulse input instructions: These instructions count the number of pulses received at an input point over a certain time period.
  3. Analog input instructions: These instructions read the value of an analog input, such as a temperature or pressure sensor, and convert it to a digital value that can be stored in memory.
  4. Encoder input instructions: These instructions read the position of a rotary encoder and convert it to a digital value that can be stored in memory.
  5. Data input instructions: These instructions allow the PLC to read data from an external device, such as a barcode reader or RFID reader, and store it in memory.

Input instructions are typically used at the beginning of a PLC program to read the status of input devices and store the data in memory for use in subsequent logic operations.

PLC Output Instructions

The output instructions typically used in a PLC program include:

  1. On/off output instructions: These instructions control a single output point and set it to either an on or off state based on the value of a memory bit.
  2. Pulse output instructions: These instructions generate a certain number of pulses at an output point over a certain time period.
  3. Analog output instructions: These instructions convert a digital value stored in memory to an analog signal that can be used to control an analog output device, such as a motor or valve.
  4. Encoder output instructions: These instructions convert a digital value stored in memory to an encoded signal that can be used to control a rotary encoder or another device.
  5. Data output instructions: These instructions allow the PLC to send data to an external device, such as a display or printer, based on the data stored in memory.

Output instructions are typically used at the end of a PLC program to control output devices based on the results of the logic operations performed by the program.

PLC Timer Instructions

Timer instructions typically include:

  1. On-delay timer instructions: These instructions start a timer when a specified input condition is met, and set a memory bit to 1 when the timer reaches a certain value.
  2. Off-delay timer instructions: These instructions start a timer when a specified input condition is met, and set a memory bit to 0 when the timer reaches a certain value.
  3. Retentive timer instructions: These instructions start a timer when a specified input condition is met, and store the elapsed time in a memory location when the timer is stopped.
  4. Pulse timer instructions: These instructions generate a pulse of a certain duration at a specified output point after a specified input condition is met.

Timer instructions are often used to introduce delays into a PLC program or to control the duration of an output signal.

PLC Counter Instructions

Counter instructions typically include:

  1. Up counter instructions: These instructions increment a counter value stored in memory each time a specified input condition is met.
  2. Down counter instructions: These instructions decrement a counter value stored in memory each time a specified input condition is met.
  3. Up/down counter instructions: These instructions can either increment or decrement a counter value stored in memory, depending on the specified input condition.

Counter instructions are often used to keep track of the number of events or cycles that have occurred in a process, or to control the frequency of an output signal.

PLC Data Manipulation Instructions

Data manipulation instructions typically include:

  1. Arithmetic instructions: These instructions allow the PLC to perform basic arithmetic operations, such as addition, subtraction, multiplication, and division, on data stored in memory.
  2. Data move instructions: These instructions allow the PLC to move data from one memory location to another, or to transfer data between the PLC’s memory and an external device.
  3. Data compare instructions: These instructions allow the PLC to compare the values of two memory locations and set a memory bit to 1 if the values are equal, or 0 if they are not.
  4. Data search instructions: These instructions allow the PLC to search through a series of memory locations and set a memory bit to 1 if a specific value is found, or 0 if it is not.

Data manipulation instructions are often used to manipulate data stored in the PLC’s memory or to perform calculations based on input data.

PLC Program Control Instructions

Program control instructions typically include:

  1. Jump instructions: These instructions allow the PLC to jump to a different part of the program based on the value of a memory bit or the result of a comparison.
  2. Call instructions: These instructions allow the PLC to execute a subroutine or block of instructions that is stored at a different location in the program.
  3. Return instructions: These instructions allow the PLC to return to the main program after executing a subroutine.
  4. Repeat instructions: These instructions allow the PLC to repeat a block of instructions a certain number of times, or until a certain condition is met.

Program control instructions are often used to create conditional statements or loops in a PLC program.

PLC Communication Instructions

Communication instructions typically include:

  1. Network instructions: These instructions allow the PLC to send and receive data over a network, such as Ethernet or Modbus.
  2. Serial instructions: These instructions allow the PLC to send and receive data over a serial communication link, such as RS232 or RS485.
  3. File instructions: These instructions allow the PLC to read and write data to a file, such as a CSV or XML file, stored on an external device.
  4. Database instructions: These instructions allow the PLC to read and write data to a database, such as MySQL or Oracle, stored on an external device.

Communication instructions are often used to exchange data with other systems or devices or to store data for later analysis.

Read Next:

Add comment

Sign up to receive the latest
updates and news

© All rights reserved.