Siemens CPU 412-2, CPU 414-2, CPU 412, CPU 414-3, CPU 414, CPU 414-4H, CPU 416-2, CPU 416F-2, CPU 416-3, CPU 417, CPU 417-4, CPU 416, CPU 417-4 H Instruction Manual
Disclaimer of LiabilityCopyright Siemens AG 2004 All rights reserved
The reproduction, transmission or use of this document or its
contents is not permitted without express written authority.
Offenders will be liable for damages. All rights, including rights
created b y patent grant or registration of a utility model or design, are
reserved.
Siemens AG
Bereich Automation and Drives
Geschaeftsgebiet Industrial Automation Systems
Postfach 4848, D- 90327 Nuernberg
Siemens Aktiengesellschaft6ES7498-8AA04-8BN0
We have checked the contents of this manual for agreement with the
hardware and software described. Since deviations cannot be
precluded entirely, we cannot guarantee full agreement. However,
the data in this manual are reviewed regularly and any necessary
corrections included in subsequent editions. Suggestions for
improvement are welcomed.
Siemens AG 2004
Subject to change without prior notice
This list of instructions applies to the CPUs listed below.
NameOrder numbersubsequently described as*
CPU 412-16ES7412-1XF04-0AB0
CPU 412-26ES7412-2XG04-0AB0
CPU 414-26ES7414-2XG04-0AB0
CPU 414-36ES7414-3XJ04-0AB0
CPU 414-4H6ES7414-4HJ04-0AB0
CPU 416-26ES7416-2XK04-0AB0
CPU 416F-26ES7416-2FK04-0AB0
CPU 416-36ES7416-3XL04-0AB0
CPU 417-46ES7417-4XL04-0AB0
CPU 417-4 H6ES7417-4HL04-0AB0
*except in the tables, where a detailled differentiation is necessary
Applicability
CPU 414
CPU 416
S7-400 Instruction List
A5E00267845-01
5
Page 8
Address Identifier and Parameter Ranges
Description
Address Identifier and Parameter Ranges
Addr.Parameter RangeDescription
IDCPU 412CPU 414CPU 416CPU 417
**
Q
**
QB
**
QW
**
QD
DBX0.0 to 65533.7*0.0 to 65533.70.0 to 65533.70.0 to 65533.7Data bit in data block
DB1 to 5111 to 40951 to 40951 to 8191Data block
DBB0 to 65533*0 to 655330 to 655330 to 65533Data byte in DB
DBW0 to 65532*0 to 655320 to 655320 to 65532Data word in DB
DBD0 to 65530*0 to 655300 to 655300 to 65530Data double word in DB
DIX0.0 to 65533.7*0.0 to 65533.70.0 to 65533.70.0 to 65533.7Data bit in instance DB
DI1 to 5111 to 40951 to 40951 to 8191Instance data block
DIB0 to 65533*0 to 655330 to 655330 to 65533Data byte in instance DB
DIW
DID0 to 65530*0 to 655300 to 655300 to 65530Data double word instance DB
*Also restricted by the size of the working memory.
** Default setting can be changed, see Technical Specifications
0.0 to 127.70.0 to 255.70.0 to 511.70.0 to 1023.7Output (in PIQ)
0 to 1270 to 2550 to 5110 to 1023Output byte (in PIQ)
0 to 1260 to 2540 to 5100 to 1022Output word (in PIQ)
0 to 1240 to 2520 to 5080 to 1020Output double word (in PIQ)
0 to 65532*0 to 655320 to 655320 to 65532Data word in instance DB
S7-400 Instruction List
A5E00267845-01
6
Page 9
Address Identifier and Parameter Ranges
Description
Address Identifier and Parameter Ranges, continued
Addr.Parameter RangeDescription
IDCPU 412CPU 414CPU 416CPU 417
I**0.0 to 127.70.0 to 255.70.0 to 511.70.0 to 1023.7Input bit (in PII)
IB**0 to 1270 to 2550 to 5110 to 1023Input byte (in PII)
IW**0 to 1260 to 2540 to 5100 to 1022Input word (in PII)
ID**0 to 1240 to 2520 to 5080 to 1020Input double word (in PII)
L**0.0 to 4095.70.0 to 8191.70.0 to 16383.70.0 to 32767.7Local data
LB**0 to 40950 to 81910 to 163830 to 32767Local data byte
LW**0 to 40940 to
8190
LD**0 to 40920 to 81880 to 163800 to 32764Local data double word
M0.0 to 4095.70.0 to 8191.70.0 to 16383.70.0 to 16383.7Bit memory
MB0 to 40950 to 81910 to 163830 to 16383memory byte
MW0 to 40940 to 81900 to 163820 to 16382memory word
MD0 to 40920 to 81880 to 163800 to 16380memory double word
** Default setting can be changed, see Technical Specifications
0 to 163820 to 32766Local data word
S7-400 Instruction List
A5E00267845-01
7
Page 10
Address Identifier and Parameter Ranges
Description
Address Identifier and Parameter Ranges, continued
Addr.Parameter RangeDescription
IDCPU 412CPU 414CPU 416CPU 417
PQB0 to 40950 to 81910 to 163830 to 16383Peripheral output byte
PQW0 to 40940 to 81900 to 163820 to 16382Peripheral output word
PQD0 to 40920 to 81880 to 163800 to 16380Peripheral output double word
PIB0 to 40950 to 81910 to 163830 to 16383Peripheral input byte
PIW0 to 40940 to 81900 to 163820 to 16382Peripheral input word
PID0 to 40920 to 81880 to 163800 to 16380Peripheral output double word
T0 to 20470 to 20470 to 20470 to 2047Timer
C0 to 20470 to 20470 to 20470 to 2047Counter
(direct I/O access)
(direct I/O access)
(direct I/O access)
(direct I/O access)
(direct I/O access)
(direct I/O access)
S7-400 Instruction List
A5E00267845-01
8
Page 11
Constants and Ranges
ConstantRangeDescription
B(b1,b2)
B(b1,b2,b3,b4)
D# Date–IEC date constant
L# Integer–32-bit integer constant
P# Bit pointer–Pointer constant
S5T# Time value–S7 time constant
T# TIme value
TOD# Time value–IEC time constant
C# Count value–Counter constant (BCD code)
2#n–Binary constant
W#16#
DW#16#
1)
For loading of S7 timers.
–Constant, 2 or 4 bytes
1)
–
–Hexadecimal constant
Time constant
Constants and Ranges
S7-400 Instruction List
A5E00267845-01
9
Page 12
Abbreviations and Mnemonics
The following abbreviations and mnemonics are used in the Instruction List:
bBit address
cAddress areaI, Q, M, L, DBX, DIX
dAddress in: MD, DBD, DID or LD
eNumber in: MW, DBW, DIW or L W
fTimer/counter No.
Abbreviations and Mnemonics
gAddress areaIB, QB, PIB, PQB, MB, LB,
hAddress areaIW, QW, PIW, PQW, MW,
iAddress areaID, QD, PID, PQD, MD, LD,
qBlock No.
S7-400 Instruction List
A5E00267845-01
DBB, DIB
LW, DBW, DIW
DBD, DID
11
Page 14
Registers
Registers
ACCU1 to ACCU4 (32 Bits)
The accumulators are registers for processing bytes, words or double words. The address identifiers are loaded into the accumulators,
where they are logically gated. The result of the logic operation (RLO) is in ACCU1 and can be transferred from there to a memory cell.
The accumulators are 32 bits long.
Accumulator designations :
ACCUBits
ACCUx (x = 1 to 4)Bit 0 to 31
ACCUx-LBit 0 to 15
ACCUx-HBit 16 to 31
ACCUx-LLBit 0 to 7
ACCUx-LHBit 8 to 15
ACCUx-HLBit 16 to 23
ACCUx-HHBit 24 to 31
S7-400 Instruction List
A5E00267845-01
12
Page 15
Registers
Address Registers AR1 and AR2 (32 Bits)
The address registers contain the area-internal or area-crossing pointers for instructions using indirect addressing. The address registers
are 32 bits long.
The area-internal and/or area-crossing pointers have the following syntax:
The status word bits are evaluated or set by the instructions.
The status word is 16 bits long.
BitAssignmentDescription
0FCFirst check bit
1RLOResult of logic operation
2STAStatus
3OROr (AND before OR)
4OSStored overflow
5OVOverflow
6CC 0Condition code 0
7CC 1Condition code 1
8BRBinary result
9 to 15Unassigned –
Registers
S7-400 Instruction List
A5E00267845-01
14
Page 17
Examples of Addressing
Addressing ExamplesDescription
Immediate Addressing
L +27Load 16-bit integer constant “27” into ACCU1
L L#-1Load 32-bit integer constant “-1” into ACCU1
L 2#1010101010101010Load binary constant into ACCU1
L DW#16#A0F0BCFDLoad hexadecimal constant into ACCU1
L ’ENDE’Load ASCII character into ACCU1
L T#500 msLoad time value into ACCU1
L C#100Load count value into ACCU1
L B#(100,12)Load 2-byte constant
L B#(100,12,50,8)Load 4-byte constant
L P#10.0Load area-internal pointer into ACCU1
L P#E20.6Load area-crossing pointer into ACCU1
L -2.5Load real number into ACCU1
L D# 1995-01-20Load date
L TOD 13:20:33.125Load time of day
Examples of Addressing
S7-400 Instruction List
A5E00267845-01
15
Page 18
Examples of Addressing
Addressing ExamplesDescription
Direct Addressing
A I 0.0ANDing of input bit 0.0
L IB 1Load input byte 1 into ACCU1
L IW 0Load input word 0 into ACCU1
L ID 0Load input double word 0 into ACCU1
Indirect Addressing of Timers/Counters
SP T [LW 8]Start timer; the timer number is in local data word 8
CU C [LW 10 ]Count upwards; the counter number is in local data word 10
Area-Internal Memory-Indirect Addressing
A I [LD 12]
Example: L P#22.2
T LD 12
A I [LD 12]
A I [DBD 1]AND operation: The address of the input is in data double word 1 of the open DB as pointer
A I [DID 12]AND operation: The address of the output is in data double word 12 of the open instance DB as pointer
A I [MD 12]AND operation: The address of the output is in memory double word 12 as pointer
AND operation: The address of the input is in local data double word 12 as pointer
S7-400 Instruction List
A5E00267845-01
16
Page 19
Examples of Addressing
Examples of Addressing, continued
Addressing Examples
Area-Internal Register-Indirect Addressing
A I [AR1,P#12.2]
Area-Crossing Register-Indirect Addressing
For area-crossing register-indirect addressing, the address must also contain an area identifier. The address is in the address register.
The area identifiers are as follows:
AreaCodingArea
identifier (binary)hex.
P1000 000080I/O area
I1000 000181Input area
Q1000 001082Output area
M1000 001183Bit memory area
DB1000 010084Data area
DI1000 010185Instance data area
L1000 011086Local data area
VL1000 011187Predecessor local data area (access to local data of invoking block)
L B [AR1,P#8.0]
A [AR1,P#32.3]
Addressing Via Parameters
A Parameter
S7-400 Instruction List
A5E00267845-01
17
Page 20
Examples of how to calculate the pointer
Examples of how to calculate the pointer
• Example for sum of bit addressesx7:
LAR1 P#8.2
A I [AR1,P#10.2]
Result:Input 18.4 is addressed (by adding the byte and bit addresses)
• Example for sum of bit addressesu7:
L P#10.5
LAR1
A I [AR1,P#10.7]
Result:Input 21.4 is addressed (by adding the byte and bit addresses with carry over)
S7-400 Instruction List
A5E00267845-01
18
Page 21
Execution Times with Indirect Addressing1
Execution Times with Indirect Addressing1
When using indirect addresses statement consists of two parts:
Part 1: Load the address of the instruction
Part 2: Execute the instruction
In other words, when working with indirect addresses, you must calculate the execution time of an instruction from these two parts.
Calculating the Execution Time
The total execution time is calculated as follows:
+execution time of the instruction
=Total execution time of the instruction
The execution times listed in the chapter entitled “List of Instructions” apply to the execution times of the second part of an instruction, i.e.
for the actual execution of an instruction.
Y ou must then add the time required for loading the address of the instruction to this execution time (see following Table).
S7-400 Instruction List
A5E00267845-01
Time required for loading the address
19
Page 22
Execution Times with Indirect Addressing1
The execution time for loading the address of the instruction from the various areas is shown in the following table.
*Address registers AR1/AR2 do not need to be loaded in separate cycles for addressing.
The pages that follow contain examples for calculating the instruction run time for the various indirectly addressed instructions.
S7-400 Instruction List
A5E00267845-01
20
Page 23
Examples of Calculations
Examples of Calculations
Y ou will find a few examples here for calculating the execution times for the various methods of indirect addressing.
Calculating the Execution Times for Area-Internal Memory-Indirect Addressing
Example:A I [DBD 12] with CPU 414
Step 1:Load the contents of DBD 12 (time required is listed in the table on page 20)
Address is in ...Execution Time in s
Bit memory area M
Data block DB/DX
Step 2:AND the input addressed in this way (you will find the execution time in the tables in the chapter entitled “List of Instruc-
tions” on page 25)
Total execution time:
+ 0.06 s
0.18 s
0.24 s
Word
Double word
Word
Double word
Direct AddressingIndirect Addressing
0.06/0.075
:
Typical Execution T ime in s
Time for A I
0.2
0.3
0.2
0.3
0.06+
:
S7-400 Instruction List
A5E00267845-01
21
Page 24
Examples of Calculations
Execution Time for Area-Crossing Register-Indirect Addressing
Example:A [AR1, P#23.1] ... with I 1.0 in AR1 with CPU 416
Step 1:Load the contents of AR1, and increment them by the offset 23.1 (the time required is in the table on page 20)
Address is in ...Execution Time in s
::
AR1/AR2 (area-crossing)0.00
::
Step 2:AND link of the input addressed this way (see page 25 for the execution time)
Typical Execution T ime in s
Direct AddressingIndirect Addressing
Total execution time:
0.00 s
+ 0.05 s
0.05 s
0.04/0.05
:
Time for A I
0.05+
:
S7-400 Instruction List
A5E00267845-01
22
Page 25
Execution Time for Addressing Via Parameters
ExampleA Parameter ... with I 0.5 in the block parameter list with CPU 414
Step 1:Load input I 0.5 addressed via the parameter (the time required is in the table on page 20)
Address is in ...Execution Time in s
::
:
Parameter (double word)0.24
Step 2:AND link of the input addressed this way (see page 25 for the execution time)
Direct AddressingIndirect Addressing
:
Typical Execution T ime in s
Examples of Calculations
Total execution time
0.24 s
+ 0.05 s
0.315 s
S7-400 Instruction List
A5E00267845-01
0.06/0.075
:
Time for A I
0.075+
:
23
Page 26
List of Instructions
List of Instructions
This chapter contains the complete list of instructions for the S7-400 CPUs. The descriptions have been kept as concise as possible. You
will find a detailed functional description in the various STEP 7 reference manuals.
Please note that, in the case of indirect addressing (examples see page LEERER MERKER), you must add the time required for loading
the address of the particular instruction to the execution times listed (see page 20).
S7-400 Instruction List
A5E00267845-01
24
Page 27
Bit Logic Instructions
Instr.
Length
Execution Time in s
Instr.
Address
Length
Bit Logic Instructions
All logic instructions generate a result (new RLO). The first instruction in a logic string generates the new RLO from the signal state
scanned. The subsequent logic instructions generate the new RLO from the signal state scanned and the old RLO. The logic string ends
with an instruction which limits the RLO (e.g. a memory instruction); that is, the /FC bit is set to zero.
+ Plus time required for loading the address of the instruction (see page 20)
*)
**)With direct instruction addressing;Address area 0 to 255
***)I,Q,M,L / DB, DI
S7-400 Instruction List
A5E00267845-01
I/Q a.b
M a.b
L a.b
DBX a.b
DIX a.b
c [d]
c [AR1,m]
c [AR2,m]
[AR1,m]
[AR2,m]
Parameter
With direct instruction addressing;Address area 0 to 127
Input/output
Bit memory
Local data bit
Data bit
Instance data bit
Memory-indirect, area-internal***
Register-ind., area-internal (AR1)***
Register-ind., area-internal (AR2)***
Area-crossing (AR1)***
Area-crossing (AR2)***
Via parameter ***
+ Plus time required for loading the address of the instruction (see page 20)
*)
**)With direct instruction addressing; Address area 0 to 255
***)I,Q,M,L / DB, DI
S7-400 Instruction List
A5E00267845-01
Address
ID
I/Qa.b
Ma.b
La.b
DBXa.b
DIXa.b
c [d]
c [AR1,m]
c [AR2,m]
[AR1,m]
[AR2,m]
Parameter
With direct instruction addressing; Address area 0 to 127
OR/OR-NOT
Input/output
Bit memory
Local da
Data bit
Instance data bit
Memory-indirect, area-internal ***
Register-ind., area-internal (AR1) ***
Register-ind., area-internal (AR2) ***
Area-crossing (AR1) ***
Area-crossing (AR2) ***
Via parameter ***
Description
Length
in
Words
1*/2
1**/2
2
2
2
2
2
2
2
2
2
CPU 412CPU 414CPU 416CPU 417
0.1/0.125
0.1/0.125
0.125
0.2
0.2
0.1+/0.2+
0.125+/0.2+
0.125+/0.2+
0.125+/0.2+
0.125+/0.2+
0.125+/0.2+
0.06/0.075
0.06/0.075
0.075
0.12
0.12
0.06+/0.12+
0.075+/0.12+
0.075+/0.12+
0.075+/0.12+
0.075+/0.12+
0.075+/0.12+
0.04/0.05
0.04/0.05
0.05
0.08
0.08
0.04+/0.08+
0.05+/0.08+
0.05+/0.08+
0.05+/0.08+
0.05+/0.08+
0.05+/0.08+
0.03/0.042
0.03/0.042
0.042
0.09
0.09
0.03+/0.09+
0.042+/0.09+
0.042+/0.09+
0.042+/0.09+
0.042+/0.09+
0.042+/0.09+
26
Page 29
Bit Logic Instructions, continued
Address-
Instr.
Address-
Description
Lengt
Execution Time in s
h in
Words
Bit Logic Instructions
Instr.
ID
Lengt
h in
CPU 412CPU 414CPU 416CPU 417
X/XN
EXKLUSIV-OR/
EXKLUSIV-OR-NOT
E/Aa.b
Ma.b
La.b
DBXa.b
DIXa.b
c [d]
c [AR1,m]
c [AR2,m]
[AR1,m]
[AR2,m]
Parameter
Input/output
Bit memory
Local data bit
Data bit
Instance data bit
Memory-indirect, area-internal.
*)
Register-ind., area-internal (AR1)
Register-ind., area-internal (AR2)
Area-crossing (AR1)
Area-crossing (AR2)
Via parameter
*)
*)
*)
2
2
2
2
2
2
*)
2
*)
2
2
2
2
0.125
0.125
0.125
0.2
0.2
0.1+/0.2+
0.125+/0.2+
0.125+/0.2+
0.125+/0.2+
0.125+/0.2+
0.125+/0.2+
0.075
0.075
0.075
0.12
0.12
0.06+/0.12+
0.075+/0.12+
0.075+/0.12+
0.075+/0.12+
0.075+/0.12+
0.075+/0.12+
0.05
0.05
0.05
0.08
0.08
0.04+/0.08+
0.05+/0.08+
0.05+/0.08+
0.05+/0.08+
0.05+/0.08+
0.05+/0.08+
0.03+/0.09+
0.042+/0.09+
0.042+/0.09+
0.042+/0.09+
0.042+/0.09+
0.042+/0.09+
Status word for:X, XNBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––YesYes
Instruction affects:–––––0YesYes1
+Plus time required for loading the address of the instruction (see page 20)
*)
I,Q,M,L / DB, DI
S7-400 Instruction List
A5E00267845-01
0.042
0.042
0.042
0.09
0.09
27
Page 30
Bit Logic Instructions with Parenthetical Expressions
struc-
struc-
in
Bit Logic Instructions with Parenthetical Expressions
Saving the RLO and OR bits and the relevant function identifier (A, AN, ...) to the nesting stack. Seven nesting levels are possible per
block. After the right parenthesis, the logic operation indicated by the function identifier is performed on the saved RLO and the current
RLO; the current OR is overwritten with the saved OR.
In-
tion
U(AND left parenthesis10.10.060.040.03
UN(AND NOT left parenthesis10.10.060.040.03
O(OR left parenthesis10.10.060.040.03
ON(OR NOT left parenthesis10.10.060.040.03
X(Exclusive OR left parenthesis10.10.060.040.03
XN(EXKLUSIV-ODER-NICHT-Klam-
EXCLUSIVE OR/EXCLUSIVE OR NOT
Timer
Timer, memory-indirect addr.
Counter
Counter, mem.-indirect addr .
EXCLUSIVE OR timer/counter (addressing via parameter)
Length
in
Words
1*/2
2
1*/2
2
20.1+
2
2
2
2
20.1+
CPU 412CPU 414CPU 416CPU 417
0.1/0.125
0.1+
0.1/0.125
0.1+
0.1+
0.125
0.1+
0.125
0.1+
0.1+
0.06/0.075
0.06+
0.06/0.075
0.06+
0.06+
0.06+
0.075
0.06+
0.075
0.06+
0.06+
0.06+
0.04/0.05
0.04+
0.04/0.05
0.04+
0.04+
0.04+
0.05
0.04+
0.05
0.04+
0.04+
0.04+
0.03/0.042
0.03+
0.03/0.042
0.03+
0.03+
0.03+
0.042
0.03+
0.042
0.03+
0.03+
0.03+
32
Page 35
Word Logic Instructions with the Contents of Accumulator 1
Address
struc-
Address
Description
Length
in
Words
Word Logic Instructions with the Contents of Accumulator 1
Gating the contents of ACCU1 and/or ACCU1-L with a word or double word according to the appropriate function. The word or double word
is either specified in the instruction as an address or is in ACCU2. The result is in ACCU1 and/or ACCU1-L.
Status word for:UW, OW, XOWBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–ja00–––––
S7-400 Instruction List
A5E00267845-01
ID
OR 16-bit constant
Length
CPU 412CPU 414CPU 416CPU 417
20.1250.0750.050.042
Execution Time in s
33
Page 36
Word Logic Instructions with the Contents of Accumulator 1
Instruc-
Address
Instruc-
Address
Description
Length
in
Words
Word Logic Instructions with the Contents of Accumulator 1, continued
Length
tion
ADAND ACCU210.10.60.040.3
ADDW#16#p AND 32-bit constant30.1850.1120.0750.062
ODOR ACCU210.10.060.040.3
ODDW#16#p OR 32-bit constant30.1850.1120.0750.062
XODEXCLUSIVE OR ACCU210.10.060.040.03
XODDW#16#p EXCLUSIVE OR 32-bit constant30.1850.1120.0750.062
Status word for: UD, OD, XODBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–Yes00–––––
ID
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
S7-400 Instruction List
A5E00267845-01
34
Page 37
Evaluating Conditions Using AND, OR and EXCLUSIVE OR
Instruc-
Address
Instruc-
Address
Description
Length
in
Words
Evaluating Conditions Using AND, OR and EXCLUSIVE OR
All logic instructions generate a result (new RLO). The first instruction in a logic string generates the new RLO from the signal state
scanned. The subsequent logic instructions generate the new RL from the signal state scanned and the old RLO. The logic string ends with
an instruction which limits the RLO (e.g. a memory instruction); that is, the FC bit is set to zero.
Length
tion
A/AN
O/ON
X/XN
Status word for:A/AN/O/ON/X/XNBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–YesYes––Yes–YesYes
Instruction affects:–––––YesYesYes1
S7-400 Instruction List
A5E00267845-01
ID
AND/AND NOT
OR/OR-NOT
EXCLUSIVE OR/ EXCLUSIVE-OR-NOT
==0
>0Result>0
<0Result<0
<>0
Result=0
(A1=0 and A0=0)10.10.060.040.03
(CC1=1 and CC0=0)
(CC1=0 and CC0=1)
Result00
((CC1=0 and CC0=1) or (CC1=1 and
CC0=0))
CPU 412CPU 414CPU 416CPU 417
10.10.060.040.03
10.10.060.040.03
10.10.060.040.03
Execution Time in s
35
Page 38
Evaluating Conditions Using AND, OR and EXCLUSIVE OR
Instruc-
Address
Instruc-
Address
Description
Length
in
Words
Evaluating Conditions Using AND, OR and EXCLUSIVE OR, continued
Length
tion
A/AN
O/ON
X/XN
Status word for:A/AN/O/ON/X/XNBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–YesYes––Yes–YesYes
Instruction affects:–––––YesYesYes1
ID
>=0Result>=0
((CC1=1 and CC0=0) or (CC1=0 and
CC0=0))
<=0Result<=0
((CC1=0 and CC0=1) or (CC1=0 and
CC0=0))
CPU 412CPU 414CPU 416CPU 417
10.10.060.040.03
10.10.060.040.03
Execution Time in s
S7-400 Instruction List
A5E00267845-01
36
Page 39
Evaluating Conditions Using AND, OR and EXCLUSIVE OR
Evaluating Conditions Using AND, OR and EXCLUSIVE OR, continued
Instruc-
tion
A/AN
O/ON
X/XN
Status word for:A/AN/O/ON/X/XNBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:YesYesYesYesYesYes–YesYes
Instruction affects:–––––YesYesYes1
The current RLO is compared with the status of the instruction or “edge bit memory”. FP detects a change from “0” to “1”; FN detects a
change from “1” to “0”.
Instruc-
FP/FNI/Q a.b
Status word for:FP, FNBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––Yes–
Instruction affects:–––––0YesYes1
+ Plus time required for loading the address of the instruction (see page 20)
*)
Unnecessary if the bit being monitored is in the process image (local data of a block are only valid while the block is running).
**)
I, Q, M, L /DB, DI
S7-400 Instruction List
A5E00267845-01
M a.b
L a.b*
DBX a.b
DIX a.b
c [AR1,m] **
c [AR2,m] **
[AR1,m]**
[AR2,m]**
Parameter**
The positive/negative edge is
indicated by RLO = 1. The bit
)
addressed in the instruction is
the auxiliary edge bit memory
Length
in
2
2
2
2
2
2
2
2
2
2
CPU 412CPU 414CPU 416CPU 417
0.2
0.2
0.2
0.3
0.3
0.2+/0.3+
0.2+/0.3+
0.2+/0.3+
0.2+/0.3+
0.2+/0.3+
0.12
0.12
0.12
0.18
0.18
0.12+/0.18+
0.12+/0.18+
0.12+/0.18+
0.12+/0.18+
0.12+/0.18+
0.08
0.08
0.08
0.12
0.12
0.08+/0.12+
0.08+/0.12+
0.08+/0.12+
0.08+/0.12+
0.08+/0.12+
0.06
0.06
0.06
0.12
0.12
0.06+/0.12+
0.06+/0.12+
0.06+/0.12+
0.06+/0.12+
0.06+/0.12+
38
Page 41
Setting/Resetting Bit Addresses
Instruc-
Lengt
Execution Time in s
Instruc-
Address
Lengt
Setting/Resetting Bit Addresses
Assigning the value “1” or “0” to the addressed instruction when RLO = 1. The instructions can be dependent on the MCR (see page 97).
tion
S
R
ID
I/Qa.b
M a.b
La.b
DBX a.b
DIX a.b
c [d]
c [AR1,m]
c [AR2,m]
[AR1,m]
[AR2,m]
Parameter
Set addressed bit to “1”
Set addressed bit to “0”
Input/output
Bit memory
Local data bit
Data bit
Instance data bit
Memory-indirect, area-internal
Register-indirect, area-internal (AR1)
Register-indirect, area-internal (AR2)
Area-crossing (AR1)
Area-crossing (AR2)
Via parameter
Description
***
***
***
h in
Words
1*/2
1**/2
***
***
CPU 412CPU 414CPU 416CPU 417
0.2
0.2
2
2
2
2
2
2
2
2
2
0.2
0.3
0.3
0.2+/0.3+
0.2+/0.3+
0.2+/0.3+
0.2+/0.3+
0.2+/0.3+
0.2+/0.3+
0.12
0.12
0.12
0.18
0.18
0.12+/0.18+
0.12+/0.18+
0.12+/0.18+
0.12+/0.18+
0.12+/0.18+
0.12+/0.18+
0.08
0.08
0.08
0.12
0.12
0.08+/0.12+
0.08+/0.12+
0.08+/0.12+
0.08+/0.12+
0.08+/0.12+
0.08+/0.12+
Status word for:S, RBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––Yes–
Instruction affects:–––––0Yes–0
+ Plus time required for loading the address of the instruction (see page 20)
*)
With direct instruction addressing; Address area 0 to 127
**)
With direct instruction addressing; Address area 0 to 255
***)
I, Q, M, L / DB, DI
S7-400 Instruction List
A5E00267845-01
0.06
0.06
0.06
0.12
0.12
0.06+/0.12+
0.06+/0.12+
0.06+/0.12+
0.06+/0.12+
0.06+/0.12+
0.06+/0.12+
39
Page 42
Setting/Resetting Bit Addresses
Instru
Length
Execution Time in s
Instru
Address
Length
Setting/Resetting Bit Addresses, continued
The RLO is written to the address of the instruction. The instructions can be dependent on the MCR (see page 97).
Ction
=
Status word for:=BRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––Yes–
Instruction affects:–––––0Yes–0
+ Plus time required for loading the address of the instruction (see page 20)
*)
With direct instruction addressing; Address area 0 to 127
**)With direct instruction addressing; Address area 0 to 255
***)I, Q, M, L / DB, DI
S7-400 Instruction List
A5E00267845-01
ID
I/Q a.b
M a.b
L a.b
DBX a.b
DIX a.b
c [d]
c [AR1,m]
c [AR2,m]
[AR1,m]
[AR2,m]
Parameter
Assign RLO
To input/output
To bit memory
To local data bit
To data bit
To instance data bit
Memory-indirect, area-internal ***
Register-indirect, area-internal (AR1) ***
Register-indirect, area-internal (AR2) ***
Area-crossing (AR1) ***
Area-crossing (AR2) ***
Via parameter ***
Description
in
Words
1*/2
1**/2
2
2
2
2
2
2
2
2
2
CPU 412CPU 414CPU 416CPU 417
0.2
0.2
0.2
0.3
0.3
0.2+/0.3+
0.2+/0.3+
0.2+/0.3+
0.2+/0.3+
0.2+/0.3+
0.2+/0.3+
0.12
0.12
0.12
0.18
0.18
0.12+/0.18+
0.12+/0.18+
0.12+/0.18+
0.12+/0.18+
0.12+/0.18+
0.12+/0.18+
0.08
0.08
0.08
0.12
0.12
0.08+/0.12+
0.08+/0.12+
0.08+/0.12+
0.08+/0.12+
0.08+/0.12+
0.08+/0.12+
0.06
0.06
0.06
0.12
0.12
0.06+/0.12+
0.06+/0.12+
0.06+/0.12+
0.06+/0.12+
0.06+/0.12+
0.06+/0.12+
40
Page 43
Instructions Directly Affecting the RLO
Instruc-
Address
Instruc-
Address
Description
Length
in
Words
Instructions Directly Affecting the RLO
The following instructions have a direct effect on the RLO.
Length
tion
CLRSet RLO to “0”10.10.060.040.03
Status word for:CLRBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–––––0000
SETSet RLO to “1”10.10.060.040.03
Status word for:SETBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–––––0110
NOTNegate RLO10.10.060.040.03
Status word for:NOTBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––Yes–Yes–
Instruction affects:––––––1Yes–
SAVESave RLO to the BR bit10.10.060.040.03
Status word for:SAVEBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––Yes–
Instruction affects:Yes––––––––
ID
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
S7-400 Instruction List
A5E00267845-01
41
Page 44
Timer Instructions
In-
Length
Execution Time in s
struc-
Address
in
Timer Instructions
Starting o r resetting a timer. The time value must be in ACCU1-L. The instructions are triggered by an edge transition in the RLO; that is,
when the status of the RLO has changed between two calls.
tion
SPTf
SETf
SDTf
Status word forSP, SE, SDBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––Yes–
Instruction affects:–––––0––0
+ Plus time required for loading the address of the instruction (see page 20)
1)
With direct instruction addressing Timer No.: 0 to 255
S7-400 Instruction List
A5E00267845-01
ID
T [e]
Timer para.20.2+0.12+0.08+0.06+
T [e]
Timer para.2024+0.12+0.08+0.06+
T [e]
Timer para.20.2+01.2+0.08+0.06+
Start timer as pulse on edge
change from “0” to “1”
Start timer as extended pulse on
edge change from “0” to “1”
Start timer as ON delay on edge
change from “0” to “1”
Description
Words
11)/20.2
11)/20.2
11)/20.2
CPU 412CPU 414CPU 416CPU 417
0.2+
0.2+
0.2+
0.12
0.12+
0.12
0.2+
0.12
0.12+
0.08
0.08+
0.08
0.08+
0.08
0.08+
0.06
0.06+
0.06
0.06+
0.06
0.06+
42
Page 45
Timer Instructions, continued
In-
Length
Execution Time in s
struc-
Address
in
Timer Instructions
tion
SSTf
SFTf
Status word for SS, SFBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––Yes–
Instruction affects:–––––0––0
S7-400 Instruction List
A5E00267845-01
ID
T [e]
Timer para.20.2+0.12+0.08+0.06+
T [e]
Timer para.20.2+0.12+0.08+0.06+
Start timer as retentive ON delay
on edge change from “0” to “1”
Start timer as OFF delay on edge
change from “0” to “1”
Description
Words
11)/20.2
11)/20.2
CPU 412CPU 414CPU 416CPU 417
0.2+
0.2+
0.12
0.12+
0.12
0.12+
0.08
0.08+
0.08
0.08+
0.06
0.06+
0.06
0.06+
43
Page 46
Timer Instructions, continued
In-
Length
Execution Time in s
struc-
Address
in
(reset edge bit memory for
Timer Instructions
tion
FRTf
RTf
Status word for:FR, RBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––Yes–
Instruction affects:–––––0––0
+ Plus time required for loading the address of the instruction (see page 20)
1)
With direct instruction addressing Timer No.: 0 to 255
S7-400 Instruction List
A5E00267845-01
ID
T [e]
Timer para.
T [e]
Timer para.20.2+0.12+0.08+0.06+
Enable timer for restarting on
edge change from “0” to “1”
starting timer)
Reset timer11)/20.2
Description
Words
11)/20.2
20.2+01.2+0.08+0.06+
CPU 412CPU 414CPU 416CPU 417
0.2+
0.2+
0.12
0.12+
0.12
0.12+
0.08
0.08+
0.08
0.08+
0.06
0.06+
0.06
0.06+
44
Page 47
Counter Instructions
In-
Length
Execution Time in s
struc-
in
The count value must be in ACCU1-L in the form of a BCD number (0 - 999).
Counter Instructions
tion
SCf
RCf
CUCf
Status word for:S, R, CUBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––Yes–
Instruction affects:–––––0––0
+ Plus time required for loading the address of the instruction (see page 20)
1)
S7-400 Instruction List
A5E00267845-01
Address IDDescription
C [e]
Counter para.20.2+0.12+0.08+0.06+
C [e]
Counter para.20.2+0.12+0.08+0.06+
C [e]
Counter para.20.2+0.12+0.08+0.06+
With direct instruction addressing Counter No.: 0 to 255
Presetting of counter on edge
change from “0” to “1”
Reset counter to “0”
when RLO = “1”
Increment counter by 1 on edge
change from “0” to “1”
Words
11)/20.2
11)/20.2
11)/20.2
CPU 412CPU 414CPU 416CPU 417
0.4+
0.4+
0.2+
0.12
0.12+
0.12
0.12+
0.12
0.12+
0.08
0.08+
0.08
0.08+
0.08
0.08+
0.06
0.06+
0.06
0.06+
0.06
0.06+
45
Page 48
Counter Instructions, continued
In-
Length
Execution Time in s
struc-
in
memory for up and down
Counter Instructions
tion
CDCf
FRCf
Status word for: CD, FRBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––Yes–
Instruction affects:–––––0––0
+ Plus time required for loading the address of the instruction (see page 20)
1)
S7-400 Instruction List
A5E00267845-01
Address IDDescription
C [e]
C [e]
Counter para.
With direct instruction addressing Counter No.: 0 to 255
Decrement counter by 1 on edge
change from “0” to “1”
Enable counter on edge change
from “0” to “1” (reset edge bit
counting and setting the counter)
Words
11)/20.2
11)/20.2
20.2+0.12+0.08+0.06+
CPU 412CPU 414CPU 416CPU 417
0..2+
0.2+
0.12
0.2+
0.12
0.12+
0.08
0.08+
0.08
0.08+
0.06
0.06+
0.06
0.06+
46
Page 49
Load Instructions
In-
Length
Execution Time in s
struc-
Address
in
Load Instructions
Loading address identifiers into ACCU1. The contents of ACCU1 are first saved to ACCU2. The status word is not affected.
If there is a remainder of 3 following an integral division of the used addresses by 4, the execution times for instructions specified on this
page are doubled.
Description
2)
Words
11)/2
11)/2
11)/2
CPU 412CPU 414CPU 416CPU 417
0.1/0.125
0.1/0.125
0.1/0.125
13)/220.1/0.125
0.125
2
2
0.2
0.2
0.06/0.075
0.06/0.075
0.06/0.075
0.06/0.075
0.075
0.12
0.12
0.04/0.05
0.04/0.05
0.04/0.05
0.04/0.05
0.05
0.08
0.08
L
tion
ID
IWa
QW
PIWa
MWa
LWa
DBW a
DIWa
Load ...
Input word
Output word
Peripheral input word
Bit memory word
Local data word
Data word
Instance data word
... into ACCU1-L
h [d]
h [AR1,m]
h [AR2,m]
W[AR1,m]
W[AR2,m]
Parameter
+ Plus time required for loading the address of the instruction (see page 20)
1)
With indirect instruction addressing; Address area 0 to 127
2)
The following peripheral acknowledgement time must be observed with CPU 414-4H and CPU 417-4H: solo xx s, redundant xx s
3)
With direct instruction addressing; Address area 0 to 255
If the used address is divisible by 4without a remainder, the execution times for instructions specified on this page is doubled.
Description
Words
11)/2
2)
11)/2
11)/2
13)/2
2
2
2
CPU 412CPU 414CPU 416CPU 417
0.1/0.125
0.1/0.125
0.1/0.125
0.1/0.125
0.125
0.2
0.2
0.06/0.075
0.06/0.075
0.06/0.075
0.06/0.075
0.075
0.12
0.12
0.04/0.05
0.04/0.05
0.04/0.05
0.04/0.05
0.05
0.08
0.08
L
tion
ID
IDa
QDa
PIDa
MDa
LDa
DBDa
DIDa
Load ...
Input double word
Output double word
Peripheral input double word
Bit memory double word
Local data double word
Data double word
Instance data double word
... in ACCU1
i [d]
i [AR1,m]
i [AR2,m]
D[AR1,m]
D[AR2,m]
Parameter
+ Plus time required for loading the address of the instruction (see page 20)
1)
With indirect instruction addressing; Address area 0 to 127
2)
The following peripheral acknowledgement time must be observed with CPU 414-4H and CPU 417-4H: solo xx s, redundant xx s
3)
With direct instruction addressing; Address area 0 to 255
4)
I, Q, P, M, L / DB, DI
S7-400 Instruction List
A5E00267845-01
Memory-indirect, area internal
Register-ind., area internal (AR1)
Register-ind., area internal (AR2)
Area-crossing (AR1)
Area-crossing (AR2)
Via parameter
4)
4)
4)
4)
4)
4)
2
2
2
2
2
2
0.1+/0.2+
0.125+/0.2+
0.125+/0.2+
0.125+/0.2+
0.125+/0.2+
0.125+/0.2+
0.06+/0.12+
0.075+/0.12+
0.075+/0.12+
0.075+/0.12+
0.075+/0.12+
0.075+/0.12+
0.04+/0.08+
0.05+/0.08+
0.05+/0.08+
0.05+/0.08+
0.05+/0.08+
0.05+/0.08+
0.03+/0.09+
0.042+/0.09+
0.042+/0.09+
0.042+/0.09+
0.042+/0.09+
0.042+/0.09+
0.03/0.042
0.03/0.042
0.03/0.042
0.03/0.042
0.042
0.09
0.09
49
Page 52
Load Instructions, continued
In-
Length
Execution Time in s
struc-
Address
in
Load Instructions
tion
L
L2#nLoad 16-bit binary constant into
LW#16#pLoad 16-bit hexadecimal
S7-400 Instruction List
A5E00267845-01
ID
k8
k16
k32
ParameterLoad constant into ACCU1
B#16#pLoad 8-bit-hexadecimal constant
DW#16#pLoad 32-bit hexadecimal
Load ...
8-bit constant into ACCU1-LL
16-bit constant into ACCU1-L
32-bit constant into ACCU1
(addressed via parameter)
ACCU1-L
Load 32-bit binary constant into
ACCU1
into ACCU1-L
constant into ACCU1-L
constant into ACCU1
Description
Words
2
2
3
20.3+0.18+0.12+0.12+
20.1250.0750.050.042
30.1850.1120.0750.062
10.10.060.040.03
20.1250.0750.050.042
30.1850.1120.0750.065
CPU 412CPU 414CPU 416CPU 417
0.125
0.125
0.185
0.075
0.075
0.112
0.05
0.05
0.075
0.042
0.042
0.062
50
Page 53
Load Instructions, continued
In-
Length
Execution Time in s
struc-
in
Load Instructions
tion
L’x’Load 1 character20.1250.0750.050.042
LD# time valueLoad IEC date30.1850.1120.0750.062
LS5T# time value Load S7 time constant (16 bits)20.1250.0750.050.042
LTOD# time va-
LT# time valueLoad 16-bit time constant20.1250.0750.050.042
LP# bit pointerLoad bit pointer30.1850.1120.0750.062
LL# integerLoad 32-bit integer constant30.1850.1120.0750.062
LReal numberLoad floating-point number30.1850.1120.0750.062
S7-400 Instruction List
A5E00267845-01
Address IDDescription
Words
CPU 412CPU 414CPU 416CPU 417
52
Page 55
Load Instructions for Timers and Counters
In-
Length
Execution Time in s
In-
Length
Load Instructions for Timers and Counters
Loading a time value or count value into ACCU1. The contents of ACCU1 are first saved to ACCU2. The bits of the status word are not
affected.
struc-
tion
LT f
LC f
LCT f
LCC f
+ Plus time required for loading the address of the instruction (see page 20)
1)
S7-400 Instruction List
A5E00267845-01
Address IDDescription
Load time value11)/220.1/0.12
T (e)
Timer para.Load time value (addressed via parameter)20.1+0.06+0.04+0.03+
Load count value11)/220.1/0.12
C (e)
Counter para.Load count value (addressed via parameter)20.1+0.06+0.04+0.03+
Load time value in BCD11)/2
T (e)
Timer para.Load time value in BCD (addressed via parameter)20.3+0.18+0.12+0.09+
Load count value in BCD11)/2
C (e)
Counter para.Load count value in BCD (addressed via parameter)20.3+0.18+0.12+0.09+
With direct instruction addressing; Timer/counter No.: 0 to 255
in
Words
2
2
CPU
412
5
0.1+
5
xx+
0.3
0.3+
0.3
0.3+
CPU
414
0.06/0.0
75
0.06+
0.06/0.0
75
0.06+
0.18
0.18+
0.18
0.18+
CPU
416
0.04/0.0
5
0.04+
0.04/0.0
5
0.04+
0.12
0.12+
0.12
0.12+
CPU
417
0.03/0.0
42
0.03+
0.03/0.0
42
0.03+
0.09
0.09+
0.09
0.09+
53
Page 56
Transfer Instructions
In-
Length
Execution Time in s
struc-
Address
in
Transfer Instructions
Transferring the contents of ACCU1 to the addressed operand. Note that some instructions are affected by the MCR (see page
LEERER MERKER). The status word is not affected.
tion
T
+ Plus time required for loading the address of the instruction (see page 20)
1)
With direct instruction addressing; Address area 0 to 127
2)
The following peripheral acknowledgement time must be observed with CPU 414-4H and CPU 417-4H: solo xx s, redundant xx s
3)
With direct instruction addressing; Address area 0 to 255
S7-400 Instruction List
A5E00267845-01
ID
IBa
QBa
PQBa
MBa
LBa
DBBa
DIBa
g [d]
g [AR1,m]
g [AR2,m]
B[AR1,m]
B[AR2,m]
Parameter
Transfer contents of
ACCU1-LL to ...
input byte
output byte
peripheral output byte
bit memory byte
local data byte
data byte
instance data byte
Memory-indirect, area internal
Register-ind., area internal (AR1)
Register-ind., area internal (AR2)
Area-crossing (AR1)
Area-crossing (AR2)
Via parameter
Description
Words
11)/2
2)
11)/2
2
13)/2
2
2
2
2
2
2
2
2
2
CPU 412CPU 414CPU 416CPU 417
0.1/0.125
0.1/0.125
0.125
0.1/0.125
0.125
0.335
0.335
0.1+
0.125+
0.125+
0.125+
0.125+
0.125+
0.06/0.075
0.06/0.075
0.075
0.06/0.075
0.075
0.075
0.075
0.06+
0.075+
0.075+
0.075+
0.075+
0.075+
0.04/0.05
0.04/0.05
0.05
0.04/0.05
0.05
0.05
0.05
0.04+
0.05+
0.05+
0.05+
0.05+
0.05+
0.03/0.042
0.03/0.042
0.042
0.03/0.042
0.042
0.042
0.042
0.03+
0.042+
0.042+
0.042+
0.042+
0.042+
54
Page 57
Transfer Instructions
Instruc-
Length
Execution Time in s
tion
Address
in
Transfer Instructions, continued
If there is a remainder of 3 following an integral division of the used addresses by 4, the execution times for instructions specified on this
page are doubled.
ID
T
IWa
QWa
PQW a
MWa
LWa
DBW a
DIWa
h [d]
h [AR1,m]
h [AR2,m]
W[AR1,m]
W[AR2,m]
Parameter
+ Plus time required for loading the address of the instruction (see page 20)
1)
With direct instruction addressing; Address area 0 to 127
2)
The following peripheral acknowledgement time must be observed with CPU 414-4H and CPU 417-4H: solo xx s, redundant xx s
3)
With direct instruction addressing; Address area 0 to 255
S7-400 Instruction List
A5E00267845-01
Transfer contents of ACCU1-L to ...
input word
output word
peripheral output word
bit memory word
local data word
data word
instance data word
Memory-indirect, area internal
Register-ind., area internal (AR1)
Register-ind., area internal (AR2)
Area-crossing (AR1)
Area-crossing (AR2)
Via parameter
Description
2)
Words
11)/2
11)/2
11)/2
13)/2
2
2
2
2
2
2
2
2
2
CPU 412CPU 414CPU 416CPU 417
0.1/0.125
0.1/0.125
0.1/0.125
0.1/0.125
0.125
0.335
0.335
0.1+
0.125+
0.125+
0.125+
0.125+
0.125+
0.06/0.075
0.06/0.075
0.06/0.075
0.06/0.075
0.075
0.075
0.075
0.06+
0.075+
0.075+
0.075+
0.075+
0.075+
0.04/0.05
0.04/0.05
0.04/0.05
0.04/0.05
0.05
0.05
0.05
0.04+
0.05+
0.05+
0.05+
0.05+
0.05+
0.03/0.042
0.03/0.042
0.03/0.042
0.03/0.042
0.042
0.042
0.042
0.03+
0.042+
0.042+
0.042+
0.042+
0.042+
55
Page 58
Transfer Instructions
Instruc-
Length
Execution Time in s
tion
Address
in
Transfer Instructions, continued
If the used address is divisible by 4without a remainder, the execution times for instructions specified on this page is doubled.
ID
T
EDa
ADa
PADa
MDa
LDa
DBDa
DIDa
Ti [d]
+ Plus time required for loading the address of the instruction (see page 20)
1)
With direct instruction addressing; Address area 0 to 127
2)
The following peripheral acknowledgement time must be observed with CPU 414-4H and CPU 417-4H: solo xx s, redundant xx s
3)
With direct instruction addressing; Address area 0 to 255
S7-400 Instruction List
A5E00267845-01
i [AR1,m]
i [AR2,m]
D[AR1,m]
D[AR2,m]
Parameter
Transfer contents of
ACCU1 to ...
Input double word
Output double word
periph. output double word
Bit memory double word
Local data double word
Data double word
Instance data double word
Memory-indirect, area internal
Register-ind., area internal (AR1)
Register-ind., area internal (AR2)
Area-crossing (AR1)
Area-crossing (AR2)
Via parameter
Description
Words
11)/2
2)
11)/2
2
13)/2
2
2
2
2
2
2
2
2
2
CPU 412CPU 414CPU 416CPU 417
0.1/0.125
0.1/0.125
0.125
0.1/0.125
0.125
0.11
0.11
0.1+
0.125+
0.125+
0.125+
0.125+
0.125+
0.06/0.075
0.06/0.075
0.075
0.06/0.075
0.075
0.075
0.075
0.06+
0.075+
0.075+
0.075+
0.075+
0.075+
0.04/0.05
0.04/0.05
0.05
0.04/0.05
0.05
0.05
0.05
0.04+
0.05+
0.05+
0.05+
0.05+
0.05+
0.03/0.042
0.03/0.042
0.042
0.03/0.042
0.042
0.042
0.042
0.03+
0.042+
0.042+
0.042+
0.042+
0.042+
56
Page 59
Load and Transfer Instructions for Address Registers
Instruc-
Address
Instruc-
Address
Description
Length
in
Load and Transfer Instructions for Address Registers
Loading a double word from a memory area or register into address register 1 (AR1) or address register 2 (AR2). The status word is not
affected.
Execution Time in s
0.12
0.12
0.18
0.18
0.12
0.12
0.12
0.12
0.18
0.18
0.12
0.12
0.12
0.08
0.08
0.12
0.12
0.08
0.08
0.08
0.08
0.12
0.12
0.08
0.08
0.08
0.06
0.06
0.12
0.12
0.062
006
006
0.06
0.12
0.12
0.062
0.06
0.06
tion
LAR1
LAR2
ID
–
AR2
DBDa
DIDa
m
LDa
MDa
–
DBDa
DIDa
m
LDa
MDa
Load contents from ...
ACCU1
Address register 2
Data double word
Instance data double word
32-bit constant as pointer
Local data double word
Bit memory double word
... into AR1
Load contents from ...
ACCU1
Data double word
Instance data double word
32-bit constant as pointer
Local data double word
Bit memory double word
... into AR2
Length
Words
1
1
2
2
3
2
2
1
2
2
3
2
2
CPU 412CPU 414CPU 416CPU 417
0.2
0.2
0.3
0.3
0.2
0.2
0.2
0.2
0.3
0.3
0.2
0.2
0.2
S7-400 Instruction List
A5E00267845-01
57
Page 60
Load and Transfer Instructions for Address Registers
Instruc-
Address
Instruc-
Address
Description
Length
in
Load and Transfer Instructions forAddress Registers, continued
Transferring a double word from address register 1 (AR1) or address register 2 (AR2) to a memory area or register. The contents of
ACCU1 are first saved to ACCU2. The status word is not affected.
tion
TAR1
TAR2
CARExchange the contents of AR1
S7-400 Instruction List
A5E00267845-01
ID
–
AR2
DBDa
DIDa
LDa
MDa
–
DBDa
DIDa
LDa
MDa
Transfer contents from AR1 in ...
ACCU1
Address register 2
Data double word
Instance data double word
Local data double word
Bit memory double word
Transfer contents from AR2 in ...
ACCU1
Data double word
Instance data double word
Local data double word
Bit memory double word
and AR2
Length
Words
1
1
2
2
2
2
1
2
2
2
2
10.20.120.080.06
CPU 412CPU 414CPU 416CPU 417
0.1
0.2
0.125
0.125
0.125
0.125
0.1
0.125
0.125
0.125
0.125
Execution Time in s
0.06
0.12
0.075
0.075
0.075
0.075
0.06
0.075
0.075
0.075
0.075
0.04
0.08
0.05
0.05
0.05
0.05
0.04
0.05
0.05
0.05
0.05
0.03
0.06
0.042
0.042
0.042
0.042
0.03
0.042
0.042
0.042
0.042
58
Page 61
Load and Transfer Instructions for the Status Word
Instruc-
Address
Instruc-
Address
Description
Length
in
Instruc-
Address
Instruc-
Address
Description
Length
in
Load and Transfer Instructions for the Status Word
Length
tion
LSTWLoad status word into ACCU10.10.060.040.3
Status word for:L STWBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:YesYesYesYesYesYesYesYesYes
Instruction affects:–––––––––
tion
TSTWTransfer ACCU1 (bits 0 to 8) to
Status word for:T STWBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:YesYesYesYesYesYesYesYesYes
S7-400 Instruction List
A5E00267845-01
ID
ID
the status word
Words
Length
Words
CPU 412CPU 414CPU 416CPU 417
CPU 412CPU 414CPU 416CPU 417
0.10.060.040.03
Execution Time in s
Execution Time in s
59
Page 62
Load Instructions for DB Number and DB Length
Instruc-
Address
Instruc-
Address
Description
Length
in
Load Instructions for DB Number and DB Length
Loading the number/length of a data block into ACCU1. The old contents of ACCU1 are saved to ACCU2. The status word is not affected.
Length
tion
LDBNOLoad number of data block10.10.060.040.03
LDINOLoad number of instance data
LDBLGLoad length of data block into
LDILGLoad length of instance data
S7-400 Instruction List
A5E00267845-01
ID
block
byte
block into byte
Words
10.10.060.040.03
10.10.060.040.03
10.10.060.040.03
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
60
Page 63
Integer Math (16 Bits)
Instruc-
Address
Instruc-
Address
Description
Length
in
Integer Math (16 Bits)
Math instructions on two 16-bit words. The result is written to ACCU1 and/or ACCU1-L. ACCU3 and ACCU4 are then transferred to
ACCU2 and ACCU3.
Length
tion
+IAdd 2 integers (16 bits)
–ISubtract 1 integer from another (16 bits)
Status word for:+I, –I,BRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–YesYesYesYes––––
S7-400 Instruction List
A5E00267845-01
ID
(ACCU1-L)=(ACCU1-L)+(ACCU2-L)
(ACCU1-L)=(ACCU2-L)-(ACCU1-L)
Words
10.10.060.040.03
10.10.060.040.03
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
61
Page 64
Integer Math (16 Bits)
Instruc-
Address
Instruc-
Address
Description
Length
in
Length
tion
IMultiply 1 integer by another (16 bits)
*
/IDivide 1 integer by another (16 bits)
Status word for:
Instruction evaluates:–––––––––
Instruction affects:–YesYesYesYes––––
ID
(ACCU1)=(ACCU2-L)*(ACCU1-L)
(ACCU1-L)=(ACCU2-L):(ACCU1-L)
The remainder is in ACCU1-H
I, /IBRCC1CC0OVOSORSTARLO/FC
*
Words
10.10.060.040.03
10.10.240.160.12
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
S7-400 Instruction List
A5E00267845-01
62
Page 65
Integer Math (32 Bits)
Instruc-
Address
Instruc-
Address
Description
Length
in
Integer Math (32 Bits)
Math instructions on two 32-bit words. The result is written to ACCU1. ACCU3 and ACCU4 are then transferred to ACCU2 and ACCU3.
Length
tion
+DAdd 2 integers (32-bit)
–DSubtract 2 integer from another (32 bits)
DMultiply 2 integer by another (32 bits)
*
Status word for:+D, –D,*D, /DBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–YesYesYesYes––––
S7-400 Instruction List
A5E00267845-01
ID
(ACCU1)=(ACCU2)+(ACCU1)
(ACCU1)=(ACCU2)-(ACCU1)
(ACCU1)=(ACCU2)*(ACCU1)
Words
10.10.060.040.03
10.10.060.040.03
10.10.060.040.03
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
63
Page 66
Integer Math (32 Bits)
Instruc-
Address
Instruc-
Address
Description
Length
in
Length
tion
/DDivide 2 integer by another (32 bits)
MODDivide 2 integer by another (32 bits) and
Status word for:/D, MODBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–YesYesYesYes––––
ID
(ACCU1)=(ACCU2):(ACCU1)
load the remainder into ACCU1:
(ACCU1)=remainder of
[(ACCU2):(ACCU1)]
Words
10.60.360.240.18
10.60.360.240.18
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
S7-400 Instruction List
A5E00267845-01
64
Page 67
Floating-Point Math (32 Bits)
Instruc-
Address
Instruc-
Address
Description
Length
in
Floating-Point Math (32 Bits)
The result of the math instruction is in ACCU1. ACCU3 and ACCU4 are then transferred to ACCU2 and ACCU3.
Length
tion
+RAdd 2 real numbers (32 bits)
–RSubtract 1 real number from another (32 bits)
RMultiply 1 real number by another (32 bits)
*
/RDivide 1 real number by another (32 bits)
Status word for:+R, –R, *R, /RBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–YesYesYesYes––––
S7-400 Instruction List
A5E00267845-01
ID
(ACCU1)=(ACCU2)+(ACCU1)
(ACCU1)=(ACCU2)-(ACCU1)
(ACCU1)=(ACCU2)*(ACCU1)
(ACCU1)=(ACCU2):(ACCU1)
Words
CPU 412CPU 414CPU 416CPU 417
10.40.240.160.12
10.40.240.160.12
10.20.120.080.06
10.70.420.280.21
Execution Time in s
65
Page 68
Floating-Point Math (32 Bits), continued
Instruc-
Address
Instruc-
Address
Description
in
Floating-Point Math (32 Bits)
Length
tion
NEGRNegate the real number in
ABSForm the absolute value of the real
Status word for:NEGR, ABSBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–––––––––
S7-400 Instruction List
A5E00267845-01
ID
ACCU1
number in ACCU1
Words
10.10.060.040.03
10.10.060.040.03
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
66
Page 69
Square Root and Square Instructions (32 Bits)
Instruc-
Address
Instruc-
Address
Description
Length
in
Square Root and Square Instructions (32 Bits)
The result of the instruction is in ACCU1. The SQRT instruction can be interrupted.
Length
tion
SQRTCalculate the square root of a
SQRForm the square of the real
Status word for:SQRT, SQRBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–YesYesYesYes––––
S7-400 Instruction List
A5E00267845-01
ID
real number in ACCU1
number in ACCU1
Words
11.71.020.680.51
10.20.120.080.06
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
67
Page 70
Logarithmic Function (32 Bits)
Instruc-
Address
Instruc-
Address
Description
Length
in
The result of the logarithmic function is in ACCU1. The instructions can be interrupted.
Logarithmic Function (32 Bits)
Length
tion
LNForm the natural logarithm of a
EXPCalculate the exponential value
Status word for:LN, EXPBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–YesYesYesYes––––
S7-400 Instruction List
A5E00267845-01
ID
real number in ACCU1
of a real number in ACCU1 to the
base e (= 2.71828)
Words
1201397
12115108
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
68
Page 71
Trigonometrical Functions (32 Bits)
Instruc-
Address
Instruc-
Address
Description
Length
in
The result of the instruction is in ACCU1. The instructions can be interrupted.
Adding integer constants and storing the result in ACCU1. The status word is not affected.
Adding Constants
Length
tion
+i8Add an 8-bit integer constant10.10.060.040.03
+i16Add a 16-bit integer constant20.1250.0750.050.042
+i32Add a 32-bit integer constant30.1850.110.0750.062
S7-400 Instruction List
A5E00267845-01
ID
Words
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
70
Page 73
Adding Using Address Registers
Instruc-
Address
Instruc-
Address
Description
Length
in
Adding Using Address Registers
Adding a 16-bit integer to the contents of the address register. The value is either specified as an address in the instruction or is in
ACCU1-L. The status word is not affected.
tion
+AR1Add the contents of ACCU1-L to
+AR1m (0 to
+AR2Add the contents of ACCU1-L to
+AR2m (0 to
S7-400 Instruction List
A5E00267845-01
ID
4095)
4095)
those of AR1
Add a pointer constant to the
contents of AR1
those of AR2
Add pointer constant to the
contents of AR2
Length
Words
10.20.120.080.06
20.20.120.080.06
10.20.120.080.06
20.20.120.080.06
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
71
Page 74
Comparison Instructions (16-Bit Integers)
Instruc-
Address
Instruc-
Address
Description
Length
in
Comparison Instructions (16-Bit Integers)
Comparing the 16-bit integers in ACCU1-L and ACCU2-L. RLO = 1 if the condition is satisfied.
Length
tion
==IACCU2-L=ACCU1-L10.10.060.040.03
<>I
<IACCU2-L<ACCU1-L10.10.060.040.03
<=IACCU2-L<=ACCU1-L10.10.060.040.03
>IACCU2-L>ACCU1-L10.10.060.040.03
>=IACCU2-L>=ACCU1-L10.10.060.040.03
Status word for:==I, <>I, <I, <=I, >I,
Shift the contents of ACCU1-L to the left. Positions
that become free are provided with zeros.
1
0.1
0.06
0.04
0.03
t
Shift the contents of ACCU1 to the left. Positions that
become free are provided with zeros.
1
0.1
0.06
0.04
0.03
Shift the contents of ACCU1-L to the right. Positions
that become free are provided with zeros.
1
0.1
0.06
0.04
0.03
Shift Instructions
Shifting the contents of ACCU1 and ACCU1-L to the left or right by the specified number of places. If no address identifier is specified,
the contents of ACCU2-LL are used as the number of places. The last bit shifted is loaded into condition code bit CC 1.
tion
1)
SLW
SLW0 ... 15
SLDShift the contents of ACCU1 to the left. Positions tha
SLD0 ... 32
1)
SRW
SRW0 ... 15
Status word for: SLW, SLD, SRWBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–Yes00–––––
1)
No. of places shifted: 0 to 16
S7-400 Instruction List
A5E00267845-01
ID
Shift the contents of ACCU1-L to the left. Positions
Shift the contents of ACCU1-L to the right. Positions
Length
Words
CPU 412CPU 414CPU 416CPU 417
10.10.060.040.03
10.10.060.040.03
10.10.060.040.03
Execution Time in s
75
Page 78
Shift Instructions, continued
Instruc-
Address
Instruc-
Address
Description
Length
in
Shift the contents of ACCU1 to the right. Positions
that become free are provided with zeros.
1
0.1
0.06
0.04
0.03
Positions that become free are provided with with the
Positions that become free are provided with with the
Shift Instructions
Length
tion
SRDShift the contents of ACCU1 to the right. Positions
SRD0 ... 32
1)
SSI
SSI0 ... 15
SSDShift the contents of ACCU1 with sign to the right.
SSD0 ... 32
Status word for: SRD,SSI, SSDBRCC1CC0OVOSORSTARLO/FC
Shift the contents of ACCU1-L with sign to the right.
sign (bit 15).
sign (bit 31).
Words
CPU 412CPU 414CPU 416CPU 417
10.10.060.040.03
10.10.060.040.03
10.10.060.040.03
Execution Time in s
S7-400 Instruction List
A5E00267845-01
76
Page 79
Rotate Instructions
Instruc-
Address
Instruc-
Address
Description
Length
in
the left
the right
Rotate Instructions
Rotate the contents of ACCU1 to the left or right by the specified number of places. If no address identifier is specified, the contents of
ACCU2-LL are used as the number of places. The last bit shifted is loaded into condition code bit CC1.
Length
tion
RLDRotate the contents of ACCU1 to
RLD0 ... 32
RRDRotate the contents of ACCU1 to
RRD0 ... 32
Status word for:RLD, RRDBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–Yes00–––––
S7-400 Instruction List
A5E00267845-01
ID
Words
10.10.060.040.03
10.10.060.040.03
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
77
Page 80
Rotate Instructions, continued
Instruc-
Address
Instruc-
Address
Description
Length
in
Rotate Instructions
Length
tion
RLDARotate the contents of ACCU1 one
RRDARotate the contents of ACCU1 one
Status word for:RLDA, RRDABRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–Yes00–––––
S7-400 Instruction List
A5E00267845-01
ID
bit position to the left through
condition code bit CC 1
bit position to the right through
condition code bit CC 1
Words
CPU 412CPU 414CPU 416CPU 417
0.10.060.040.03
0.10.060.040.03
Execution Time in s
78
Page 81
Accumulator Transfer Instructions, Incrementing and Decrementing
Instruc-
Address
Instruc-
Address
Description
Length
in
Accumulator Transfer Instructions, Incrementing and Decrementing
The status word is not affected.
Length
tion
CAWReverse the order of the bytes in ACCU1-L.10.10.060.040.03
CADReverse the order of the bytes in ACCU1.10.10.060.040.03
TAKSwap the contents of ACCU1 and ACCU210.10.060.040.03
ENTThe contents of ACCU2 and ACCU3 are
LEAVEThe contents of ACCU3 and ACCU4 are
PUSHThe contents of ACCU1, ACCU2 and ACCU3
POPThe contents of ACCU2, ACCU3 and ACCU4
S7-400 Instruction List
A5E00267845-01
ID
transferred to ACCU3 and ACCU4.
transferred to ACCU2 and ACCU3.
are transferred to ACCU2, ACCU3 and
ACCU4
are transferred to ACCU1, ACCU2 and
ACCU3
Words
CPU 412CPU 414CPU 416CPU 417
10.10.060.040.03
10.10.060.040.03
10.10.060.040.03
10.10.060.040.03
Execution Time in s
79
Page 82
Accumulator Transfer Instructions, Incrementing and Decrementing, continued
Instruc-
Address
Instruc-
Address
Description
Length
in
Accumulator Transfer Instructions, Incrementing and Decrementing, continued
32-bit integer. The number is
rounded up to the next whole
number.
32-bit integer.
32-bit integer. The number is
rounded down to the next whole
number.
32-bit integer. The places after
the decimal point are truncated.
TRUNC
Words
10.40.240.160.12
10.40.240.160.12
10.40.240.160.12
10.40.240.160.12
BRCC1CC0OVOSORSTARLO/FC
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
S7-400 Instruction List
A5E00267845-01
84
Page 87
Forming the Ones and Twos Complements
Instruc-
Address
Instruc-
Address
Description
Length
in
Forming the Ones and Twos Complements
Length
tion
INVIForm the ones complement of
INVDForm the ones complement of
Status word for:INVI, INVDBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–––––––––
NEGIForm the twos complement of
NEGDForm the twos complement of
Status word for:NEGI, NEGDBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–YesYesYesYes––––
S7-400 Instruction List
A5E00267845-01
ID
ACCU1-L
ACCU1
ACCU1-L (integer)
ACCU1 (double integer)
Words
10.10.060.040.03
10.10.060.040.03
10.10.060.040.03
10.10.060.040.03
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
85
Page 88
Block Call Instructions
Address
struc-
Address
Description
Length
in
Block Call Instructions
The runtimes of the System Functions are specified in the chapter entitled “System Functions” as of page 106.
The information on the status word only relates to the block call itself and not to the commands called in this block.
In-
tion
ID
CALLFB q, DB qUnconditional call of an FB, with
Length
Words
15/17
CPU 412CPU 414CPU 416CPU 417
1)
4.0
3)
Execution Time in s
3)
2.4
1.6
3)
parameter transfer
CALLSFB q,
DB q
Unconditional call of an SFB,
with parameter transfer
CALLFC qUnconditional call of a function,
16/17
7/8
1)
1)
4.0
3.2
3)
3)
2.4
1.92
3)
3)
1.6
1.28
3)
3)
with parameter transfer
CALLSFC qUnconditional call of an SFC,
83.2
3)
1.92
3)
1.28
3)
with parameter transfer
Status word for:CALLBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:––––001–0
1)
The instruction length depends on the block number from
(0...255 or more)
+Plus time required for loading the address of the instruction (see page 20)
1)
With direct instruction (DB) addressing; Block No. 0 to 255
2)
Depending on RLO, sets RLO = 1
4)
If call is not executed
4)
4)
4)
4)
4)
S7-400 Instruction List
A5E00267845-01
87
Page 90
Block Call Instructions, continued
Execution Time in s
Instruc-
Length
Execution Time in s
tion
Address
Description
in-
Words
Block Call Instructions
Instruc-
tion
OPN
Address
ID
DBq
DIq
DB[e]
DI[e]
Parameter
Open:
Data block
Instance data block
Data block, memory-indirect
Instance DB, memory-indirect
Data block using parameters
Length
in-
11)/2
Direct Addressing
CPU 412CPU 414CPU 416CPU 417
1)2);
0.1
0.1252); 0.5
0.5 /
1)2);
0.1
0.5 /
0.1252); 0.5
1)2);
0.1+
0.5+ /
0.125+2); 0.5+
1)2);
0.1+
0.5+ /
0.125+2); 0.5+
1)2);
0.1+
0.5+ /
0.125+2); 0.5+
1)2)
0.06
; 0.3 /
0.0752); 0.3
1)2)
0.06
; 0.3 /
0.0752); 0.3
1)2)
0.06+
0.075+2); 0.3+
0.06+
0.075+2); 0.3+
0.06+
1)2)
1)2)
;0.3+/
;0.3+/
;0.3+/
0.075+2); 0.3+
1)2)
0.04
; 0.2 /
0.052); 0.2
1)2)
0.04
; 0.2 /
0.052); 0.2
1)2)
0.04+
0.04+
0.04+
,0.2+/
0.05+2); 0.2+
1)2)
,0.2+/
0.05+2); 0.2+
1)2)
,0.2+/
0.05+2); 0.2+
Status word for:OPNBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–––––––––
+ Plus time required for loading the address of the instruction (see page 20)
1)
With direct instruction (DB) addressing; Block No. 0 to 255
2)
If the same DB or DI is already selected
S7-400 Instruction List
A5E00267845-01
1)2);
0.03
0.0422); 0.21
1)2);
0.03
0.0422); 0.21
1)2)
0.03+
2);
0.042+
1)2)
0.03+
2);
0.042+
1)2)
0.03+
2);
0.042+
0.21 /
0.21 /
, 0.21+
0.21+
, 0.21+
0.21+
, 0.21+
0.21+
88
Page 91
Block End Instructions
Instruc-
Address
Instruc-
Address
Description
Length
in
Block End Instructions
Length
tion
BEEnd block14.02.41.61.62
BEUEnd block unconditionally14.02.41.61.62
Status word for:BE, BEUBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:––––001–0
BECEnd block conditionally if
Status word for:BECBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––Yes–
Instruction affects:––––Yes0110
1)
If jump is not executed
S7-400 Instruction List
A5E00267845-01
ID
RLO = “1”
Words
CPU 412CPU 414CPU 416CPU 417
4.2
1)
0.5
Execution Time in s
2.52
0.3
1)
1.78
0.2
1)
1.68
0.18
1)
89
Page 92
Exchanging Shared Data Block and Instance Data Block
Instruc-
Address
Instruc-
Address
Description
Length
in
Exchanging Shared Data Block and Instance Data Block
Exchanging the two current data blocks. The current shared data block becomes the current instance data block, and vice versa. The status word is not affected.
tion
CDBExchange shared data block and
S7-400 Instruction List
A5E00267845-01
ID
instance data block
Length
Words
10.20.120.080.06
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
90
Page 93
Jump Instructions
Instruc-
Address
Instruc-
Address
Description
Length
in
Jumping as a function of conditions.
Jump Instructions
Execution Time in s
tion
Length
ID
Words
CPU 412CPU 414CPU 416CPU 417
JULABELJump unconditionally20.60.360.240.21
Status word for:JUBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–––––––––
JCLABELJump if RLO = “1”20.6; 0.125
JCNLABELJump if RLO = “0”20.6/0.125
2)
2)
0.36; 0.075
0.36/0.075
2)
2)
0.24; 0.05
0.24/0.05
2)
2)
Status word for:JC, JCNBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––Yes–
Instruction affects:–––––0110
2)
If jump is not executed
S7-400 Instruction List
A5E00267845-01
0.21; 0.042
0.21/0.042
2)
2)
91
Page 94
Jump Instructions, continued
Instruc-
Address
Instruc-
Address
Description
in
Jump Instructions
tion
ID
JCBLABELJump if RLO = “1”.
Length
Words
CPU 412CPU 414CPU 416CPU 417
20.6/0.125
2)
Execution Time in s
0.36/0.075
2)
0.24/0.05
2)
0.21/0.042
Save the RLO in the BR bit
JNBLABELJump if RLO = “0”.
20.6/0.125
2)
0.36/0.075
2)
0.24/0.05
2)
0.21/0.042
Save the RLO in the BR bit
Status word for:JCB, JNBBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––Yes–
Instruction affects:Yes––––0110
JBILABELJump if BR = “1”20.6/0.125
JNBILABELJump if BR = “0”20.6/0.125
2)
2)
0.36/0.075
0.36/0.075
2)
2)
0.24/0.05
0.24/0.05
2)
2)
0.21/0.042
0.21/0.042
Status word for:JBI, JNBIBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:Yes––––––––
Instruction affects:–––––01–0
2)
If jump is not executed
2)
2)
2)
2)
S7-400 Instruction List
A5E00267845-01
92
Page 95
Jump Instructions, continued
Instruc-
Address
Instruc-
Address
Description
in
Jump Instructions
tion
ID
JOLABELJump on stored overflow
Length
Words
CPU 412CPU 414CPU 416CPU 417
20.6; 0.125
Execution Time in s
2)
0.36; 0.075
2)
0.24; 0.05
2)
(OV = “1”)
Status word for:JOBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––Yes–––––
Instruction affects:–––––––––
JOSLABELJump on stored overflow
20.6/0.125
2)
0.36/0.075
2)
0.24/0.05
2)
(OS = “1”)
Status word for:JOSBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:––––Yes––––
Instruction affects:––––0––––
Status word for:JL, LOOPBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–––––––––
1)
If jump is not executed
ID
This instruction is followed by a list
of jump instructions.
The address identifier is a jump label
to subsequent instructions in this list.
ACCU1-LL contains the number of
the jump instruction to be executed
(max. 254). The number of the first
jump instruction is 0.
ACCU1-L 0 0
(loop programming)
Words
20.70.420.280.24
20.6/0.125 1)0.36/0.075
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
1)
0.24/0.05
1)
0.21/0.042
1)
S7-400 Instruction List
A5E00267845-01
96
Page 99
Instructions for the Master Control Relay (MCR)
Instruc-
Address
Instruc-
Address
Description
Length
in
Instructions for the Master Control Relay (MCR)
MCR=1³MCR is deactivated
MCR=0³MCR is activated; “T” and “=” instructions write zeros to the
corresponding address identifiers if RLO = “0”; “S” and ”R” instructions leave the memory contents unchanged.
Length
tion
MCR(Open an MCR zone.
Status word for:MCR(CC1BRCC0OVOSORSTARLO/FC
Instruction evaluates:–––––––Yes–
Instruction affects:–––––01–0
)MCRClose an MCR zone.
Status word for:)MCRBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–––––01–0
S7-400 Instruction List
A5E00267845-01
ID
Save the RLO to the MCR stack.
Pop an entry off the MCR stack.
Words
10.10.060.040.03
10.10.060.040.03
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
97
Page 100
Instructions for the Master Control Relay (MCR)
Instruc-
Address
Instruc-
Address
Description
Length
in
Instructions for the Master Control Relay (MCR), continued
Length
tion
MCRAActivate the MCR10.10.060.040.03
MCRDDeactivate the MCR10.10.060.040.03
Status word for:MCRA, MCRDBRCC1CC0OVOSORSTARLO/FC
Instruction evaluates:–––––––––
Instruction affects:–––––––––
S7-400 Instruction List
A5E00267845-01
ID
Words
CPU 412CPU 414CPU 416CPU 417
Execution Time in s
98
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.