A programmable logic controller, PLC, or programmable controller is a digital computer used for automation of typically industrial electromechanical processes, such as control of machinery on factory assembly lines, amusement rides, or light fixtures. PLCs are used in many machines, in many industries. PLCs are designed for multiple arrangements of digital and analog inputs and outputs, extended temperature ranges, immunity to electrical noise, and resistance to vibration and impact. Programs to control machine operation are typically stored in battery-backed-up or non-volatile memory. A PLC is an example of a "hard" real-time system since output results must be produced in response to input conditions within a limited time, otherwise unintended operation will result.
The three programs below were written during my internship at LVS Inc. using the software Zelio Soft V2.0 from Schneider Electric. It was programmed for a Zelio Logic 2 Module with 16 inputs, 10 outputs, and 24V DC.
Three-Digit Combination Lock
This is the first PLC program I've written using ladder logic programming. The combination for this specific program is a simple "1, 2, 3" and it was programmed using timers, the 4 pushbuttons on the PLC, and latching coil relays.
Five-Digit Combination Lock
Building upon my last program, I was able to add counters in this program to check for multiple "button pushes". However, instead of using the four buttons on the front of the PLC, I experimented with using discrete outputs.
Simplified Panama Canal Lock System
This is a simplified algorithm for the Panama Canal lock system. In this program we don't account for the mules that normally guide the ship through the canal and we assume that the ship continuously moves forward without any problems. Through this program I was able to learn about simulating a motor and different sensors for the PLC including limit switches and liquid level switches.
I really enjoyed writing the program for this one. I did a lot of research including watching a documentary about the Panama Canal lock system, and even reading a dissertation written in 1973 for the algorithm of the scheduling of vessels through the Panama Canal.
I've written it in two parts, as I didn't have enough discrete inputs to account for the two-way travel.
From the Pacific Ocean to Gatun Lake
From Gatun Lake to the Atlantic Ocean