What does the ADD instruction do in PLC programming?
The ADD instruction adds two numbers together and stores the result in a specified location.
Click to reveal answer
beginner
How does the SUB instruction work in PLC programming?
The SUB instruction subtracts one number from another and saves the result in a target location.
Click to reveal answer
beginner
Explain the MUL instruction in PLC programming.
The MUL instruction multiplies two numbers and stores the product in a specified memory location.
Click to reveal answer
beginner
What is the purpose of the DIV instruction in PLC programming?
The DIV instruction divides one number by another and stores the quotient in a target location. It is important to avoid dividing by zero.
Click to reveal answer
intermediate
Why should you be careful when using the DIV instruction?
Because dividing by zero causes errors or unexpected results in the program. Always check the divisor before dividing.
Click to reveal answer
What does the ADD instruction do in PLC programming?
ADivides two numbers
BSubtracts two numbers
CMultiplies two numbers
DAdds two numbers and stores the result
✗ Incorrect
ADD adds two numbers and saves the result.
Which instruction subtracts one number from another?
AMUL
BSUB
CADD
DDIV
✗ Incorrect
SUB subtracts one number from another.
What should you avoid when using the DIV instruction?
AMultiplying numbers
BAdding numbers
CDividing by zero
DSubtracting numbers
✗ Incorrect
Dividing by zero causes errors.
Which instruction multiplies two numbers?
AMUL
BSUB
CADD
DDIV
✗ Incorrect
MUL multiplies two numbers.
Where is the result stored after a math instruction?
AIn a specified memory location
BNowhere, it is printed only
CIn the input device
DIn the output device only
✗ Incorrect
Results are stored in specified memory locations.
Describe how the ADD, SUB, MUL, and DIV instructions work in PLC programming.
Think about simple math operations and where results go.
You got /6 concepts.
Explain why it is important to check the divisor before using the DIV instruction.
Consider what happens if you divide by zero in real life.
You got /3 concepts.
Practice
(1/5)
1. What does the ADD instruction do in PLC programming?
easy
A. It multiplies two numbers.
B. It subtracts one number from another.
C. It adds two numbers and stores the result.
D. It divides one number by another.
Solution
Step 1: Understand the ADD instruction
The ADD instruction takes two input values and calculates their sum.
Step 2: Identify the result storage
The result of the addition is stored in a destination variable or register.
Final Answer:
It adds two numbers and stores the result. -> Option C
Quick Check:
ADD = sum [OK]
Hint: ADD means sum two values and save result [OK]
Common Mistakes:
Confusing ADD with SUB
Thinking ADD multiplies
Assuming ADD divides
2. Which of the following is the correct syntax for a SUB instruction in PLC?
easy
A. SUB source1, source2, destination
B. SUB destination, source1, source2
C. SUB source1; source2; destination
D. SUB(source1, source2, destination)
Solution
Step 1: Recall the standard syntax format
The SUB instruction syntax is: SUB source1, source2, destination.
Step 2: Match options with syntax
SUB source1, source2, destination matches the correct order and separators (commas).
Final Answer:
SUB source1, source2, destination -> Option A
Quick Check:
SUB syntax uses commas and order: source1, source2, destination [OK]
Hint: Syntax uses commas: SUB source1, source2, destination [OK]
Common Mistakes:
Swapping destination and sources
Using semicolons instead of commas
Adding parentheses incorrectly
3. Given the following PLC instructions:
ADD 5, 3, D1
MUL D1, 2, D2
SUB D2, 4, D3
DIV D3, 2, D4
What is the final value stored in D4?
medium
A. 4
B. 6
C. 2
D. 1
Solution
Step 1: Calculate ADD and MUL results
ADD 5 + 3 = 8 stored in D1; MUL 8 * 2 = 16 stored in D2.
Step 2: Calculate SUB and DIV results
SUB 16 - 4 = 12 stored in D3; DIV 12 / 2 = 6 stored in D4.
Final Answer:
6 -> Option B
Quick Check:
5+3=8, 8*2=16, 16-4=12, 12/2=6 [OK]
Hint: Calculate step-by-step and store intermediate results [OK]
Common Mistakes:
Mixing order of operations
Forgetting to store intermediate results
Dividing before subtracting
4. Identify the error in this PLC math instruction:
DIV 10, 0, D1
medium
A. Incorrect syntax for DIV instruction.
B. Operands must be swapped.
C. Destination variable missing.
D. Division by zero error.
Solution
Step 1: Analyze the DIV instruction inputs
The instruction tries to divide 10 by 0, which is mathematically undefined.
Step 2: Understand PLC behavior on division by zero
Most PLCs will raise an error or fault when dividing by zero.
Final Answer:
Division by zero error. -> Option D
Quick Check:
DIV by zero causes error [OK]
Hint: Never divide by zero in PLC math instructions [OK]
Common Mistakes:
Ignoring zero divisor
Assuming syntax error instead
Swapping operands incorrectly
5. You want to calculate the average of three sensor readings stored in S1, S2, and S3 using PLC math instructions. Which sequence correctly computes the average and stores it in AVG?
hard
A. ADD S1, S2, T1
ADD T1, S3, T2
DIV T2, 3, AVG
B. ADD S1, S2, T1
DIV T1, 3, T2
ADD T2, S3, AVG
C. DIV S1, 3, T1
DIV S2, 3, T2
DIV S3, 3, T3
ADD T1, T2, T4
ADD T4, T3, AVG
D. SUB S1, S2, T1
ADD T1, S3, T2
DIV T2, 3, AVG
Solution
Step 1: Sum the three sensor readings
First ADD S1 and S2 into T1, then ADD T1 and S3 into T2 to get total sum.
Step 2: Divide the total sum by 3
Use DIV to divide T2 by 3 and store the result in AVG, which gives the average.
Final Answer:
ADD S1, S2, T1
ADD T1, S3, T2
DIV T2, 3, AVG -> Option A
Quick Check:
Sum all then divide by count = average [OK]
Hint: Sum all values first, then divide by count [OK]
Common Mistakes:
Dividing before summing
Using SUB instead of ADD
Adding after dividing only two values
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.