Type Here to Get Search Results !

How to use Arithmetic Functions with Counter in Fatek PLC Winproladder

There are so many functions in Fatek PLC programming and these are some basic and very important functions that we are learning here. There is another function, which is known as Arithmetic function, that we use in Fatek PLC programming and this is very easy to use in WinProladder software.





In this arithmetic function, we use different components such as addition, subtraction, multiplication, division etc.. etc. of two of more values. We can add two or more than two values of timers, counters and data registers, as well as can use other components (subtraction, multiplication, division etc. here) with counters, timers, data registers and other input values as well.



How to Add Two Values in Fatek PLC WinProladder Software


Let's start using Addition Function in WinProladder. To add two or more values, we must have two or more values input in our PLC program. For learning this function, I am taking two timers, T200 and T201 as a sample as shown below.




This is an example program I have made in WinProladder. In this program, there are total two input I have used which are “X0 and X1”. The “X0” will switch ON the output “Y0” and this output “Y0” will on both timers. For switching it OFF, I will use “X1” normally open contact as a “Stop push button”. Now, I am going to use addition function to add the current values of both timers. The added values will be shown in a separate data register “D1”. Below is a picture of complete program without simulation.

When you will click on [F] icon from the icon tray, a pop-up with a lot of functions will open as shown below. You have to select (+) from arithmetic function, or you can directly select this addition function by searching "(+)" and click on "OK".



When you will click on "OK, a small pop-up box will appear on your screen and will ask you which two values you want to add and in which data register you want to show the added value. Write first timer's value in "Sa" and second's on "Sb" and in the third box, write "D1 as data register  number 1. Please see this filled box below for help.




For your help and better understanding of how to use addition function in your Fatek PLC program, please watch this animated GIF video below.



Its time to check this addition function that we have added in Fatek PLC program. Let's start simulation.






As you can see above, this addition function is adding both timer’s current values and give me the sum of both in “D1” data register. Now there are some outputs we can get, these are additional functions of arithmetic function in Fatek PLC programming software, WinProladder software. Performs the addition of the data specified at Sa and Sb and writes the results to a specified register D when the add control input "EN" =1 or from 0 to 1(P instruction). If the result of addition is equal to 0 then set FO0 to 1. If carry occurs (the result exceeds 32767 or 2147483647) then set FO1 to 1. If borrow occurs (adding negative numbers resulting in a sum less than -32768 or -2147483648), then set the FO2 to 1. All the FO statuses are retained until this instruction is executed again and overwritten by a new result.



How To Subtract Two Values In Fatek PLC Winproladder Software


Now, this is same procedure for subtraction, division and multiplication in arithmetic functions in WinProladder software. 




  1. Sa: Minuend.
  2. Sb: Subtrahend.
  3. D: Destination register to store the results of the subtraction.
  4. Sa, Sb, D may combine with V, Z, P0~P9 to serve indirect addressing.


Performs the subtraction of the data specified at Sa and Sb and writes the results to a specified register D when the subtract control input "EN" =1 or from 0 to 1( P instruction) . If the result of subtraction is equal to 0 then set FO0 to 1. If carry occurs (subtracting a negative number from a positive number and the result exceeds 32767 or 2147483647), then set FO1 to 1. If borrow occurs (subtracting a positive number from a negative number and the resulted difference is less than -32768 or -2147483648), then set FO2 to 1. All the FO statuses are retained until this instruction is executed again and overwritten by a new result.




How To Divide Two Values In Fatek PLC Winproladder Software





Description and block details of division function are below.
  1. Sa: Dividend
  2. Sb: Divisor
  3. D:Destination register to store the results of the division.
  4. Sa, Sb, D may combine with V, Z, P0~P9 to serve indirect addressing.



Performs the division of the data specified at Sa and Sb and writes the quotient and remainder to registers specified by register D when the division control input "EN" =1 or from 0 to 1 ( P instruction) . If the quotient of division is equal to 0 then set FO0 to 1. If the divisor Sb=0 then set the error flag FO1 to 1 without executing the instruction.



How To Multiply Two Values In Fatek PLC Winproladder Software


Now, How To Multiply Two Values In Fatek PLC Winproladder Software. The details are below.




  1. Sa: Multiplicand
  2. Sb: Multiplier.
  3. D: Destination register to store the results of the multiplication.
  4. Sa, Sb, D may combine with V, Z, P0~P9 to serve indirect addressing.

Performs the multiplication of the data specified at Sa and Sb and writes the results to a specified register D when the multiplication control input "EN" =1 or from 0 to 1( P instruction) . If the product of multiplication is equal to 0 then set FO0 to 1. If the product is a negative number, then set FO1 to 1.

Post a Comment

0 Comments