BRX Do-More Communication Do-More EasyPLC Machine Simulator Modbus TCP PLC PLC Basics PLC Learning

PLC Programming Mixing Tank – EasyPLC / Do-More

Previously we looked at the easy PLC machine editor design simulation. We created a mixing tank simulation using the EasyPLC machine editor. The tank included a control panel and operation indication.EasyPLC Machine Editor - Design a Simulation We will now use the Do-More designer programming software to program the ladder logic for this EasyPLC mixing tank application. The built-in simulator of the Do-More Designer programming software will be used to actually run the program and control our EasyPLC mixing tank machine. Development of this program will be done using the five steps for PLC programming. Let’s get started!

Learn PLC programming the easy way. See below how to receive a 10% discount on this already cost-effective learning tool. Invest in yourself today.
Previously we have done the following:
Easy PLC Installing the SoftwareVideo
EasyPLC Software Suite – Quick StartVideo
Click PLC – Easy Transfer Line ProgrammingVideo
Productivity PLC Simulator – Chain Conveyor MSVideo
Do-More PLC – EasyPLC Box Selection ProgramVideo
Click PLC EasyPLC Gantry SimulatorVideo
Click PLC Simple Conveyor EasyPLCVideo
EasyPLC Paint Line Bit Shift – BRX Do-More PLCVideo
Click PLC – EasyPLC PLC Mixer ProgrammingVideo
Click PLC EasyPLC Warehouse Stacker ExampleVideo
–  Operation Video
EasyPLC Machine Simulator Productivity PLC Robotic CellVideo
EasyPLC Simulator Robotic Cell Click PLCVideo
EasyPLC Simulator Robotic Cell BRX Do-More PLCVideo
EasyPLC Factory Editor Robotic Cell Additions Video
4 Way Traffic Light PLC Program EasyPLCVideo
Rock Crusher Plant EasyPLC BRX Do-MoreVideo
Freight Carrier Weighing and Distribution EasyPLCVideo
EasyPLC Machining Center Loading RobotsVideo
EasyPLC Palletizing Robot Programming Click PLCVideo
EasyPLC Machine Editor – Design a SimulationVideo

Define the task: (Step 1 – PLC Programming Mixing Tank)

The first step of PLC program development is to define the task to determine what must be done.
EasyPLC software suite contains over 40 machine simulator examples. You can use these to improve your PLC programming skills. Previously we created a mixing tank with a control panel and indication light.
Start the EasyPLC machine simulator. Select start on the home screen or select machines from the main menu. This will list all of the available machines for you to program.
EasyPLC Machine Editor - Design a SimulationScroll down until you see the mixing tank that we made previously.
Highlight this with your mouse and select start.
PLC Programming - Mixing TankThis will load our mixing tank simulation.
PLC Programming - Mixing TankPLC Programming - Mixing TankThe control panel will control the mixing tank operation. Selecting start will start the mixing tank cycle. This will fill the tank, delay 20 seconds, then empty the tank. The stop or emergency stop buttons will stop the cycle. The start button will be used to continue the cycle.
Icons on the top right-hand side of the window will allow you to move around this 3D environment. Once we have a good understanding of what must be done, we can now move on to the next step in our PLC program development.

Define the Inputs and Outputs: (Step 2 – PLC Programming Mixing Tank)

The View IO at the bottom of the machine simulator window will display the inputs and outputs required for this mixing tank example.
PLC Programming - Mixing TankThe EasyPLC mixing tank example will require 5 digital outputs and 3 digital inputs. Select the Analog outputs and inputs.
PLC Programming - Mixing TankWe will use the tank level analog to determine the height of the liquid in the tank.
The EasyPLC start mode will allow you to manually control the mixing tank simulator. This is ideal if you are unsure as to what output or input is doing.
PLC Programming - Mixing TankWhile viewing the IO on the bottom middle of the machine simulator window. You can manually run the mixing tank without any control or PLC connection. Select the digital outputs that you want to enable. The digital inputs will respond to these outputs.
PLC Programming - Mixing TankSelect the analog inputs on the right-hand side, to watch the level of the liquid in the tank.
Move around the 3D environment and ensure that you know what each input and output represents.

The following table will define the inputs and outputs (IO) and Modbus addresses in the Do-More PLC that we will be using for this program.

Digital Type Description Do-More PLC Modbus Address Machine Simulator Modbus Address
PLC Output – MS Input Start PB Light MI1 – 10001 0
PLC Output – MS Input Stop PB Light MI2 – 10002 1
PLC Output – MS Input Run LED Light MI3 – 10003 2
PLC Output – MS Input Tank Open Input MI4 – 10004 3
PLC Output – MS Input Tank Open Output MI5 – 10005 4
PLC Input – MS Output PB Start MC1 – 1 0
PLC Input – MS Output PB Stop MC2 – 2 1
PLC Input – MS Output PB Emergency Stop MC3 – 3 2
PLC Analog Input – MS Analog Output Tank Level XXXX.X MHR11 – 11 10

Note: The machine simulator will be offset by one on the Modbus Addresses. See the video below for the demo mode and determining inputs and outputs.

Develop a logical sequence of operation: (Step 3 – PLC Programming Mixing Tank)

A PLC programmer must know how everything about the sequence and operation of the machine before programming. The mixing tank is an excellent way to learn to program. A flow chart, sequence table, or logical sequence is used to fully understand the process that needs to be controlled. It must also answer questions like the following:

What happens when electrical power and/or pneumatic air is lost? What happens when the input/output devices fail? Do we need redundancy?

This step is where you will spend most of your time. Understanding everything about the operation will save you time. It will help prevent you from continuously re-writing the PLC program logic. Knowing all these answers to how the system is to react is vital in the development of the PLC program.
Our EasyPLC mixing tank machine has very few inputs and outputs. We will walk through the logical sequence of operation.
PLC Programming - Mixing TankThe emergency stop must be present in order for the lights to function. This is wired normally closed so that the input is active if everything is normal. If the emergency button is activated all of the lights will be off, indicating that the emergency stop has been activated.
If the emergency stop is normal, and the cycle is ready to start the start push-button light will flash. Selecting the start button will start the cycle. The red stop button light will be on and the running LED will be on. The tank will start to fill by turning on the input valve.
Once the level of the tank reaches 2000 liters the input value will turn off stopping the tank from filling. A memory retentive timer will time for 20 seconds. During this time the LED running light will flash. This indicates to the operator that the mixing tank is in its timing mode.
Once the timer has expired, the output value will turn on to empty the tank. When the tank gets to less than 10 liters the output value will turn off. The tank will now be empty and the cycle will stop.
At any time during the cycle, the operator can stop, start or hit the emergency stop. The cycle upon starting up again will continue where it left off and complete the cycle.

A PLC programmer must know how everything about the sequence and operation of the machine before programming.

Writing out what is supposed to happen will help to clarify what is required in the PLC program. This is just another method like flow charts and sequence tables. Ask questions or view existing documentation to ensure that you know the logical steps to the machine operation.

Develop the Do-More PLC program: (Step 4 – PLC Programming Mixing Tank)

Using the information from the previous step we can now program our Do-More PLC. The BRX Do-More PLC Series will take you through installing the program, communicating to the controller, instructions, and addressing the controller.
Start the Do-More Designer programming software.
Ladder Logic Sample ProgramSelect New to start a new project. This can also be selected from the main menu | New…
Ladder Logic Sample ProgramWe will select the Do-More Simulator as the project that we will be programming. Select OK.
Ladder Logic Sample ProgramEdit mode is on by default when you start a project. This will allow you to program the PLC. Select Do-More/Sim to start the simulator.
Ladder Logic Sample Program SimulatorHere is the Do-More Simulator. Treat this as separate hardware in which you have to establish online communication and transfer/monitor the program.
Ladder Logic Sample ProgramSelect the system configuration under PLC on the main menu. You can also call this up by selecting system configuration under the tools menu in the project browser window.
Ladder Logic Sample Program Modbus TCPSelect the configure button under the internal Ethernet port configuration.
Ladder Logic Sample Program Static IPWe will use a static IP address for the Ethernet port. Here are our settings for the Ethernet port. Select OK.
Ladder Logic Sample Program Modbus TCP Server SlaveIn the system configuration window, select Modbus TCP settings and ensure that the Enable Modbus / TCP Server is selected. This is on by default with port 502 as the default number. Everything is left as the default. We can change some of these settings if communication can not be established reliably. Our PLC is now set up as a Modbus TCP Server to the EasyPLC Modbus TCP Client. Make a note of the static IP address that we are using for the Do-More PLC. This will be used later to connect to the EasyPLC machine simulator.
Ladder Logic Program
Ladder Logic Sample ProgramThe first rung of the program will control the cycle start and stop. C0 is the output address for this start-stop circuit. You can see that the stop push button, emergency stop, or timer reset will stop the cycle. Only the start pushbutton will start the cycle.
Ladder Logic Sample ProgramRung 2 will control the stop light and run the LED light. If the cycle has started then the stop light will be on. This indicates to the operator the way to stop the cycle. If the cycle has started and the volume is less than 2000 then the run LED light is on. This light will flash when the volume is greater than 2000 and the timer has not been completed.
Ladder Logic Sample ProgramRung 3 controls the start light. It will flash when the cycle has not started and the emergency stop is normal.
Ladder Logic Sample ProgramThe tank open input will be on when the cycle has started and the volume is less than 2000 liters and the timer has not been completed. When the timer completes, this prevents the tank from continually filling when it is below the 2000 level.
An accumulative timer is used with a set value of 20 seconds. When the tank level is greater than 2000 and the cycle is running the timer will be enabled. The timer reset happens when the tank level is less than 10 liters and the cycle is running. This timer is memory retentive. If the cycle is stopped, the present value is remembered, so the cycle will continue when it starts again.
The tank open output is on when the timer has timed out (Done) and the cycle is on. The timer reset will control when this tank output will then turn off.

Our ladder logic program is complete. Download the program to the Do-More Simulator PLC. Ensure that the controller is in run mode. We can now move on to our fifth step. Watch the video below to see this Do-More PLC program in action

Test the program: (Step 5 – PLC Programming Mixing Tank)

We will be using Modbus TCP on our Do-More PLC Simulator to communicate to the EasyPLC Machine Simulator.
We currently have our mixing tank in start mode.
PLC Programming - Mixing TankThe status of the machine simulator will be at the bottom of the screen. Currently, we have no PLC connected. Select IO Drivers on the bottom middle of the screen.
PLC Programming - Mixing TankThe EasyPLC driver is selected by default. Select the down arrow on the driver’s name. Under the driver pull-down menu, select “ModBusDriver”. This driver will communicate Modbus TCP (Ethernet) and Modbus RTU (Serial).
PLC Programming - Mixing TankSelect the configure button.
PLC Programming - Mixing TankWe can now enter the information for our Modbus driver. Select TCP/IP. This really means the Ethernet port on the computer will communicate to the PLC.
The digital inputs from MS to the Do-More PLC will be MC1 to MC3. This will start at address 0 due to the offset of 1 and the first input is not used. Digital outputs from MS to the Do-More PLC will be MI1 to MI6. This will start at address 1 due to the offset of 1 and the first input is not used. Analog inputs start at MHR1. The analog output for our level sensor will be MHR11. The analog scale factor is set to 10. This means that the value of 20000 is really 2000.0. Modbus communication will not handle decimal values well. Select the OK button.
PLC Programming - Mixing TankYou will now see the inputs and outputs that we have specified for the Modbus driver. We can now manually assign the driver outputs to the PLC inputs and the driver inputs to the PLC outputs. However, the automatic assignment works well and will save you time.
PLC Programming - Mixing TankSelect Automatic Assignment from the driver option in the main menu.
PLC Programming - Mixing TankThis will automatically assign the PLC IO to the Machine Simulator IO.
PLC Programming - Mixing TankSelect start driver and exit from the main menu.
PLC Programming - Mixing TankYou will see on the bottom left side of the window that the driver is communicating to the PLC by the green light. Select view IO to see the input and output status of the machine simulator.
PLC Programming - Mixing TankEnsure that the PLC is in run mode. We can see the operation of our EasyPLC mixing tank.
Using the Data View window of the Do-More Designer programming software we can watch the inputs and output operations. We can also monitor the ladder logic. Watch the video below to see this operation.

If your program works correctly, it’s time to move on. If not, you’ll need to debug. This can be as simple as re-downloading and re-uploading your program or as complicated as re-designing your logic altogether. To learn more about developing logic check out our tutorials on the five steps to PLC program development. When using EasyPLC, debugging is easily done with no damage to any equipment. You may have to modify your logic several times before you get everything right! That’s okay—it’s all part of learning. After all: trial and error are often easier said than done!

You can practice your modification and debug by modifying the mixing tank in the following way:
– Add a cycle counter to track the number of cycles completed.
– Cycle three times when the start push button is pressed.
Let me know how you make out in the comments below!

Download the Do-More PLC sample program and EasyPLC Mixing Tank here.

Watch the video below to see the five steps of program development applied to the mixing tank. The machine simulator is one of the best applications to help you learn PLC programming.

EasyPLC Software Suite is a complete PLC, HMI, and Machine Simulator package. This PLC learning package includes the following:
Easy PLC – PLC Simulation allows programming in Ladder, Grafcet, Logic Blocks, or Script.
HMI System – Easily create a visual human-machine interface (HMI)
Machine Simulator – A virtual 3D world with real-time graphics and physical properties. PLC programs can be tested using EasyPLC or through other interfaces. (Modbus RTU, TCP, etc.)
Machine Simulator Lite – Designed to run on Android Devices.
Machine Simulator VR – Virtual Reality comes to life so you can test, train or practice your PLC programming.

Purchase your copy of this learning package for less than USD 75 for a single computer install or less than USD 100 to allow different computers.
Receive 10% off the price by typing in ACC in the comment section when you order.
Learn PLC programming the easy way. Invest in yourself today.

Watch on YouTube: PLC Programming – Mixing Tank

If you have any questions or need further information, please contact me.
Thank you,

If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLCs are not challenging to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, decimals, Hexadecimal, ASCII, and Floating points.

To get this free article, subscribe to my free email newsletter.

Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available for free download. The link is included when you subscribe to ACC Automation.

Leave a Reply

Your email address will not be published. Required fields are marked *