PLCs

Math for PLCs 320

This class covers common mathematical functions for PLCs as well as the integer and decimal values and numeric codes involved in PLC math calculations.

  • Difficulty Advanced

  • Format Online

  • Number of Lessons 16

  • Language English

TO GET STARTED SPEAK WITH A SPECIALIST AT 1.866.706.8665

Or fill out this form and a specialist will contact you shortly

Course Outline
  • Objectives
  • Math Instructions for PLCs
  • The Parts of a Mathematical Equation
  • Mathematical Operators and the Order of Operations
  • Integers and Floating Decimals
  • PLC Numbering Systems
  • PLC Number Codes
  • Negative Values in Binary Numbers
  • Add and Subtract Functions
  • Multiply and Divide Functions
  • Power and Square Root Functions
  • Equal and Not Equal Comparison Instructions
  • Greater Than and Less Than Comparison Instructions
  • The Compute Function
  • Additional Math Instructions for PLCs
  • Summary
Objectives
  • Describe math instructions for PLCs
  • Describe the parts of a mathematical equation.
  • Describe mathematical operators and the order of operations in math equations.
  • Distinguish between integers and floating decimals.
  • Distinguish between different PLC numbering systems.
  • Distinguish between different PLC number codes.
  • Describe how negative numbers are represented in binary.
  • Describe add and subtract functions in PLCs.
  • Describe multiply and divide functions in PLCs.
  • Describe power and square root functions in PLCs.
  • Describe equal and not equal comparison instructions in PLCs.
  • Describe greater than and less than comparison instructions in PLCs.
  • Describe the compute function in PLCs.
  • Describe additional math instructions in PLCs.
Glossary
Vocabulary Term
Definition

2s complement

The most common method of representing negative binary numbers. If a signed bit contains a 1, all the binary digits are complemented, or reversed, and 1 is added to the number.

absolute value

A number's distance from zero on the number line. The absolute value of -3 is 3, and the absolute value of +3 is 3.

add function

A mathematical operation in a PLC program that adds the value of Source A to the value of Source B and stores the result in a destination address.

addition

A mathematical operation that unites two separate quantities into one sum. 2 + 2 = 4 is an example of addition.

address

A name or label such as "N7:21" for a specific word in a PLC data file. Values are stored in addresses.

alphanumeric

Containing letters and numbers.

ASCII

American Standard Code for Information Interchange. ASCII was primarily used to input alphanumeric, punctuation, and control PLC characters, but has been replaced by PC keyboards.

base 10

The most commonly used number system in everyday life, also known sa the decimal system. The base 10 system uses ten digits, 0-9.

base 2

The most commonly used number system in PLCs and other computer systems, also known as the binary system. The base 2 system has only 2 digits, 0 and 1.

binary

A numbering system that uses two digits, 0 and 1, arranged in a series of columns to represent all numerical quantities. PLCs must convert integers and floating point decimal numbers to binary numbers to perform mathematical calculations.

binary coded decimal

A binary number system in which each decimal digit from 0 to 9 is represented by four binary digits (bits). The four positions have a weighted value of 1, 2, 4, and 8, ranging from right to left.

calculation

A mathematical operation that is applied to a process. When you subtract 50 cents from a dollar to make change, you are performing a calculation.

clear instruction

A mathematical function in a PLC program that sets the destination value to zero. Also called CLR.

code

Any system that uses digits or symbols to represent information other than simple numerical quantities. Certain code systems are used to allow a PLC to process information more efficiently or with greater accuracy.

complement

To reverse binary digits, with all 1s becoming 0s and all 0s becoming 1s. Complementing is a way to represent negative binary numbers.

compute function

A mathematical function in a PLC program that streamlines a ladder program by allowing the programmer to combine multiple operations into a single function.

constant

A value or number that does not change.

cosine

In a right triangle, the ratio of the side adjacent the angle and the hypotenuse of the triangle.

CPU

The main processor of information in a PLC that performs all logic and math operations.

data

Any type of information gathered about an application or process. Data is often in the form of values or numbers.

destination

The address in which the result of a mathematical operation is stored.

divide function

A mathematical operation in a PLC program that divides the value of Source A by the value of Source B and stores the result in a destination address.

division

A mathematical operation that indicates how many equal quantities add up to a specific number. 8 / 4 = 2 is an example of division.

equal function

A comparison instruction that tells the PLC to activate an output if the two values are equal to each other. When A=B, the rung goes true, but if A≠B, the rung is false.

equal to

A mathematical operation that compares two different values to test if they are equal to each other. 100 is equal to 100.

exponent

Another term for a power. The exponent is the smaller number above and to the right of the number being multiplied by itself.

exponent function

A mathematical operation in a PLC program that raises the value of Source A to the power in Source B and stores the result in a destination address. Also called X to the Power of Y or XPY.

floating decimal

A value that is less than a whole. The decimal is considered to "float" because, regarding any values among an infinite range of possibilities, the decimal can occupy any number of positions relative to the digits on the right.

greater than

A mathematical operation that compares two different values to test if one is greater than the other. 4 is greater than 3.

greater than function

A comparison function that tells the PLC to activate an output if the value of Source A is greater than the value of Source B.

greater than or equal to

A comparison function that tests whether the value of B is greater than or equal to the value of A. 100 is greater than 99, but greater than or equal to 100.

grouping symbols

Mathematical symbols indicating that operations contained within the symbols must be solved before moving on to other operations. Parentheses ( ) are the most commonly used grouping symbols.

hexadecimal system

A numbering system that uses 16 digits, 0 to 9 and A to F, arranged in a series of columns to represent all numerical quantities. Each column or place value has a weighted value of 1, 16, 256, 4096, and so on, ranging from right to left.

integer

A whole number or its negative equivalent. The numbers -3, -2, -1, 0, 1, 2, and 3 are all integers.

less than

A mathematical operation that compares two different values to test if one is less than the other. 3 is less than 4.

less than function

A comparison function that tells the PLC to activate an output if the value of Source A is less than the value of Source B.

less than or equal to

A comparison function that tests whether the value of B is less than or equal to the value of A. 3 is less than 4, but less than or equal to 3.

math instruction

An equation or calculation such as addition, subtraction, multiplication, or division programmed into a PLC.

mathematical function

A sequence of steps or operations in a mathematical equation.

multiplication

A mathematical operation that indicates how many times a number is added to itself. 2 x 4 = 8 is an example of multiplication.

multiply function

A mathematical operation in a PLC program that multiplies the value of Source A by the value of Source B and stores the result in a destination address.

negate instruction

A mathematical function in a PLC program that changes the sign of the source value from positive to negative.

negative number

A number representing a value less than zero. Decimals use a minus sign ( - ) to indicate negative values, but binary numbers must use 2s complement.

not equal function

A comparison instruction that tells the PLC to activate an output if the two values are equal to each other. When A≠B, the rung goes true, but if A=B, the rung is false.

octal system

A numbering system that uses eight digits, 0 to 7, arranged in a series of columns to represent all numerical quantities. Each column or place value has a weighted value of 1, 8, 64, 512, and so on, ranging from right to left.

operator

A code or a symbol that represents a mathematical function. The plus sign (+) is an operator for addition.

order of operations

A set of mathematical rules that dictates the sequence in which operations must be performed.

parameter

A value or quantity that is not an independent variable.

parentheses

Grouping symbols used to change the order of operations in a math equation.

power

A mathematical operation indicating how many times a number is multiplied by itself. 2 cubed or 2x2x2 = 8 is an example of a power.

register

A data file in a PLC that stores bit files.

repeating decimal

A decimal in which one or more digits repeat endlessly. The decimal value of 1/3 is the repeating decimal 2.66666.

root

A mathematical operation indicating which unknown number, multiplied by itself a specific number of times, equals the number included inside the root sign. For example, the square root of 81 equals 9.

signed bit

The most significant bit of a binary number that is used to indicate whether the number is positive or negative. The signed bit must be located in one place value beyond the standard set of digits.

sine

In a right triangle, the ratio of the side opposite an angle and the hypotenuse of the triangle.

slope

The measurement of the steepness of a vertical line.

source

The address of the value in the mathematical equation.

square root

A mathematical function that tells you which unknown number is multiplied by itself one time. The square root of 49 is 7.

square root function

A mathematical operation in a PLC program that calculates the square root of a value.

subtract function

A mathematical operation in a PLC program that subtracts the value of Source B from the value of Source A and stores the result in a destination address.

subtraction

A mathematical operation that takes away a quantity from a larger whole. 4 minus 2 = 2 is an example of subtraction.

tangent

In a right triangle, the ratio of the sides opposite and adjacent to the angle in question.

trigonometric equation

An equation based on the measurements and ratios of a right triangle.

value

A type of data that usually takes the form of a number. The level of voltage can be a value, or the quantity of parts can be a value.

variable

A changing value, or an unknown value.

word

A defined and specific number of digits grouped together. For most PLCs, a word consists of 16 digits.

x to the power of y

A mathematical operation in a PLC program that raises the value of Source A to the power in Source B and stores the result in a destination address. Also called the exponent function.