LogixPro PLC Lab Manual for Programmable Logic Controllers
LogixPro PLC Lab Manual for Programmable Logic Controllers
5th Edition
ISBN: 9781259680847
Author: Frank D. Petruzella
Publisher: McGraw-Hill Education
Question
Book Icon
Chapter 11, Problem 1P
Program Plan Intro

Math instruction:

  • Math instructions refer to all output instructions that uses the data of two words or registers and perform the desired function.
  • Math instructions are programmed depending on the type of processor used.
  • The data manipulation instructions are almost similar to math instructions.
  • Math instructions are normally used to perform arithmetic functions on the values stored in memory words or registers.

Math functions:

The basic math functions performed by PLCs are as follows:

  • Addition
    • This function is used to add one piece of data to another.
    • It is also called as ADD.
  • Subtraction
    • This function is used to subtract one piece of data from another.
    • It is also called as SUB.
  • Multiplication
    • This function is used to multiply one piece of data by another.
    • It is also called as MUL.
  • Division
    • This function is used to divide one piece of data from another.
    • It is also called as DIV.

Terms used:

The following terms are used in the instruction.

  • Source A
    • Source A refers to the address of the first piece of data that is used in the instruction.
  • Source B:
    • Source B refers to the address of the second piece of data that is used in the instruction.
  • Destination
    • Destination refers to the address where the results of the instruction are stored.

Given:

  • In the given figure, the instruction ADD is executed to add the values accumulated at “C5:0” and “C5:1” and the result will be stored at the address “N7:1”.
  • The instruction GREATER THAN OR EQUAL (GEQ) is executed to activate the PL1 output.
  • Here, the instruction will become true when the value accumulated at the address “N7:1” is greater than or equal to the constant value “350”.

Explanation of Solution

b.

Status of output PL1:

No”, the output PL1 will not be energized when the accumulated value of counter “C5:0” and “C5:1” is “148” and “36” respectively.

Reason:

  • The accumulated value of counter “C5:0” is “148” and the accumulated value of counter “C5:1” is “36”...

Explanation of Solution

c.

Value of the numbers stored:

Assume that the accumulated value of counter “C5:0” is “250” and the accumulated value of counter “C5:1” is “175”.

(1)

Value stored in “C5:0.ACC”:

Since, the given program stores the accumulated value of counter addressed at “C5:0”, the “C5:0.ACC” contains the value of the number “250”.

(2)

Value stored in “C5:1.ACC”:

Since, the given program stores the accumulated value of counter addressed at “C5:1”, the “C5:1.ACC”contains the value of the number “175”...

Explanation of Solution

d.

Status of output PL1:

Yes”, the output PL1 will get energized when the accumulated value of counter “C5:0” and “C5:1” is “175” and “250” respectively.

Reason:

  • The accumulated value of counter “C5:0” is “250” and the accumulated value of counter “C5:1” is “175”...

Blurred answer
Students have asked these similar questions
Evaluate the following postfix expression and write down the corresponding instructions for a 0-address machine.5 4 + 9 3 / -
What would happen if an instruction was disobeyed, and why would that be the case? In the following scenarios, a TLB that is maintained by software is more efficient than one that is handled by hardware:
Answer the given question with a proper explanation and step-by-step solution. Assuming the following stages: a. fetch instruction b. decode c. fetch operand d. execute and store explain the potential pipeline hazards (if any) in each of the following code segments. a) X = R2 + Y b) R4 = R2 + X
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Text book image
Principles of Information Systems (MindTap Course...
Computer Science
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning