What is a PLC ?

So what is a PLC ?

PLC stands for Programmable Logic Controller, and I’m not going to force-feed you all the techy definitions that made me more confused than I already was when I just wanted to know what a PLC does.

A PLC in a nutshell is an electronic device, which got inputs and outputs. You can change the state of the outputs depending on the inputs to accomplish a certain desired task.

Imagine that you are a  chemist (I know, you’re too cool to wear glasses and be a nerd and all), and that to make something, you’ll need to mix a fluid with another one for a certain period of time, then put the result in a balloon and heat it until it reaches a certain temperature, then you’d have to evacuate the emanations with a ventilation system as long as the fluid is there and then pump the fluid to a reservoir, and control the flow of the magic liquid that is the favorite beverage of your dog not to provoke a torrent.

Now, how would you do that ?

Well, long ago, engineers had to build complex circuitry specifically to control each thing (ventilation system, the motor of the mixer to run for a certain time, the temperature sensors, etc) , and interconnect all this to produce the expected task. That was a lot of work, and if they ever wanted to change something, they had to rewire things, replace components and always tweak things.

A PLC makes it possible that you don’t have to do that. A PLC is an electronic device,  kind of a computer but without the screen and the keyboard, for it is NOT a general purpose device . It’s not made to write the draft of the next Le Comte de Monte Cristo and then browse the web looking for awesome blogs like this one.

So, you do have to program it to do specific tasks, but do not have to make electronic boards your own to accomplish  these specific tasks- which would’ve required integrated circuits, transistors, amplifiers and lots of other things and then wire all that in a unique way-. That’s good, isn’t it ? What’s even better is that you can re-use the PLC to do OTHER tasks, simply by writing another program and uploading it to the PLC. That’s something that would’ve been very difficult to achieve before PLCs, as you would have had to change the whole circuitry and even then, make other boards for the tasks are no longer the same.

So the same PLCs that are used in plants/factories, can be used to simply turn a light on. Of course if you use a PLC to just turn a light on, you’d be throwing money out of windows, not so smart of you. So PLCs are interesting when things get more complex than something you could deal with using a less expensive solution.

Now, there are lots of vendors, like Siemens, Schneider, Omron, Allen Bradley, ABB, Yokogawa, General Electric… And each vendor offers different choices, depending your needs.

For example, Siemens offers a range named SIMATIC S7 which has got S7-200, S7-1200, S7-300,S7-400 and then again, in teh S7-200 family, there are different types, like the S7-221, S7-222, S7-224, S7-226 and S7-226 XM ..

Each differs from the other, be it speed, memory, autonomy.. So you have to chose something that suits your needs.

For example, the S7-200 series is for small applications.

All right, how to program a PLC ?

To program a PLC, you would need either a dedicated device from the vendor, OR a Personnal Computer with the propper software and the connection cable. (For example, to program Siemens SIMATIC S7 Controllers, you would need a program named STEP7 Micro/WIN32 in a PC, and the propper cable called PC/PPI cable (PPI for Point-to-Point Interface, the cable is a sort of RS-232/RS-485 adapter)… And then, when you’re done programming it and you put the PLC to work, you would use another program, called WinCC to supervise the process. It took me a while to figure out what exactly does each of these fancy names do.)

Which programming language do we use to program PLCs ? You have the choice :

-Ladder Logic

-Statement List

-Function Block Diagram.

Are the most used.

In Ladder Logic , you will use  symbols  called Coils and Contacts.

In Statement List, well, you use statements to get the job done.

In Function Block Diagram , you arrange blocks that have inputs and outputs (graphically) to achieve whatever you want.

What you need to know is that PLCs have input ports which you connect your inputs to (like a button, or a switch or even the output of a device) and output ports to which you connect whatever you’d like to control (be it a light, an electric door, a motor, a device, etc).

Something to keep in mind, which is fundamental is the signal flow the direction in which the signal flows.

A signal ENTERS a PLC from the Input Ports, and GETS OUT of the PLC from the Output Ports.

Some PLCs can do lots of other things too, like Pulse Width Modulation , and if they can’t do what you want, vendors provide extensions that you connect to your PLC to enable it to do something (Like sending a text message (SMS) to a certain number, or to be controlled at a distance via modem , imagine that, huh !)

That’s it for this little introduction to PLCs. In posts to come, I’ll talk about  Siemens SIMATIC S7 PLCS and start with the S7-200… The smallest one.