Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
S5-100U
Programmable Controller
CPU 100/102/103
Reference Guide
Order No.
6ES5 997-8MA21
2
Index
Page
Explanations of the Operations List 1
Explanations of the Operands 2
Basic Operations
Boolean Logic Operations 6
Set/Reset Operations 6
Load Operations 8
Transfer Operations 12
Timer Operations 14
Counter Operations 16
Arithmetic Operations 16
Comparison Operations 18
Block Call Operations 18
Return Operations 20
”No” Operations 20
Stop Operations 22
Display Generation Operations 22
Supplementary Operations
Boolean Logic Operations 24
Bit Operations 24
Set/Reset Operations 26
Timer and Counter Operations 28
Load and Transfer Operations 30
Conversion Operations 32
Shift Operations 32
Jump Operations 32
Other Operations 34
System Operations
Set Operations 38
Load and Transfer Operations 38
Block Call Operations and Return Operations 38
Jump Operations 40
Arithmetic Operations 40
Other Operations 40
Machine Code Listing 42
Alphabetical Index of Operations 50
Integral Blocks
Integral Organization Blocks 52
Integral Function Blocks 53
Integral Data Block 1 54
Evaluation of CC 1 and CC 0 56
Explanation of the
Operations List
Abbreviation Explanation
C Counter
- remanent 0 to 7 0 to 7 0 to 7
- not remanent 8 to 15 8 to 127 8 to 127
- for the bit test and 0 to 15 0 to 127 0 to 127
set operations 0.0 to
(system operat.) 127.15
FB Flag byte
- remanent 0 to 62 0 to 255
- not remanent 64 to 126 64 to 254
FW Flag word
- remanent 0 to 62 0 to 255
- not remanent 64 to 126 64 to 254
KH Constant 0 to FFFF
(hexadecimal code)
I, Q, F typ. 4
AN N Y N 1,6 0,8 Scan operand for “0” and combine with RLO through
T, C 75 9 logic AND.
I, Q, F typ. 4
O N Y N 1,6 0,8 Scan operand for “1” and combine with RLO through
T, C 75 7 logic OR.
I, Q, F typ. 4
ON N Y N 1,6 0,8 Scan operand for “0” and combine with RLO through
T, C 80 9 logic OR.
Set/Reset Operations
typ.
S I, Q, F Y N Y 70 7 1,6 0,8 Set operand to “1”.
Basic Operations
For organization blocks (OB) For function blocks (FB)
For program blocks (PB) For sequence blocks (SB)
typ.
= I, Q, F N N Y 70 6 1,6 0,8 Assign value of RLO to operand.
Load Operations
L IB N N N 59 14 1,6 0,8 Load an input byte from the PII into ACCU 1.
L QB N N N 63 14 1,6 0,8 Load an output byte from the PIQ into ACCU 1.
typ.
L T, C N N N 70 19 1,6 0,8 Load a time or count (in binary code) into ACCU 1.
LC T, C N N N 125 69 154 1,8 Load times or counts (in BCD) into ACCU 1.
Transfer Operations
Timer Operations
SS T Y N Y 127 76 150 1,9 Start a stored on-delay timer (stored in ACCU 1).
Counter Operations
Arithmetic Operations
Comparison Operations
Compare two fixed-point numbers for “equal to”:
!=F N Y N 79 24 1,6 0,8 If ACCU 2=ACCU 1, the RLO is “1”.
CC 1/CC 0 are affected.
Return Operations
“No” Operations
Stop Operations
Bit Operations
TBN T, C N Y N -- -- 188 124 Test a bit of a timer or counter word for “0”.
Set/Reset Operations
Formal operand Enable formal operand (timer/ counter) for cold restart
FR= Y N Y -- -- 194* 145*
T, C (for detailed description, see “FR” operation).
Formal operand Start a timer (formal operand) as pulse with the value
SP= T Y N Y -- -- 194* 145* stored in ACCU 1.
Formal operand Start an on-delay timer (formal operand) with the value
SD= T Y N Y -- -- 194* 145* stored in ACCU 1.
Formal operand Load the value of the formal operand in BCD code into
LC= T, C N N N -- -- 194* 145* ACCU 1.
Conversion Operations
Shift Operations
Jump Operations
JU Symb. address
= max. 4 charact. N N N 62 2 1,6 0,8 Jump unconditionally to the symbolic address.
JZ Symb. address Jump if the result is zero. The jump is made only if CC
N N N 69 6 1,6 0,8
= max. 4 charact. 1=0 and CC 0=0. The RLO is not changed.
JM Symb. address Jump if the sign of the result is “-”. The jump is made
= max. 4 charact. N N N 71 6 1,6 0,8 only if CC 1=0 and CC 0=1. The RLO is not changed.
Other Operations
Disable interrupt. Input/output interrupt or timer OB
IA N N N -- -- 58 24 processing is disabled.
Enable interrupt.
RA N N N -- -- 58 26 This operation cancels the effect of IA.
Set Operations
13+
Parameter n·19 97+ 75+
TNB n=0 ... 255 N N N -- Transfer a field byte by byte (number of bytes 0 to 255).
(48+ n·21 n·16
n·19)
Jump Operation
Jump at random within a function block (jump distance
JUR N N N -- -- 131 82 -32768 to + 32767)
Arithmetic Operations
Other Operations
Machine Code
Oper- Oper-
B0 B1 B2 B3 ation and
L R L R L R L R
0 0 0 0 NOP 0
0 1 0 0 CFW
0 2 0d 0d L T
0 3 0l 0l TNB
0 4 0d 0d FR T
0 5 0 0 BEC
0 6 0c 0c FR=
0 7 0c 0c A=
0 8 0 0 IA
0 8 8 0 RA
0 9 0 0 CSW
0 A 0a 0a L FY
0 B 0a 0a T FY
0 C 0d 0d LC T
0 D 0i 0i JO=
Machine Code
Oper- Oper-
B0 B1 B2 B3 ation and
L R L R L R L R
0 E 0c 0c LC=
0 F 0c 0c O=
1 0 8 2 BLD 130
1 0 8 3 BLD 131
1 0 8 4 BLD 132
1 0 8 5 BLD 133
1 0 F F BLD 255
1 1 0n 0n I
1 2 0a 0a L FW
1 3 0a 0a T FW
1 4 0d 0d SF T
1 5 0i 0i JP=
1 6 0c 0c SFD=
1 7 0c 0c S=
1 9 0n 0n D
1 C 0d 0d SE T
1 D 0f 0f JC FB
1 E 0c 0c SEC=
1 F 0c 0c ==
2 0 0f 0f C DB
2 1 2 0 >F
2 1 4 0 <F
2 1 6 0 ><F
2 1 8 0 !=F
2 1 A 0 >=F
Machine Code
Oper- Oper-
B0 B1 B2 B3 ation and
L R L R L R L R
2 1 C 0 <=F
2 2 0g 0g L DL
2 3 0g 0g T DL
2 4 0d 0d SD T
2 5 0i 0i JM=
2 6 0c 0c SD=
2 7 0c 0c AN=
2 8 0e 0e L KB
2 A 0g 0g L DR
2 B 0g 0g T DR
2 C 0d 0d SS T
2 D 0i 0i JU=
2 E 0c 0c SSU=
2 F 0c 0c ON=
3 0 0 1 0e 0e 0e 0e L KC
3 0 0 2 0e 0e 0e 0e L KT
3 0 0 4 0e 0e 0e 0e L KF
3 0 1 0 0e 0e 0e 0e L KS
3 0 2 0 0e 0e 0e 0e L KY
3 0 4 0 0e 0e 0e 0e L KH
3 0 8 0 0e 0e 0e 0e L KM
3 2 0g 0g L DW
3 3 0g 0g T DW
3 4 0d 0d SP T
3 5 0i 0i JN=
3 6 0c 0c SP=
Machine Code
Oper- Oper-
B0 B1 B2 B3 ation and
L R L R L R L R
3 7 0c 0c RB=
3 C 0d 0d R T
3 D 0f 0f JU FY
3 E 0c 0c RD=
3 F 0c 0c LW=
4 0 0 0k LIR
4 1 0 0 AW
4 2 0o 0o L C
4 4 0o 0o FR C
4 5 0i 0i JZ=
4 6 0c 0c L=
4 8 0 0k TIR
4 9 0 0 OW
4 A 0a 0a L IB
4 A 8a 0a L QB
4 B 0a 0a T IB
4 B 8a 0a T QB
4 C 0o 0o LC C
4 D 0f 0f JC OB
4 E 0g 0g DO FW
5 0 0e 0e ADD BF
5 1 0 0 XOW
5 2 0a 0a L IW
5 2 8a 0a L QW
5 3 0a 0a T IW
5 3 8a 0a T QW
Machine Code
Oper- Oper-
B0 B1 B2 B3 ation and
L R L R L R L R
5 4 0o 0o CD C
5 5 0f 0f 0e 0e 0e 0e JC PB
5 8 0 0 ADD KF
5 9 0 0 -F
5 C 0o 0o S C
5 D 0f 0f JC SB
6 1 0h 0h SLW
6 2 0g 0g L RS
6 3 0g 0g T RS
6 5 0 0 BE
6 5 0 1 BEU
6 6 0c 0c T=
6 9 0h 0h SRW
6 C 0o 0o CU C
6 D 0f 0f JU OB
6 E 0g 0g DO DW
7 0 0 0 STS
7 0 0 2 TAK
7 0 0 3 STP
7 0 0 B JUR
7 0 1 5 C 0 0o 0o TB C
7 0 1 5 8 0 0o 0o TBN C
7 0 1 5 4 0 0o 0o SU C
7 0 1 5 0 0 0o 0o RU C
7 0 2 5 C 0 0d 0d TB T
7 0 2 5 8 0 0d 0d TBN T
Machine Code
Oper- Oper-
B0 B1 B2 B3 ation and
L R L R L R L R
7 0 2 5 4 0 0d 0d SU T
7 0 2 5 0 0 0d 0d RU T
7 0 4 6 C 0b 0g 0g TB D
7 0 4 6 8 0b 0g 0g TBN D
7 0 4 6 4 0b 0g 0g SU D
7 0 4 6 0 0b 0g 0g RU D
7 0 5 7 C 0b 0g 0g TB RS
7 0 5 7 8 0b 0g 0g TBN RS
7 0 5 7 4 0b 0g 0g SU RS
7 0 5 7 0 0b 0g 0g RU RS
7 2 0d 0d L PB
7 3 0d 0d T PB
7 5 0f 0f JU PB
7 6 0c 0c DO=
7 8 0 5 0 0 0f 0f G DB
7 9 0 0 +F
7 A 0a 0a L PW
7 B 0a 0a T PW
7 C 0o 0o R C
7 D 0f 0f JU SB
8 0b 0a 0a A F
8 8b 0a 0a O F
9 0b 0a 0a S F
9 8b 0a 0a = F
A 0b 0a 0a AN F
A 8b 0a 0a ON F
Machine Code
Oper- Oper-
B0 B1 B2 B3 ation and
L R L R L R L R
B 0b 0a 0a R F
B 8 0o 0o A C
B 9 0o 0o O C
B A 0 0 A(
B B 0 0 O(
B C 0o 0o AN C
B D 0o 0o ON C
B F 0 0 )
C 0b 0a 0a A I
C 0b 8a 0a A Q
C 8b 0a 0a O I
C 8b 8a 0a O Q
D 0b 0a 0a S I
D 0b 8a 0a S Q
D 8b 0a 0a = I
D 8b 8a 0a = Q
E 0b 0a 0a AN I
E 0b 8a 0a AN Q
E 8b 0a 0a ON I
E 8b 8a 0a ON Q
F 0b 0a 0a R I
F 0b 8a 0a R Q
F 8 0d 0d A T
F 9 0d 0d O T
F A 0i 0i JC=
F B 0 0 O
Machine Code
Oper- Oper-
B0 B1 B2 B3 ation and
L R L R L R L R
F C 0d 0d AN T
F D 0d 0d ON T
F F F F NOP 1
Alphabetical Index
of Operations
Operation Page Operation Page
SD 16, 44 ) 6, 48
SD= 28, 44 = 8, 47, 48
SE 14, 43 == 28, 43
SEC= 28, 43 +F 16, 47
SF 16, 43 -F 16, 46
OB2
OB1
aaaaaaaaaaaa
OB31
OB34
OB22
OB21
OB13
OB251
aaaaaaaaaaaa
OB-No.
Function
processing
operating system
Battery failure
100
aaaaaaaaaaaaaa aaaaaaa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aaaaaaaaaaaaaaaa
103
FB integrated in
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Integral Data Block 1
Parameter Argument Meaning
Block ID: SL1: SINEC L1
wd=1 ... 7 (weekday=Sun ... Sat) mn=00 ... 59 (minutes) x=2 ... 255
dd=01 ... 31 (day) ss=00 ... 59 (seconds) y=0 ... 255
mm=01 ...12 (month) hhhhhh=0 ... 999999 (hours) z=0 ... 254
yy=0 ... 99 (year) p=– 400 ... 400 j/J=ja (yes)
hh=00 ... 23 (hours) v=0 ... 126 y/Y=yes
n/N=no
1 If an argument such as seconds, for example, is not to be 2 If you input AM or PM after the clock time, the clock runs
entered, input XX. The clock continues to run with the in the 12-hour mode. If you omit this argument, the clock
updated data. The TIS parameter block does not runs in the 24-hour mode. You must use the same time
acknowledge this argument. mode in the SET and TIS parameter blocks.
Evaluation
of CC 1 and CC 0
ACCU 2 shifted
Result Result
0 0 = bit =0 -
=0 =0
ACCU 1
ACCU 2
Result Result
0 1 - < -
<0 <0
ACCU 1
ACCU 2 shifted
Result Result Result
1 0 > bit =1
>0 0 >0
ACCU 1
Siemens AG Should you come across
AUT E1114B any printing errors when
Postfach 1963 reading this publication,
we would ask you to
Werner-von-Siemens-
inform us using this
Str. 50 form. We would also
welcome any
D-92209 Amberg suggestions you may
Fed. Rep. of Germany have for improvement
From
Name
Company/Department
Address
Telephone
Publication:
Programmable Controller
SIMATIC S5-100U (CPU 100/102/103)
Reference Guide
Suggestions / Corrections:
Siemens AG
Automation Group
Industrial Automation Systems
Postfach 4848, 8500 Nürnberg 1
© Siemens AG 1992
Subject to change without prior notice
Siemens Aktiengesellschaft
Order No. 6ES5 997-8MA21
Printed in the Fed. Rep. of Germany