Bottle Simulator

Introduction

This is a demonstration of the LogixPro 500 PLC Simulator, a training platform designed to simulate Allen Bradley RSLogix programming. A PLC (Programmable Logic Controller) is a small computer that is designed to control motors, solenoids, and other actuators in a coherent way to successfully automate a process. PLC’s use a form of programming known as ladder logic which uses input from switches and other devices (analog and digital) to control the output devices. I wrote the program for this simulation and recorded a video of the results.

The Video Demo

View It On YouTube

The Program

If you have the LogixPro Simulator, you can download the code here:

Download Code

Otherwise, an image of the ladder logic code is available here:

View In New Browser Tab

Download Image

Background

Ladder logic code is arranged in a series of rungs. Each rung has a symbolic condition (or a set of conditions) on the left side and at least one instruction on the right side of the rung. The instruction(s) is (are) carried out if the condition(s) on the left side is (are) met. The use of branches on the left side of a rung makes an OR function with the conditions on the parallel branches the AND function is made by placing conditions in series on the same branch.  Unlike traditional computer code, a ladder logic program is rapidly executed (scanned) repeatedly – hundreds or thousands of cycles per second.  This facilitates the ability of the controlled system to quickly respond to changes in the inputs (user switches and sensors) as long as the system is on. The scan cycles continue even when the user puts the system in an idle mode.  Most or all of the rungs just don’t execute in this case, but the code remains active.

The high frequency of the execution of the program creates a great deal of counter-intuitive behavior, but the results are always logical. Intended functions that look obvious can become very difficult to get right when programming.  The code required just to get the box belt in this demo to start and stop at the right time required 8 rungs (025 – 032).

More Resources

The Learning Pit has a page full of resources that include some introductory material along with guides for each of the exercises available on the simulator, including the bottle line.

 

 

Dave Gangadean, to be specific.