To start we need to know to program a PLC programming environment under which we will. Normally this is graphical programming environment, and is known by the name of "Language Ladder," but his official title is the Ladder Diagram.
It should be noted that various programming languages for PLC, but the language called Ladder is the most common and nearly all PLC manufacturers incorporate it as basic programming language.
The Language Ladder is the same for all models of PLC, which changes from manufacturer to manufacturer and from model to model is the microcontroller used, and for this reason that differs between the PLC is the way the software interprets the symbols of contacts in Ladder language. The programming software is responsible for generating the microcontroller assembly code that has the PLC, so if a manufacturer of PLC uses Motorola ® HC11 microcontrollers or the Z80 ® or the microchip PIC or AVR ® atmel ® and so on. Code for each PLC that is created is different in that by its very nature microcontrollers codes are different, although the Language Ladder is the same for all PLCs.
Figure 5.1 Language in a PLC ladder
This time widely described using the software of our PLC programming, and although it was mentioned in earlier lines generated code is different between various brands of PLC ladder language is the same for all, and at the end of accounts that is what we want to program a PLC, so do learn to program a Siemens ® brand, implicitly we get the same knowledge to program one of the GE-Fanuc ® brand, and so on.
You can use any model of PLC, including manufactured by any manufacturer, this means that depending on the selected PLC can be even from 6 inputs and 6 outputs. But for the moment this aspect is not important, as the ladder language is functional for any PLC, and therefore one must take into account the number of inputs and outputs that owns the PLC.
For all readers can put into practice everything I learned on the subject of PLC, Cinda Software offers them a software PLC (simulator) which is important characteristics to possess the same ability to work any name brand (in this same category of course) Allen Bradley or Siemens call it for example. and also the software can be found in our language, namely Spanish.
To program the PLC (in our case we can simulate) with an industrial application or with a test program as we will be developing in these examples, the first action we have to do is open the software program called "MiPlc" that previously had to be installed (or unzipped), this program can be downloaded from the internet page
Figure 5.3 shortcut icon on the desktop of the PC
Once you double click on the icon of the programming software MiPlc Welcome window appears in which observed data from the PLC manufacturer, emails and phone numbers in case you wish to contact them directly, to enter the program you must press on the box labeled OK.
Figure 5.4 Welcome Window.
Once inside the PLC program we need to go to the Tools menu and select the Serial Port is called as a next step is to select the Configure Port option, as illustrated in Figure 5.5. The above action would cause it to open the window labeled setup, in which you configure the serial communication features to be established between the PLC and the computer so that data are normally left as illustrated in Figure 5.6, and when we entered this data oppressed with the mouse pointer on the OK button, causing it to open the serial communication channel. We can say with certainty that our PLC software has been configured properly for this to operate, so what follows is to enter the symbols for the program.
Figure 5.5 Configuring the serial port.
In Figure 5.7 is an image of the PLC programming software identifies where component parts are the following: Tools menu, shortcut buttons, menus and the specific work activity status between PLC and computer.
Figure 5.6 Data to configure the serial port.
As a first step in starting a program has to create a new project, so we headed to the Project menu, and then the New command, as shown in Figure 5.8.
Figure 5.7 Parts of the PLC program.
Once opened a new step we are able to begin entering data symbols for the ladder language to build our program. So now select the specific menu of work called "Elements", since in this section are the symbols representing the operations that the program has to be interpreted, then we will describe symbol symbol:
Figure 5.8 Creating a new project.
Figure 5.9 First step.
The first set of symbols corresponds to variable input signals, these are referred to as normally open (NO) and normally closed (NC), and its main function is to inform the PLC logic state in which the variables are physical which are captured by sensors, and as the contacts of a relay, when it is de-energized the NO contact is open, while the NC contact is closed, and when activated the NO contact closes and NC contact opens, or, in other words there is a change of state when the contacts are handled.
Figure 5.10 input variables.
These contacts are the "conditions" that are used to generate the PLC logic programming, since it is through these functions are implemented the program logic control any manufacturing process used. To insert any of these symbols simply select it with the mouse pointer to click the left mouse button, this action will cause it to open a window asking what type of input is, so here we select if it is a gateway through of connection terminals (physical input) or is an internal input (state generated by some internal operation of the PLC). After selecting the type of input we have to tell where it will read the information we have to select the input source (physical or internal) and finally apply a label that matches the information you are reading.
Figure 5.11 Setting up the tickets.
The second set of symbols corresponding to output variables which in turn activate elements of power can be same as DC motors or AC, heat, pistons, lamps, etc.. The symbols used to represent the outputs in Ladder language, have the same meaning as in an electrical diagram is a relay coil, and the same happens with a real one in order to energize you have to meet certain conditions previous logic, whether the actuation of a button. The symbols that activate the outputs are the "actions" that any industrial process is required to make this is to modify the physical variables that are taking part in any production line. The outputs depending on how you hold your memory management, are named momentary output or output stored.
Figure 5.12 output variables.
The momentary output represents a logical state we will do anything on or off actuator, this output is characterized by the mode of operation that tells us to have a logical "1" output is the indispensable requirement that the conditions that prevail entry is maintained as long as is necessary for the logical "1" exists, otherwise it will take is a logical "0" to the exit. The stored output contains an implicit memory, which is very useful to maintain state of logical "1" for the duration of time the process requires it, and all you have to do is activate the output memory when stored output is activated no matter what conditions change, the state of logical "1" remains unchanged. Now, whenever necessary to have to cancel the memory or you can say that will go out, or will the state of logical "0", which has to do is activate the corresponding deactivation.
Figure 5.13 Configuration of the outputs.
When using an output have two configurations, a type of external output is like what we define as output, and it will tell you that physical terminal connection terminals that reflect their activity. The second type of output is considered internal and is known as a brand, and what it means is that this brand is an internal condition of the control program that is not reflected to some element actuator. It is noteworthy that for the PLC program that we use in Knowledge Electronics, are allowed only a different output symbol, and if we require more than one, you need to open as many steps as we have in our process outputs.
The third set of symbols is made by one and is the timer which is a tool that serves to activate the counting time interval is based on 1 second, the maximum time that can be set is the 255 seconds. The timer is a great help especially when it aims to establish a safe condition for the operator, for example, when time has passed several seconds with no response, then the actuation of the control buttons will not respond if not to that the process is restored. The timer is activated once it begins to quantify time in descending order, and when it reaches 0 seconds causes an internal output logic 1 state, canceling this output when you reset the timer.
Figure 5.14 Election of Timer.
The fourth set of symbols used to use tool that has the function of counting events, this counter will have to set which is the maximum value that has to get that depending on the PLC, but usually to control the filling process a box with products not require very high. Once it was activated and reaches its maximum count, it causes an internal output logic 1 state warning that has reached the predetermined count value to be placed on internal logic 0 output of the counter, this should be to restore to trim start a new counting process.
Figure 5.15 Symbols of the counter.
The fifth set of symbols is composed of two tools used to design functions that operate by way of subroutines and one that used to skip a step, which is the same as disable it. The subroutines are used when developing our application, there are conditions that are repeated more than once, and if we go into each different step would lead to greatly enhance our program, which is why it is designed to simplify a function that internally contains all the control logic that is repeated constantly and then just called and no longer enter the symbols The second tool used to skip a step when it is used depending on the context of the logic control program, when a condition leads to involves selecting one out of two or more roads, so you select the right and eliminating others.
Figure 5.16 Call functions.
The sixth and final set of symbols used to perform branches when you are entering contacts either NO or NC These symbols serve to open a branch and also to close it.
Figure 5.17 Tools to open and close a branch.
Once we entered all the symbols of our ladder-language program, is recommended before the PLC program to simulate the logic functions and be confident that our method works so we use the hot key question, as response of the above action would cause a window opens displaying the status there that are all inputs, outputs, timers, counters, etc..
Figure 5.18 simulation window.
For the simulation of our program we have to go in the box provided by manipulating the conditions, namely inputs and only enough to place the mouse pointer and press the left mouse button to change the logic state that it contained.
Figure 5.19 Tools to download the code to the PLC.
When we have simulated the program and it runs all the logical conditions programmed it, and we are able to load the program to the PLC, so now we connect the programming cable to both the computer's serial port and to the corresponding terminal PLC, and for this we use the shortcut button.
Well, here described what I know is the environment of our program graph PLC, but the important thing to learn programming is to do an exercise that we have proposed throughout this book, and although it possesses any PLC, simply with the software to practice because it contains a simulator. On the other hand, it is also noteworthy that if in the future seek to program a PLC brand and pray with other features, there is no major problem since the ladder to learn the language, are learning to program virtually any PLC, this because Ladder language is universal for all.