How to use Math Functions in PLC Programming

How to use Math Functions in PLC Programming

In some applications you may need to use assorted math instructions in your PLC program. In the programming environment, in the "basic instructions" section, there is a folder named "math functions". If you open this folder, you'll see a full list of math functions there.

Subscribe Watch Trailer Share
How to use Math Functions in PLC Programming
  • 131. An Introduction to Math Functions - Part 1

    In some applications you may need to use assorted math instructions in your PLC program. In the programming environment, in the "basic instructions" section, there is a folder named "math functions". If you open this folder, you'll see a full list of math functions there. In this and the next les...

  • 132. An Introduction to Math Functions - Part 2

    In this new video you are going to learn how the "negative" and the "absolute value" instructions work.

  • 133. An Introduction to Math Functions - Part 3

    I have 3 other useful instructions or Functions in the math functions folder named MIN, MAX and LIMIT. The names should be self explanatory. The appearance of these functions is different from the other instructions in this folder because they're considered as FCs, and you may be familiar with th...

  • 134. An Introduction to Math Functions - Part 4

    There are some other instructions in the math functions folder which you can use for specific mathematical operations like square SQR or square root SQRT. Let's find out how these actually work.

  • 135. Gas Turbine Temperature Control PLC Program - Part 1

    There are different applications across various industries where you need to measure and control the temperature of different factory sections. In this and then next lessons, you're going to learn how to write a PLC program using the math functions to measure a gas turbine gear box temperature an...

  • 136. Gas Turbine Temperature Control PLC Program - Part 2

    In the previous lesson, you learned that how the small portion of the alarm system for a gas turbine works. As I indicated, in this lesson I'm going to start writing a PLC program that will activate the alarms whenever the temperature measured by each sensor is out of range.

  • 137. Gas Turbine Temperature Control PLC Program - Part 3

    In the previous lesson, I wrote a PLC program for a gas turbine gear box that was able to calculate the sum of the temperatures measured by the RTD sensors and then provide me with the average temperature. In this lesson, I'm going to use this average temperature for writing code for activating t...

  • 138. What Are Decimal, Binary and BCD Numbers?

    In some cases, when you're writing a PLC program, you may need to convert the data type of a variable or a number to a different type. For that, you'll need to use the conversion operations. In the next lessons, you're going to learn how to use these instructions in your PLC program but before th...

  • 139. How to Use Conversion Instructions in your PLC program

    In the previous lesson we quickly reviewed the decimal, binary and BCD numbers. In this lesson you’re going to learn how to use conversion instructions to convert the data type of a variable or a number in your PLC program.

  • 140. Why You're Getting "Invalid BCD" Error?

    In some cases, when you’re using conversion instructions in your PLC program, you’ll face the “invalid BCD” error. In this lesson you’re going to learn what is the cause of this error and how you, as a PLC programmer, can avoid this error.

  • 141. How to avoid "BCD Conversion Error" While Assigning a Variable Time Value to Timers? - Part 1

    In the previous lessons you learned that when you want to use SIMATIC timers in your PLC programs you need to assign the time value as S5TIME format. For instance, if you want this timer here to time for 10 milliseconds, you need to enter S5T#10ms as the time value for the timer. But in some proj...

  • 142. How to avoid "BCD Conversion Error" While Assigning a Variable Time Value to Timers? - Part 2

    In the previous lesson you learned that you can assign a variable, like a memory address, as the time value for the timer instead of fixed amount. But you saw that, in this case, when you enter a value greater than 9, a "BCD conversion error" happens and that causes the CPU to stop working and th...

  • 143. How to Use S7 Counters for Counting Higher than 999? Part 1

    When you're using S7 or SIMATIC counters in your PLC program, one of the things that might be limiting in some projects is that these counters can only count up to 999 and not beyond that. That means, for instance, when you're using an S7 counter to count the number of the products passing on a c...

  • 144. How to Use S7 Counters for Counting Higher than 999? Part 2

    In the previous lesson you learned how you can build a customized counter by combining two counters to extend the amount that an S7 counter is able to count. As I previously explained, the basic idea here is since each of these counters can only count up to 999, I will combine them in a way that ...

  • 145. How to Use S7 Counters for Counting Higher than 999? Part 3

    In the first two parts of this series you learned how you can combine two S7 counters and build a customized counter that is able to count amounts higher than 999. As you saw in the previous lesson I tested the software and everything seemed to work fine but believe it or not, the program has sti...

  • 146. How to Use S7 Counters for Counting Higher than 999? Part 4

    It's clear for me now that the limitation that I have here is because the data type for the instructions are defined as integer so what do you think of changing the data type for the multiply instruction to double integer or long integer?