Professional Documents
Culture Documents
1
Introduction
2
Introduction
Parallel branch
process process
process process
Selective branch
process
3
Operation
4
Operation example
5
Operation example
6
Operation example
Assign devices of a PLC in the created process drawing.
Assign a state relay to a rectangle indicating a process. At this time, assign a state
relay (S0 to S9) to the initial process.
After the first process, arbitrarily assign state relay numbers (S20 to S899) except
the initial state relays. There are latched (battery backed) type state relays(S500
to S899) whose ON/OFF status is stored against power failure.
The state relays S10 to S19 are used for special purposes when the IST (Initial
State - FNC 60) instruction is used.
Assign a device to each transfer condition. NO contact and NC contact are
available for a transfer condition. If there are two or more transfer conditions,
AND circuit or OR circuit is available.
Assign a device (output terminal number connected to external equipment, timer
number, etc.) used for an operation performed in each process. Many devices
such as timers, counters and auxiliary relays are provided in a PLC, and can be
used arbitrarily.
If there are two or more loads such as timers and counters which are driven at
the same time, two or more circuits can be assigned to one state relay.
When performing repeated operations or skipping some processes (jump
operation), use “” and specify the jump destination state relay number.
7
Operation example
A circuit for setting the initial state relay to ON is required to execute the
SFC program
8
Operation example
9
Notes
10
Notes
11
Notes
“•” is automatically
displayed in the transfer
destination state relay.
12
Notes
13
Notes
Jump
14
Notes
15
Notes
Repeat
16
Notes
17
Example
18
Example
Fountain control
1) Cyclic operation (X001 = OFF, X002 = OFF)
When the start button X000 is pressed, the outputs turn ON in the
order “Y000 (wait indication) → Y001(center lamp) → Y002 (center
fountain) → Y003 (loop line lamp) → Y007 (loop line fountain) →
Y000(wait indication)”, and then the outputs return to the wait
status. Each output is switched in turn every 2 seconds by a timer.
2) Continuous operation (X001 = ON)
Y001 to Y007 turn ON in turn repeatedly.
3) Stepping operation (X002 = ON)
Every time the start button is pressed, each output turns ON in turn.
19
Example
20
STep Ladder (STL)
21
STep Ladder (STL)
22
STep Ladder (STL)
23
24
Selective branch
25
Selective recombination
26
Parallel branch
27
Parallel recombination
28
Importance Note
29
Appendix: Advanced Functions
30
Introduction
32
Summary
33
Note
34
CMP (Compare) function
Operand
Mnemonic Description Step
S1 S2 D
CMP, CMPP
Compare two Y, M, S
K, H 7 steps.
values. Results: Note: Using 3
CMP KnX; KnY; KnM; KnS DCMP;
smaller; equal or bits
T, C, D, V, Z DCMPP
larger. consecutively
13 steps
CMP: the comparison value (S1) and the comparison source (S2) are compared
each other.
[S1] [S2] [D]
X0
CMP K50 C25 M1 S2 < S1 ((value in counter C25 is smaller than K
= 50), bit D (M1) is ON.
M1
C 25 < K 50; M 1 ON
S2 = S1 ((value in counter C25 is equal K = 50),
M2 bit D+1 (M2) is ON.
C 25 = K 50; M2 ON S2 > S1 ((value in counter C25 is larger than K =
M3 50), bit D+2 (M3) is ON.
C 25 > K 50; M3 ON
35
ZCP (Zone compare) function
ZCP (Zone Compare): compares two values (S1 & S2) with the
comparison source (S3).
Operand
Mnemonic Description Step
S1 S2 S3 D
36
MOV (Move) function
X0 [S] [D]
MOV H0050 D10
37
BCD (Binary Coded Decimal) function
Operand
Mnemonic Description Step
S D
BCD, BCDP
Convert binary data of
5 steps.
[S] to BCD data and KnX; KnY; KnM; KnS KnY; KnM; KnS
BCD DBCD ;
transfer the converted T, C, D, V, Z T, C, D, V, Z
DBCDP
BCD data to [D]
9 steps
X0 [S] [D]
BCD D20 K2Y0 K2Y0: 2x4bit = Y000 ÷ Y007
38
BCD (Binary Coded Decimal) function
A program shows the time on the 7-segment LED with C000 for
second; C001 for minute; and C002 for hour. I/O of PLC is shown
in the following figure.
X003
BCD C000 K2Y000
39
BIN (Binary) function
BIN (Binary):
Convert BCD data into binary data.
Use this function to convert a BCD value set by a digital switch
(Thumbwheel switch) into binary value and to receive the converted
binary data.
Operand
Mnemonic Description Step
S D
BIN, BINP:
5 steps.
Convert BCD data into KnX; KnY; KnM; KnS KnY; KnM; KnS
BIN DBIN,
binary data T, C, D, V, Z T, C, D, V, Z
DBINP:
9 steps
X0 [S] [D]
BIN K2X0 D13
40
Arithmetic and Logical Operation functions
ADD (Addition)
SUB (Subtraction)
MUL (Multiply)
DIV (Division)
INC (Increment)
DEC (Decrement)
41
INC (Increment) function
Operand
Mnemonic Description Step
D
X0 [D]
INC D10
42
DEC (Decrement) function
Operand
Mnemonic Description Step
D
Decrement the data of
KnY; KnM; KnS DEC, DECP : 3 steps.
DEC the specified device by
T, C, D, V, Z DDEC; DDECP : 5 steps
“1”
X1 [D]
DEC D10
43
ADD (Addition) function
Mnemo Operand
Description Step
nic S1 S2 D
Add two values KnY; KnM;
K, H, KnX; KnY; ADD, ADDP : 7 steps
(S1 + S2) and KnS
ADD KnM; KnS DADD; DADDP : 13
save the result T, C, D, V,
T, C, D, V, Z steps
to D Z
44
SUB (Subtraction) function
Mnemo Operand
Description Step
nic S1 S2 D
Subtract two KnY; KnM;
K, H, KnX; KnY; SUB, SUBP : 7 steps
values (S1 – KnS
SUB KnM; KnS DSUB; DSUBP : 13
S2) and save T, C, D, V,
T, C, D, V, Z steps
the result to D Z
45
MUL (Multiplication) function
Mnemo Operand
Description Step
nic S1 S2 D
Multiply two KnY; KnM;
K, H, KnX; KnY; MUL, MULP : 7 steps
values (S1 * KnS
MUL KnM; KnS DMUL; DMULP : 13
S2) and save T, C, D, V,
T, C, D, V, Z steps
the result to D Z(V)
46
DIV (Division) function
Mnemoni Operand
Description Step
c S1 S2 D
Divide two values KnY; KnM;
K, H, KnX; KnY; DIV, DIVP: 7 steps
(S1 / S2) and KnS
DIV KnM; KnS DDIV; DDIVP: 13
save the result to T, C, D, V,
T, C, D, V, Z steps
D Z(V)
47