7. Elementary Arithmetic Operations Design Examples Program Description: z The floating point operation is usually applied to perform decimal calculation. However, it needs to be converted and is more complicated. Therefore, we use elementary arithmetic operation instructions to perform decimal calculation in this example. z The units of mm , cm and dm are used in the program. For calculation requirement, the program sets these units into mm 3 and then converts them into cm 3 . z π (π≈3.14) is required when calculating the cross-sectional area of the pipe.
In order to get the calculation accuracy of 2 decimal places, the program increases π 100 times to be K314 instead of increasing the unit dm/s 100 times to be mm/s . z In the end, the program divides the value in D20 (unit: mm 3 /s) with 1000 so as to convert the unit into cm 3 /s . (1 cm 3 = 1 ml, 1 l = 1000 ml = 1000 cm 3 = 1 dm 3 ) z . Assume the pipe diameter D0 is 10 mm and the flow rate D10 is 25 dm/s , the operation result of the total flow will be 196 cm 3 /s. 7-2 DVP-PLC Application Examples