PLC Programing featured image

70+ PLC Programming Instructions | Classification and Types

PLC Programing featured image

Ever want to learn Programmable Logic Controller (PLC) programming?

Along with basic digital electronic logic gates concept, programming rules and you have to learn programming instructions.

In the earlier tutorial, I have already explained the different types of logic gates and programming rules for writing PLC programming.

If you have not gone through it, you can check here.

[Explained with Ladder Diagram]

Now in this article, I am listing the topmost useful PLC programming instructions. These instructions are useful for ladder diagram programming language.

Let’s dive in from the basics.

What is the Instruction?

Instruction is nothing but the command that we give to the machine to perform certain tasks.

We can club multiple instructions to perform one logical operation. The sets of multiple operations are called as Program.

In PLC, the different instructions are used to control and maintain the operations. Every instruction is having different specifications like – working principle, function, use, advantage, etc.

According to the PLC program or project requirement, different instructions are needed.

According to different PLC software brands, there are different instructions sets.

Every instruction has input and output.

Input/Output Basics:

In PLC programming, inputs and outputs are very basic terms.

  • Input is shown by two parallel lines- Normally Open (NO) or Normally Closed (NC)
  • Output is shown by Parentheses or round brackets.

This is easily understood by the below diagrams.

Input and Output for plc

PLC Programming Instructions Types and Classifications

Let’s see here, the different types of instructions set which are used for the ladder diagram PLC programming.

1. Basic PLC Programming Instructions

  1. Input (I or X) Instruction
  2. Output (O or Q ) Instruction
  3. Set (S) and Reset (R) Instruction
  4. Latch (L) and Unlatch (U) Instruction

The Set/Reset and Latch/Unlatch instructions are similar to each other. The only difference is- Latch/Unlatch instructions are used for the cyclic process.

2. Time-Based PLC Programming Instructions

The timer instructions follow task or command for/at a particular duration of time.

Sometimes, timers are used for the ON/OFF condition for the PLC.

Here are different timer instructions that fall into this category.

  1. Single Pulse (Monoflop) Timer Instruction
  2. Flashing Timer Instruction
  3. On Delay Timer (TON) Instruction
  4. Off Delay Timer (TOFF) Instruction
  5. Retentive Timer (RTO) Instruction
  6. Pulse Timer (S-Pulse) Instruction
  7. Pulse Extended Timer (S-PEXT) Instruction
  8. On Delay Timer (S-ODT) Instruction
  9. Off Delay Timer (S-OFFDT) Instruction
  10. Extended On Delay Timer (S-ODTS) Instruction
  11. On Delay with Random Time Timer Instruction

In an earlier tutorial, I have already explained the types of timer instructions with an example.

Which PLC brands use which Timer Instructions?

  • On Delay timer, Single Pulse (Monoflop) timer, On Delay with Random Time timer and Flashing timer are used in the ABB PLC.
  • On Delay timer (TON),  Off Delay timer (TOFF) and Retentive timer (RTO) are used in the AB PLC.
  • Pulse timer (S-Pulse), Pulse Extended timer (S-PEXT), On Delay timer (S-ODT), Extended On Delay timer (S-ODTS) and Off Delay timer (S-OFFDT) in the Siemens PLC.

2. Counting-Based PLC Programming Instruction

Counter instructions are used for counting pulse in the PLC program. You can count the pulse or digit by increasing or decreasing.

The classification of different Counter instructions are-

  1. Up Counter (CTU) Instruction
  2. Down Counter (CTD) Instruction
  3. Up-Down Counter Instruction

These three different counters are widely used in AB PLC and Siemens PLC programming.

3. Comparison Based PLC Programming Instruction

These instructions are used to compare inputs.

Here are some of the basic instructions used for comparison.

  1. Greater than (GET) Instruction
  2. Lesser than (LET) Instruction
  3. Equal to (EQU) Instruction
  4. Not Equal to (NEQ) Instruction
  5. Greater than or equal to (GEQ) Instruction
  6. Lesser than or equal to (LEQ) Instruction
  7. Increment and Decrement Instruction
  8. Limit (LIM) Instruction

Most of the instructions are self-explanatory. And you can easily understand their purpose.

4. Mathematical PLC Programming Instruction

These PLC instructions are used to perform different mathematical operations like arithmetic, trigonometric and logarithmic operations.

  1. Addition (ADD) Instruction
  2. Subtraction (SUB) Instruction
  3. Multiplication (MUL) Instruction
  4. Division (DIV) Instruction
  5. Square Root (SQRT) Instruction
  6. Absolute (ABS) Instruction
  7. Sine (SIN) Instruction
  8. Cosine (COS) Instruction
  9. Tangent (TAN) Instruction
  10. Arc Sine (ASN) Instruction
  11. Arc Cosine (ACS) Instruction
  12. Arc Tangent (ATN) Instruction
  13. Natural Log (LN) Instruction
  14. Log to Base 10 (LOG) Instruction

Note: These mathematical instructions, comparative instructions, and counter instructions are used for the counting pulse as per project requirement.

5. Data Transfer Based PLC Programming Instruction

On the basis of programming data transfer, multiple instructions are applicable for multiple purposes.

Here, I am shortlisting the topmost instruction used for data transfer.

  1. Fill File (FLL) Instruction
  2. Move (MOV) Instruction
  3. Copy (COP) Instruction
  4. Jump (JMP) Instruction
  5. Jump Not (JMPN) Instruction
  6. Conditional Jump Instruction
  7. Jump to Subroutine (JSR) Instruction
  8. Subroutine (SBR) Instruction
  9. Return (RST) Instruction
  10. Suspend (SUS) Instruction
  11. Lable (LBL) Instruction
  12. Jump and Lable (JMP & LBL) Instruction
  13. Master Control Set (MCS) instruction
  14. Master Control Reset (MCR) instruction
  15. One-Shot Rising (OSR) Instruction
  16. One-Shot Falling (OSF) Instruction
  17. Convert from Integer to BCD (TOD) Instruction
  18. Convert from BCD to Integer (FRD) Instruction
  19. Temporary End (TND) Instruction
  20. Convert Radians to Degrees (DEG) Instruction
  21. Convert Degrees to Radians (RAD) Instruction

7. Logical or Bitwise PLC Programming Instruction

Many times, we need to perform logical operations on input data. The logical instruction basically depends on the logic gate concept.

  1. Bitwise NOT (NOT) Instruction
  2. Bitwise AND (AND) Instruction
  3. Bitwise OR (OR) Instruction
  4. Bitwise Exclusive OR (XOR) Instruction
  5. Flip-Flop (RS or SR Flip-Flop) Instruction
  6. Positive H Trigger  (P) Instruction
  7. Negative H Trigger (N) Instruction

To understand the logical operations, check logic gates using PLC programming.

8. Sequence-Based PLC Programming Instruction

To implement certain logic, we need to follow a particular sequencing. Here are some of the sequencing operations you can perform using PLC instructions.

  1. Sequencer Input (SQI)
  2. Sequencer Output (SQO)
  3. Bit Shift Left (BSL)
  4. Bit Shift Right (BSR)
  5. Sequencer load (SQL)
  6. Sequencer compare (SQC)

What’s Next?

I have listed the most common, important and widely used instructions for the ladder diagram PLC programming.

For the industrial environment, AB PLC and Siemens PLC software are used. One of the advantages of using these PLC softwares is that they have a lot of instructions set. This makes your job of writing PLC programming logic easy.

I have listed different PLC instructions. If you want to know detail about any instruction, let me know in the comment.

Happy PLC Learning!

15 thoughts on “70+ PLC Programming Instructions | Classification and Types”

Leave a Comment