Programmable Logic Controllers (PLCs) are widely used devices in automation control systems, becoming the core components for controlling and monitoring various processes in the industrial sector. Understanding the basic control instructions in PLC programming is crucial for beginners. This article will provide an introduction to PLC’s basic control instructions to help beginners get started quickly.
I. Common Basic Control Instructions
Output instructions are used to control PLC output modules and send signals to external devices. Common output instructions include:
OTE (Output Energize): Sets the specified output point to a high-level state. For example, OTE Y0 sets output point Y0 to a high-level state.
OTL (Output Latch): Locks the specified output point to a high-level state until a reset instruction is executed. For example, OTL Y1 locks output point Y1 to a high-level state.
OTU (Output Unlatch): Unlocks the specified output point, returning it to a low-level state. For example, OTU Y2 unlocks output point Y2 and returns it to a low-level state.
Input instructions are used to read the status of external devices and pass the results to the PLC’s internal memory. Common input instructions include:
I (Input): Reads the status of the specified input point. For example, I1 reads the status of input point I1.
XIC (Examine If Closed): Becomes true when the specified input point is closed. For example, XIC I2 is true if input point I2 is closed.
XIO (Examine If Open): Becomes true when the specified input point is open. For example, XIO I3 is true if input point I3 is open.
Status Control Instructions:
Status control instructions are used to control the running state of the PLC and the execution sequence of the program. Common status control instructions include:
JMP (Jump): Unconditionally jumps to the specified program address. For example, JMP 100 jumps to program address 100.
LBL (Label): Defines a program address label for use by jump instructions. For example, LBL 100 defines a program address label 100.
END (End): Indicates the end point of the program. For example, END represents the end of the program.
Calculation instructions are used to perform mathematical or logical operations on data. Common calculation instructions include:
ADD (Addition): Adds two numbers and stores the result in the specified destination register. For example, ADD K1 D100 adds the numbers in registers K1 and D100 and stores the result in the destination register.
SUB (Subtraction): Subtracts the second number from the first number and stores the result in the specified destination register. For example, SUB K2 D200 subtracts the number in register K2 from D200 and stores the result in the destination register.
AND (Logical AND): Performs a logical AND operation on two logical values and stores the result in the destination register. For example, AND K3 D300 performs a logical AND operation on registers K3 and D300 and stores the result in the destination register.