1.3 PLCs - Programming - Introduction
1.3 PLCs - Programming - Introduction
A computer
Introduction… Introduction…
Desktop Consoles: have a visual display unit with a keyboard
1
Introduction… Introduction…
Personal Computers:
Mitsubishi have MELSOFT GX Developer: MELSOFT supports programming methods such as:
Their GX developer supports all MELSEC controllers from the Instruction List (IL)
compact PLCs of the MELSEC FX series to modular PLCs Ladder Diagram (LAD/LD)
including MELSEC system Q and uses a Windows based Sequential Function Chart (SFC)
environment
2
PLC Brands… PLC Brands…
Siemens have SIMATIC STEP 7 that provides: SIMATIC STEP 7 supports different programming methods:
Allen Bradley
Telemechanique
High level languages may be used as well – a compiler is necessary
3
Ladder Programming… Ladder Diagrams
Ladder programming provides a means of writing programs which Consider a simple circuit for switching on or off an electronic
can then be converted into machine code by some software for use motor
by the PLC microprocessor
The power rails are like the vertical sides of a ladder with the
horizontal circuit lines like the rungs of the ladder
4
Ladder Diagrams… Ladder Diagrams…
The figure below shows a ladder diagram for a circuit that is used In the normal state:
to start and stop a motor using push buttons Push button 1 is open
The motor is therefore started by pressing button 1 and stopped by each rung on the ladder defines one operation in the control
a ladder diagram is read from left to right and from top to bottom
When the PLC is in its run mode, it goes through the entire ladder
program to the end, the end rung of the program being clearly
denoted, and then promptly resumes at the start
1/22/2021 PLC Programming 19 1/22/2021 PLC Programming 20
5
Conventions for Drawing Ladder Diagrams… Conventions for Drawing Ladder Diagrams…
This procedure of going through all the rungs of the program is
termed a cycle
The end rung might be indicated by a block with the word END or
RET, for return, since the program promptly returns to its
beginning
Conventions for Drawing Ladder Diagrams… Conventions for Drawing Ladder Diagrams…
each rung must start with an input or inputs and must end with at a particular device can appear in more than one rung of a ladder.
least one output: For example, we might have a relay that switches on one or more
Input: is used for a control action, such as closing the contacts devices. The same letters and/or numbers are used to label the
electrical devices are shown in their normal condition. Thus a notation used depends on the PLC manufacturer. This is the
switch that is normally open until some object closes it is shown as address of the input or output in the memory of the PLC
6
PLC Scan Cycle PLC Scan Cycle…
Execute program
7
PLC Scan Cycle… PLC Scan Cycle…
The PLC also carries out some housekeeping duties The time it takes to complete a scan cycle is called the scan cycle
Input Scan: the status of external inputs is written to the input time and indicates how fast the controller can react to changes in
Program Scan: each ladder rung is scanned and solved. The The time required to make a single scan can vary from about 1ms
8
PLC Scan Cycle… PLC Scan Cycle…
If the controller has to react to an input signal that changes states For each rung executed, the PLC processor will:
twice during the scan time, it is possible that the PLC will never be Examine the status of the input image table bits
able to detect this change. Solve the ladder logic in order to determine logical continuity
The scan time is a function of the following: Update the appropriate output image table bits, if necessary
Speed of the processor module Copy the output image table status to all the output terminals.
The length of the ladder program Power is applied to the output device if the output image table
The type of instruction executed bit has been previously set to a 1
The actual ladder true/false condition Copy the status of all the input terminals to the input image
table. If an input is active, the corresponding bit in the input
1/22/2021 PLC Programming 33 1/22/2021 PLC Programming 34
image table will be set to a 1
9
PLC Scan Cycle… PLC Scan Cycle…
10
Standard IEC 1131-3 Symbols… Example 1
Some slight variations occur between the symbols when used in Consider a situation where the energizing of an output device
semigraphic form and when in full graphic, the semigraphic form depends on a normally open start switch being activated by being
being the one created by simply typing using the normal keyboard, closed
whereas the graphic form is the result of using drawing tools
Example 1… Example 1…
In drawing ladder diagrams the names of associated variable or The more descriptive the name, the better, such as pump motor
addresses of each element are appended to its symbol control switch rather than just input, and pump motor rather than
just output.
11
Example 2 Example 3
If there had been a normally closed switch with the output there Suppose we have a hydraulic unit and we wish to give a “Healthy
would have been an output until that switch was opened. Only Lamp” indication when:
while there was no input to the contacts would there have been an The pump is running: sensed by an auxiliary contact on the
output pump starter
Example 3…
END
12