Beruflich Dokumente
Kultur Dokumente
OR
AND
CPU
The origins of LD
What is a Rung?
Output Instruction
If all Input Instructions in series must all be true for outputs to execute
(AND)
If any input instruction in parallel is true, the outputs will execute (OR)
B
OR
AND
Branches
Writing program in LD
contacts,
coils,
timers,
counters and
functional blocks (functions).
Contacts
a)
IN002
IN003
b)
Contacts
Contacts
Coils
OUT 002
a)
OUT 003
b)
Coils
Timers
Pump_Tmr
IN
T#200ms
PT
TON
Q
ET
178
Timers
Timers
Counters
200
PV
CV
Load_Cnt_DN
178
Counters
unidirectional counters
up counter
down counter
Counters
Functional blocks
Function blocks
edge detecting,
functions implementing complex controllers and
sequencers,
functions handling high-speed counters.
read entries
execution of program instructions
updating outputs
Interpretation of LD diagrams
Interpretation of LD diagrams
Program execution
Line program
Phase
The
B
Branch
F
I
Null
Coil -( )
Negative coil -( / )
Sets a bit when the rung is false(0) and resets the bit when the rung is True(1)
Not commonly supported because of potential for confusion
Sets a bit when the rung is true(1) and resets the bit when the rung is false (0)
PLC5 calls this an OTE Output Enable
Sets a bit (1) when the rung is true and does nothing when the rung is false
Resets a bit (0) when the rung is true and does nothing when the rung is false
Contacts
Enables the rung to the right of the instruction if the rung to the left
is enabled and underlining bit is reset (0)
Enables the rung to the right of the instruction if the rung to the left
is enabled and underlining bit is set (1)
Enables the right side of the rung for one scan when the rung on
left side of the instruction is true
Enables the right side of the rung for one scan when the rung on
left side of the instruction is false
Retentive Vs Non-retentive
Operation
Definitions
Retentive Coils
Sets a bit when the rung is true(1) and resets the bit when the
rung is false (0)
Sets a bit (1) when the rung is true and does nothing when the
rung is false
Resets a bit (0) when the rung is true and does nothing when
the rung is false
Sets the bit bit (1) when rung to the left of the
instruction transitions from off(0) to on(1)
The bit is left in this state
IN
T#200ms
PT
TON
Q
ET
178
Time values
TP - Pulse timer
TON - Timer On Delay
TOF - Timer Off Delay
Pump_Tmr
Pump_Tmr
TON
IN
ENO
Q
T#200ms
PT
ET
Pump_Tmr_DN
178
Timer Operation
Q
ET
PT = Preset Time
ET = Elapse Time
PT
|
0
IN
Q
ET
PT
|
0
PT
|
0
CTU
IN
ENO
200
PV
CV
Load_Cnt_DN
178
Load_Cnt
CTU
IN
R
200
PV
CV
178
Counter Operation
Parameters
...
...
PV
CV |
0
CV
R
LD
...
...
Count Down (CTD) Counter
IN
Q
PV
CV |
0
LD
...
...
|
Skip_Calc |
|-| |-------------(JMP)--|
| ...
|
| Skip_Calc
|
|---[LBL]---...
CAL
CAL
RET
RET
The look and feel of IEC 1131-3 is somewhat different from the
1Million+ PLCs that Allen Bradley has running in factories
throughout the world
ADD
Source A
Tank1_In
Source B
100.000
Offsetr
78.251
Destination Tank_Level
EN
Tank1_In
100.000
Offsetr
78.251
TON
Timer
Pump_Tmr
Preset
200.000
Accum
178.251
178.251
Pump_Tmr
ENO
IN
(EN)
(DN)
TON
Tank_Level
178.251
ENO
Q
T#200ms
PT
ET
Pump_Tmr_DN
178
IEC places the input parameters on the outside of the instruction block
vs the PLC5 where they are presented inside of the block
File Operations, PID, Diagnostic, For/Nxt Loop, Search, Sort are not in IEC1131-3
Extensions to the instruction set are permitted so that vendors can add instructions
that their customers need
All vendors have defined their own set of extensions
Bibliography