PLCs can be programmed in various ways. According to IEC 61131-3 standard, 5 programming languages are included :
- Ladder Diagram (The abbreviation is LAD)
This is the most popular language today, especially in the US. It is based on the graphical representation of Relay Ladder Logic. Most current PLCs, whether compliant or not compliant with IEC61131-3, will support this ladder language.
Elements of a circuit diagram, such as contacts that are normally closed or normally open, and coils are connected together to form networks. To create logical diagrams for complex implementations, we can insert branches to create parallel logic circuits. The parallel branches are opened in the down direction or are directly connected to the signal bus. We end the branches in an upward direction.
- Instruction List ( Siemens is called STL )
This is like a version of ladder language but in text form. It has the same structure as assembly language.
This language is less used in practice than LAD
- Function Block Diagram (The abbreviation is FBD)
Describe the connection of functions, function blocks, and programs as a set of connected graphic blocks. It looks like the electronic circuit diagram we often use.
Like the LAD language, the FBD language is also a graphical programming language. The display of the logic circuit is based on the graphic logic symbols used in Boolean algebra.
Math functions and other complex functions can be expressed directly in combination with logical boxes. To create logic for complex operations, we insert parallel branches between the boxes.
#Both LAD and FBD languages use signal EN and ENO for some “box” commands.These parameters relate to the signal flow and determine when the command is executed during that scan.
+ EN (Enable In) is a Boolean input for boxes in LAD and FBD languages. The signal current (EN = 1) must be present at this input for the command box to be executed. If the EN input of an LAD box is connected directly to the left signal bar, the box will always be executed.
+ ENO (Enable Out) is a Boolean output for boxes in LAD and FBD languages. If the box has a signal stream at the EN input and the box performs its functions without error, then the ENO output will allow the signal stream (ENO = 1) to pass to the next element. If an error is detected during the execution of the command box, the signal stream will then be interrupted (ENO = 0) at the command box that generated the error.
- Structured Text ( Siemens is called SCL )
This is a very powerful high-level language for PLC, derived from the Pascal / C language. This is a language that is being increasingly used by engineers because it saves time
It can be used to define complex function blocks, which can be used in other languages. As a high-level language, SCL is very intuitive and easy to understand.
- Sequential Function Chart ( Siemens is called SFC )
This is a powerful graphical programming style to describe the sequential states of a control program. However, it is a bit difficult to learn and time consuming to program, so it is the least used language of the 5 languages according to IEC61131-3.
It is mainly used in programming control problems in sequential cycles