Level Application

Now that we've seen how registers work, let's process a program like plc's do to enhance our understanding of how the program gets scanned.

Let's consider the following application:
We are controlling lubricating oil being dispensed from a tank. This is possible by using two sensors.We put one near the bottom and one near the top, as shown in the picture below.

Here, we want the fill motor to pump lubricating oil into the tank until the high level sensor turns on. At that point we want to turn off the motor until the level falls below the low level sensor. Then we should turn on the fill motor and repeat the process.
Here we have a need for 3 I/O(i.e. Inputs/Outputs). 2 are inputs(the sensors) and 1 is an output(the fill motor). Both of our inputs will be NC(normally closed) fiber-optic level sensors. When they are NOT immersed in liquid they will be ON. When they are immersed in liquid they will be OFF.

We will give each input and output device an address. This lets the plc know where they are physically connected. The addresses are shown in the following tables:

INPUTS ADDRESS OUTPUT ADDRESS INTERNAL UTILITY RELAY
Low 0000 Motor 0500 1000
High 0001

Here is what the ladder diagram will actually look like. Notice that we are using an internal utility relay in this example. You can use the contacts of these relays as many times as required. Here they are used twice to simulate a relay with 2 sets of contacts. Remember, these relays DO NOT physically exist in the plc but rather they are bits in a register that you can use to SIMULATE a relay.