PLC Unit-IV PLC Functions
PLC Unit-IV PLC Functions
Contents of Unit-IV
PLC Functions ❖ Data Handling Functions
❖Timer functions and Industrial and Applications
applications ➢ SKIP
➢ MCR
❖Counter functions and Industrial
➢ JUMP
applications
➢ MOVE
❖Arithmetic functions
➢ FIFO
❖Number comparison functions ➢ FAL
❖Number conversion functions ➢ ONS
➢ CLR
➢ SWEEP
PLC Timer Functions
➢ The most commonly used process control device after coils and contacts is the timer.
➢ The most common timing function is TIME DELAY-ON, which is the basic function.
➢ There are operational disadvantages of the single-input type timer that are overcome by the
multiple-input timer.
PLC Timer Parameters
Timer ON Delay
Timer OFF Delay
Retentive Timer ON
PLC Timer Functions
PLC Timer Functions
PLC Timer Functions
PLC Timer Functions
Arithmetic Instructions in PLC Programming
• The PLC arithmetic functions consist of many instructions like
Comparison, Mathematical, Logarithmic, etc.
• List of PLC Comparison instructions:
▪ Equal: CMP ==
▪ Not Equal: CMP <>
▪ Greater Than: CMP >
▪ Less Than: CMP <
▪ Greater Than or Equal: CMP >=
▪ Less Than or Equal: CMP <=
Arithmetic Instructions in PLC Programming
Equal: CMP == Tests whether two values are equal. If values are equal then this instruction is logically true.
Not Equal: CMP <> Tests whether two values are not equal. If values are not equal then this instruction is
logically true.
Greater Than: CMP > Compares two values, If the value of IN0 is greater than the value of IN1 then this
instruction is logically true.
Less Than: CMP < Compares two values, If the value of IN0 is less than the value of IN1 then this instruction
is logically true.
Greater Than or Equal: CMP >= Compares two values, If the value of IN0 is greater than or equal to the
value of IN1 then this instruction is logically true.
Less Than or Equal: CMP <= Compares two values, If the value of IN0 is less than or equal to the value of
IN1 then this instruction is logically true.
Let’s take a simple example of giving an alarm indication to the operator when the temperature of the furnace
reaches above 850-degree centigrade.
Return Fraction: MOD Divides the value of IN1 from IN0 and stores the remainder value in the OUT.
Note: The input and output values must be the Integer value in the MOD instruction.
List of Arithmetic Instructions in PLC
Absolute: ABS Returns the absolute value of IN in the OUT.
Square Root: SQRT Returns the square root value of IN in the OUT.
Square: SQR Returns the square value of IN in the OUT.
Exponential: EXP Returns the exponential value of IN to the base e in the OUT.
Natural Logarithm: LN Returns the natural logarithm value of IN in the OUT.
Sine Value: SIN Returns the sine value of IN in the OUT.
Cosine Value: COS Returns the cosine value of IN in the OUT.
Tangent Value: TAN Returns the tangent value of IN in the OUT.
Arc Sine Value: ASIN Returns the arcsine value of IN in the OUT.
Arc Cosine Value: ACOS Returns the arc cosine value of IN in the OUT.
Arc Tangent Value: ATAN Returns the arctangent value of IN in the OUT.
The input and output values must be a Floating Point value in EXP, LN, SIN, COS, TAN, ASIN, ACOS, and
ATAN instructions.
Example of Flow Calculation
For a better understanding of these arithmetic instructions in plc programming, let’s take an example. Find the flow by the formula
given below,
➢For FAL function, specify the number of times the calculations should run (length)
and where the calculation process should start in a stack of data values.
➢The FAL function is essentially a multiple, sequential CPT function which saves
programming time and program space.
PLC FAL FUNCTION