Industrial Automation Industrial Automation
Industrial Automation Industrial Automation
MEEC 2007-2008
Industrial Automation
(Automao (A t d de P Processos I Industriais) d t i i)
API
P. Oliveira
Page. 1
MEEC 2007-2008
Syllabus:
Chap. 2 Introduction to PLCs [2 weeks] ... Chap. 3 PLCs Programming Languages [2 weeks] Standard languages (IEC-1131-3): Ladder Diagram; Instruction List, and Structured Text. Software development resources. ... Chap. 4 - GRAFCET (Sequential Function Chart) [1 week]
API
P. Oliveira
Page 2
Instruction List
LD AND ANDN OR ST %M12 %I1.0 %I1.1 %M10 %Q2.0
2
(2) b
Right
3
(3) p
Load
4
(2) a
Left
API
P. Oliveira
Page 3
Instruction List
LD AND ANDN OR ST %M12 %I1.0 %I1.1 %M10 %Q2.0
2
(2) b
Direita
3
(3) p
Carrega
4
(2) a
Esquerda
API
P. Oliveira
Page 4
Ladder diagram
Input Instructions
Output Instructions
API
P. Oliveira
Page 5
API
P. Oliveira
Page 6
Contact in the rising edge: contact is active during a scan cycle where the control bit has a rising edge. edge Contact in the falling edge: contact is active during a scan cycle %Q2.0 the control I1.0 where bit has a falling edge.
t
Q2.0
N %I1.0 P
API
P. Oliveira
Page 8
R %I1.0 N
API
P. Oliveira
Page 10
API
P. Oliveira
Page 11
Ladder diagram
API
P. Oliveira
Page 12
AND of the operand with the result of the previous I1.0 logical operation.
t
AND of the operand with the inverted result of the previous Q2.0 logical operation. t
P
AND of the rising edge with the result of the previous logical operation operation. AND of the falling edge with the result of the previous logical operation.
API
P. Oliveira
Page 13
API
P. Oliveira
Page 14
API
P. Oliveira
Page 15
Ladder diagram
Ladder assembling
Input Instructions O t t Output Instructions
The outputs that have a TRUE logical function, evaluated from the left to right and from the top to the bottom, are energized (Schneider, Micro PLCs).
API P. Oliveira Page 16
Ladder diagram
Example:
API
P. Oliveira
Page 17
Ladder diagram
Example:
API
P. Oliveira
Page 18
Ladder diagram
Example:
API
P. Oliveira
Page 19
Ladder diagram
Example:
API
P. Oliveira
Page 20
10
Ladder diagram
General case of Inputs and Outputs in parallel, with derivations
Note: it is important to study the constraints and potentialities of the development tools.
API P. Oliveira Page 21
Ladder diagram
Imbricated contacts and alternative solution
API
P. Oliveira
Page 22
11
Ladder diagram
Contacts in the vertical and alternative solution
API
P. Oliveira
Page 23
Ladder diagram
Contacts in the vertical and alternative solution Another example:
API
P. Oliveira
Page 24
12
API
P. Oliveira
Page 25
Characteristics:
Identifier: Input: Mode: %TMi IN TON TOFF TP TB 0..63 in the TSX37 to activate On delay Off delay Monostable 1mn (def.), 1s, 100ms, 10ms
Time basis: Q
Programmed value: %TMi.P 0...9999 (def.) period=TB*TMi.P Actual value: %TMi.V 0...TMi.P (can be real or tested) Modifiable: Y/N can be modified from the console
P. Oliveira Page 26
API
13
API
P. Oliveira
Page 27
Ladder diagram
Example:
API
P. Oliveira
Page 28
14
Ladder diagram
Example:
API
P. Oliveira
Page 29
Mode:
TP
Q
Q
500ms 500ms
TMi.V
API
P. Oliveira
Page 30
15
API
P. Oliveira
Page 31
API
P. Oliveira
Page 32
16
Ladder diagram
Example of timer on-delay
API
P. Oliveira
Page 33
Ladder diagram
Example of a timer on-delay that sets an output
API
P. Oliveira
Page 34
17
Ladder diagram
Example of timer on-delay
API
P. Oliveira
Page 35
Ladder diagram
Example of timer on-delay
Coil is energized if the switch remains closed for 12 seconds
API
P. Oliveira
Page 36
18
Ladder diagram
Example of timer on-delay
If PB2 is activated, powers on the oil pumping motor. When the pressure augments, PS1 detects the increase and activates the main motor. 15 segunds later the main drive motor starts.
API
P. Oliveira
Page 37
Ladder diagram
Example of timer programmed as off-delay
API
P. Oliveira
Page 38
19
Ladder diagram
Example of timer programmed as off-delay
API
P. Oliveira
Page 39
Ladder diagram
Example of timer programmed as off-delay
API
P. Oliveira
Page 40
20
Ladder diagram
Example of timers programmed as off-delay and on-delay
API
P. Oliveira
Page 41
API
P. Oliveira
Page 42
21
API
P. Oliveira
Page 43
Ladder diagram
Example of retentive timers
API
P. Oliveira
Page 44
22
API
P. Oliveira
Page 45
Ladder diagram
Exemplo:
SW ON to start operation Before motor starts, lubrificate 10 s with oil. SW OFF to stop. (lubrificate 15 s more). After 3 hours of pump operation, stop motor and signal with pilot light. Reset available after servicing.
API P. Oliveira Page 46
23
API
P. Oliveira
Page 47
API
P. Oliveira
Page 48
24
API
P. Oliveira
Page 49
Ladder diagram
Example of a semaphore
API
P. Oliveira
Page 50
25
API
P. Oliveira
Page 51
API
P. Oliveira
Page 52
26
Some applications...
API
P. Oliveira
Page 53
0..31 in the TSX37 0...9999 (def.) 0...Ci.P (only to be read) can be modified from the console Reset Ci.V=0 Preset Ci.V=Ci.P Count Up Count Down Overrun %Ci.E=1 %Ci.V=0->9999 Done %Ci.D=1 %Ci.V=Ci.P Full %Ci.F=1 %Ci.V=9999->0
P. Oliveira Page 54
E D F
Modifiable:
Inputs:
CU CD
R S CU CD E D F
Outputs:
API
27
Internal Structure
Representation
API
P. Oliveira
Page 55
API
P. Oliveira
Page 56
28
API
P. Oliveira
Page 58
29
API
P. Oliveira
Page 59
API
P. Oliveira
Page 60
30
API
P. Oliveira
Page 61
API
P. Oliveira
Page 62
31
API
P. Oliveira
Page 63
API
P. Oliveira
Page 64
32
API
P. Oliveira
Page 65
API
P. Oliveira
Page 66
33
API
P. Oliveira
Page 67
Ladder diagram
Example with counters and timers (conts.): Specs:
Starts M1 conveyor upon pushing button . After 15 plates stops M1 and starts conveyor M2 . M2 operates for 5 seconds and then stops. Restart sequence.
API
P. Oliveira
Page 68
34
Ladder diagram
Example with counters and timers (conts.): Specs:
Starts M1 conveyor upon pushing button . After 15 plates stops M1 and starts conveyor M2 . M2 operates for 5 seconds and then stops. Restart sequence.
API
P. Oliveira
Page 69
Ladder diagram
Example with counters and timers (conts.): Specs:
Starts M1 conveyor upon pushing button . After 15 plates stops M1 and starts conveyor M2 . M2 operates for 5 seconds and then stops. Restart sequence.
API
P. Oliveira
Page 70
35
Ladder diagram
Example with counters and timers (conts.): To use a timer to command a counter, to implement large periods of time.
API
P. Oliveira
Page 71
API
P. Oliveira
Page 72
36
Ladder diagram
Numerical Processing
API
P. Oliveira
Page 73
Ladder diagram
Numerical Processing Arithmetic Functions
API
P. Oliveira
Page 74
37
Ladder diagram
Numerical Processing E Example: l Arithmetic functions
Ladder diagram
Numerical Processing Logic Functions
API
P. Oliveira
Page 76
38
Ladder diagram
Numerical Processing E Example: l Logic functions
API
P. Oliveira
Page 77
Ladder diagram
Numerical Processing P i iti on the Priorities th execution ti of f the th operations ti
API
P. Oliveira
Page 78
39
Ladder diagram
Structures for Control of Flux S b ti Subroutines Call and Return
API
P. Oliveira
Page 79
Ladder diagram
Structures for Control of Flux JUMP i instructions: t ti Conditional and unconditional
API
P. Oliveira
Page 80
40
Ladder diagram
Structures for Control of Flux E Example: l Use of jump instructions Attention to: INFINITE LOOPS ... It is not a good style of programming!... Does not improove the legibility of the proposed solution.
API P. Oliveira Page 81
Ladder diagram
Structures for Control of Flux H lt Halt
API
P. Oliveira
Page 82
41
Ladder diagram
There are other advanced instrauctions (see manuel) Monostable Registers of 256 words (LIFO ou FIFO) DRUMs Comparators Shift-registers ... Functions to manipulate floats
API
P. Oliveira
Page 83
Ladder diagram
Numerical Tables
API
P. Oliveira
Page 84
42
Ladder diagram
Each PLC has limitations in terms of connections E Example: l
API
P. Oliveira
Page 85
Ladder diagram
It is important to learn the potentialities and ... the limitations of the developing tools, i e TO STUDY the manuals is a MUST i.e. MUST.
API
P. Oliveira
Page 86
43
Ladder diagram
Learn how to develop and debug programs (and how to do the fine tunning).
API
P. Oliveira
Page 87
Ladder diagram
System information: system bits
API
P. Oliveira
Page 88
44
Ladder diagram
Informao de Sistema: words de sistema
API
P. Oliveira
Page 89
Ladder diagram
Software Organization
Sas (LD)
SR0
API
P. Oliveira
Page 90
45
Ladder diagram
Software Organization FAST Fast Task Program Priority greater than MAST Executed Periodically (1-255ms) Verified by aWatchdog, impacts on %S11 %S31 Enables E bl or disables di bl a FAST %S33 gives the execution time for FAST
API
P. Oliveira
Page 91
Ladder diagram
Software Organization Event Processes Processes that can react to external changes (16 in the Micro 3722 EV0 a EV15) Priority greater than MAST and FAST!
Event Generators
Inputs 0 to 3 in module 1 1, given transictions Counters Upon telegrams reception %S38 Enables or disables event processes (also with MASKEVT() or UNMASKEVT())
API P. Oliveira Page 92
46