-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

PLCs for Beginners
By :

In PLC programming, it is common to have to calculate the area of shapes. A common shape that is often seen in automation is the good ‘ol triangle. For this project, we’re going to set up the necessary variables to calculate the area of a triangle. We’re going to pretend that the our program is going to control a pump that will pump cement into triangular containers that are all the same size.
The first thing we need to establish is what the area of a triangle is. The equation to accomplish this task is as follows:
For this program, we’re going to make two assumptions. We’re going to assume that both the height and the base are whole numbers. We’re also going to assume that the base is 2 and the height is 10.
Breaking down the aforementioned scenario list, we know that the height and the base are both whole numbers, so they can be declared as an integer...