Math instructions perform mathematical calculations. The Productivity 2000 Series PLC has math instructions that you can use in various applications. We will look at the Data Statistics (DATA) and the Math Editor (MATH).

We will demonstrate both of these instructions using the examples in the help file. An average wind speed will be calculated using the data instruction based on six different inputs. Converting Celsius to Fahrenheit degrees will be done with the math instruction for an oven temperature. The automation system that you implement may involve these instructions. You will require using these instructions in your commissioned programs as a system integrator.

Let’s get started with the Productivity 2000 Series PLC Math Instructions.

**Previously in this Productivity 2000 series PLC, we have discussed the following:**

P2000 Hardware Features – Video

Productivity Suite Software Install – Video

Communication (System Configuration) – Video

First Program – Video

Debug Mode – Video

PLC Program Documentation – Video

PLC CPU Display – Video

PLC Online Programming – Video

PLC Tag Database – Video

Ladder Logic Contacts – Video

Ladder Logic Outputs – Video

Timers – Video

Counter – Video

##### Data Statistics (DATA) Instruction – Productivity Math

This instruction is used to find a mathematical statistic for up to 16 tags or constants. We can select one of the following: Sum, Min, Max, Average, Median, or Standard Deviation.

The instruction has an Input and Output section. This is where we input our tags. A radio button selection is at the bottom of the instruction to select what operation you would like to use.

DS1 to DS6 are placed in the input tags. If you do not know the tag reference, you can create a name for it. The Output tag will be called DS_Output.

Hit OK.

The tags used but not previously assigned will now be displayed. We will set DS1 to DS6 as memory retentive tags. (Memory is retained after a power interruption or switching from run to program mode.) We will assign numbers to our DS1 to DS6 tags. The tag database can also be used to assign numbers and memory retention.

Switch1 will enable our first Data Statistics instruction. This will be used to sum (add) the numbers together. Copy and pasting are used to then copy the first rung three more times. Make the following changes:

Switch2 will find the minimum value of the tags DS2 to DS6.

Switch3 will find the maximum value of the tags DS2 to DS6.

Our application for the average wind speed will be calculated using switch 4.

Switch4 will find the average value of the tags DS2 to DS6.

Each time the rung with the data statistics is copied, the switch number is changed, and the radio button at the bottom of the instruction is used to select the operation required.

##### Math Editor (MATH) Instruction – Productivity

The math editor will perform common math computations using tags and constants.

Here is a list of the operations that are available:

Arithmetic Operations: Add, Subtract, Multiply, Divide, Modulo, and Raise to a Power and Absolute Value.

Real Functions: Natural Log, PI, Square Root, Invert, Log Base 10

Trigonometric Functions: Sine, Cosine, Tangent, Arcsine, Arccosine, Arctangent

Radian Trigonometric Functions:

All of these functions are available to you through the math editor.

Our example will take a temperature reading in degrees Celsius (271) and convert this to degrees Fahrenheit. (520)

The formula we will be using is CDegree * 1.8 + 32.

**Note:** The tag name is entered by selecting the Tag Entry Mode button or by selecting the tag name and hitting the Insert button.

Tag names are highlighted in red. Formula entries are in black. Order of operation is effective for the formula.

Switch 5 will perform our math instruction and convert our temperature.

Watch the video below to see the math instructions used in our Productivity 2000 Series PLC.

Download the P2000 PLC math sample program here.

**Productivity 2000 Series PLC from Automation Direct
**Overview Link (Additional Information on the Unit)

Configuration (Configure and purchase a system – BOM)

User Manual and Inserts (Installation and Setup Guides)

Productivity Suite Overview (Features of the fully functional free software package for the Productivity Family of PLC (PAC) controllers)

Productivity Suite Programming Software (Free Download Link)

This software contains all the instructions and helps files for the Productivity Series.

**Watch on YouTube:** Productivity 2000 PLC Ladder Logic Math

If you have any questions or need further information, please contact me.

Thank you,

Garry

If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLCs are not challenging to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, decimals, Hexadecimal, ASCII, and Floating points.

To get this free article, subscribe to my free email newsletter.

Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available for free download. The link is included when you **subscribe to ACC Automation**.