What is PLC?
A PLC is a real-time control system, which is a digital computer system for multiple inputs and output arrangements with extended temperature range and immune to noise and resistance to vibration impact compare to the personal computer. There are different types of programming languages for PLC. Common are :
- Ladder logic
- Functional block diagram
- Sequential function chart
- Boolean mneumonics
Among these programming languages, Ladder logic is the most commonly used and oldest programming language.
Ladder logic Programming:
The ladder diagram is a graphics programming language derived from the circuit diagram of the relay control with direct wiring. The ladder diagram contains contact rails on the left, to the right of the diagram, these contact rails are connected to the switching elements (normally open / normally closed contacts) through the current path and the elements of the coil.
Logics and different operations:
Normally Open Contact:
Normally open contact can be used to represent any input to the control logic, such as a switch or sensor, a contact of an output or an internal output. When resolved, the referenced entry is examined for a true condition (logic 1). If true, the contact will close and allow logic to flow from left to right. If the state is FALSE (logical 0), the contact is open and logic will NOT flow from left to right.
Normally Closed Contact:
Begins a new rung or an additional branch in a rung with a normally closed contact. If the status is ON, power will not flow. Opposite of normally open contact. When solved the referenced input is examined for an OFF condition. If the status is OFF (logical 0) power (logic) will flow from left to right. If the status is ON, power will not flow
Normally open coil:
This represents any discrete output from the control logic. Reflects the status of the rung (on/off) and outputs the discrete (ON/OFF) state to the specified image register point or memory location. When “solved” if the logic to the left of the coil is TRUE, the referenced output is TRUE.
Normally Closed Coil:
This is another type of output. When “solved” if the coil is a logical 0, power will be turned on to the device. If the device is logical 1, power will be OFF.
Logic gates in ladder logic:
Logically ANDs a normally open contact in series with another contact in a rung. The output of the And gate will be true only if both the inputs are true, the truth table is:
The OR gate output is 1 if one or more inputs are 1. The OR is a logical condition that is easy to represent in Ladder Logic, this representation is known to latching. Truth table:
An AND gate with an inverted output is called a NAND gate. The NAND function is often used in integrated circuit logic arrays and can be used in programmable controllers to solve complex logic. Truth table:
The same rule about inverting the normal output result applies if a NOT symbol is placed at the output of the OR gate. The normal output is inverted, and the function is referred to as a NOR gate. Truth table:
An often-used combination of gates is the exclusive-OR (XOR) function. The output of this circuit is HIGH only when one input or the other is HIGH, but not both. The exclusive-OR gate is commonly used for the comparison of two binary number.
The PLC simulator applications allow to write your program in ladder logic and run it in the simulated PLC. The applications are useful for beginners to learn the basics of the ladder logic and to test your program logic.
The simulator allows one to construct our own program and verify it. One has to build each ladders consisting the inputs and the proper outputs.
For example we are considering the PLC simulator excel from the Engineers-excel.com:
The application doesn’t need any experts in programming, a beginner can easily understand the function. One should construct the ladder, including the input and output, then select the type of input or output needed. It is listed the right-hand side the input and output options. The options on the column above the coils.
- The excel sheet can be downloaded and work in your spreadsheet
- The excel sheet consists of a large section of ladder editor on the left-hand side and input-output option, input-output builder options plus the download and run options on the right-hand side.
- The ladder is constructed filling the dots in the Ladder editor, Use the drop down boxes in the grey areas for building the ladder and the drop down boxes on the top row to enter tag names. See animated picture below.
- Each rung can only have one output connection.
- Construct your program select each of your rungs with proper I/O address and you can use timers too. Then click on download and run option to run the program.
- The green light indicates the logical true for each I/O rungs
The simulator provides the pushbutton inputs and switches, there are the digital output and internal coil outputs.
AutomationForum provide you with a PLC simulator: Click here