Math instructions are used to perform mathematical calculations. The Productivity 1000 Series PLC has math instructions that can be used in a wide variety of applications. We will be looking at the Data Statistics (DATA) and the Math Editor (MATH).
The automation system that you implement may involve these instructions. As a system integrator, you will require the use of these instructions in your commissioned programs.
Let’s get started with the Productivity 1000 Series PLC Math Instructions.
Previously in this Productivity 1000 series PLC, we have discussed:
System Hardware – Video
Installing the Software – Video
Establishing Communication – Video
First Program – Video
Documenting the Program – Video
Monitoring and Testing the Program – Video
Online Editing and Debug Mode – Video
Numbering Systems and Tag Database – Video
Contact and Coil Instructions – Video
Timer Instructions – Video
Counter Instructions – 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 is 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 random numbers to our DS1 to DS6 tags.
Switch1 will enable our first Data Statistics instruction. This will be used to sum (add) the numbers together. Copy and pasting is 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.
Switch4 will find the average value of the tags DS2 to DS6.
Each time the rung 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, 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:
Our example will take a temperature reading in degrees Celsius and convert this to degrees Fahrenheit.
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.
Hit OK once your math formula has been entered.
You can now change the tags that have been entered in the math instruction. We will make CDegree memory retentive with an initial value of 30.
Our math instruction is active when Switch5 turns on.
Download the PLC program here.
Watch the video below to see the math instructions used in our Productivity 1000 Series PLC.
Productivity 1000 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 Programming Software (Free Download Link)
This software contains all of the instruction sets and help files for the Productivity Series.
Next time we will look at data handling instructions in the Productivity 1000 Series PLC.
Watch on YouTube : Productivity 1000 Series PLC Math Instructions
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 PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.
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 as a free download. The link is included when you subscribe to ACC Automation.