Programmable logic controllers (PLCs) are digital computers used for industrial automation of electromechanical processes, such as control of machinery on factory assembly lines, amusement rides, or light fixtures. PLCs are used in many industries and machines.
The practice consisted of implementing a stoplight circuit using function blocks. Function blocks are commonly used in TIA Portal as they allow the programmer to save time by reutilizing ladder code. Function blocks are very similar to regular functions used in programming languages such as C or Python.
Here is a screenshot of the program's main block, were we added our function blocks containing all the logic from each stoplight.
To make the stoplight easier to implement, we utilized an HMI, which are graphical interfaces or control panels that allow humans to interact with certain machines or systems. HMIs are very important in industry, as they serve as the primary communication between operators and the machines they control or in special cases, monitor. The following image shows the HMI used in this lab assignment:
The PLC model used is a S7-1200 1214 DC/DC/DC. You can find the manual on the PLC here. We used three Siemens ethernet cables to make the connections between the PLC, the HMI panel and my laptop running TIA Portal.
First, we tested the program using only the HMI panel, where we added a start button, and two stoplights, each with three lights. As you can tell in the following video I added from youtube, the red light from the first stoplight is on, this is triggered by the FirstScan bit. When we push the start button, immediately the green light is turned on. The stoplight finishes its sequence and then proceeds to trigger the green light on the second stoplight. Once the second stoplight finishes, it triggers the first stoplight, making an infinite loop which simulates two real life stoplights at an intersection.
We also gave it a go on implementing the program on the physical leds available with the plc we were given. Although we had to change the outputs used before for the lights, no other obstacle was encountered, so the stoplights worked as soon as we changed the memory assignments and reloaded the project. I have a video on that on my youtube channel too.