S7-400 Instruction List

S7-400 Instruction List

(Parte 1 de 8)

S7-400 Instruction List CPU 412, 414, 416, 417

This Instruction List has the order number: 6ES7498-8AA03-8BN0

Edition 12/2002 A5E00069511-07

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.

Disclaimer of LiabilityCopyright Siemens AG 2002 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 by patent grant or registration of a utility model or design, are reserved.

Siemens AG Bereich Automation and Drives

Geschaeftsgebiet Industrial Automation SystemsPostfach 4848, D- 90327 Nuernberg

Siemens AG 2002 Subject to change without prior notice

Siemens Aktiengesellschaft 6ES7498-8AA03-8BN0

Contents

1S7-400 Instruction List A5E00069511-07

Contents1
Applicability5
Address Identifier and Parameter Ranges6
Constants and Ranges9
Abbreviations and Mnemonics10
Registers12
Examples of Addressing15
Examples of Addressing, continued16
Examples of Addressing, continued17
Examples of how to calculate the pointer18
Execution Times with Indirect Addressing119
Examples of Calculations21
List of Instructions24
Bit Logic Instructions25
Bit Logic Instructions with Parenthetical Expressions28

Contents ORing of AND Instructions30. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Contents

2S7-400 Instruction List A5E00069511-07

Logic Instructions with Timers and Counters31
Word Logic Instructions with the Contents of Accumulator 133
Evaluating Conditions Using AND, OR and EXCLUSIVE OR35
Edge-Triggered Instructions38
Setting/Resetting Bit Addresses39
Instructions Directly Affecting the RLO41
Timer Instructions42
Counter Instructions45
Load Instructions47
Load Instructions for Timers and Counters53
Transfer Instructions54
Load and Transfer Instructions for Address Registers57
Load and Transfer Instructions for the Status Word59
Load Instructions for DB Number and DB Length60
Integer Math (16 Bits)61
Integer Math (32 Bits)62

Floating-Point Math (32 Bits)63. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Contents

3S7-400 Instruction List A5E00069511-07

Square Root and Square Instructions (32 Bits)65
Logarithmic Function (32 Bits)6
Trigonometrical Functions (32 Bits)67
Adding Constants68
Adding Using Address Registers69
Comparison Instructions (16-Bit Integers)70
Comparison Instructions (32-Bit Integers)71
Comparison Instructions (32-Bit Real Numbers)72
Shift Instructions73
Rotate Instructions75
Accumulator Transfer Instructions, Incrementing and Decrementing77
Program Display and Null Operation Instructions78
Data Type Conversion Instructions79
Forming the Ones and Twos Complements82
Block Call Instructions83
Block End Instructions86

Exchanging Shared Data Block and Instance Data Block87. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Contents

4S7-400 Instruction List A5E00069511-07

Jump Instructions88
Instructions for the Master Control Relay (MCR)93
Oganization Blocks (OB)95
Function Blocks (FB)100
Functions (FC) and Data Blocks101
System Functions102
System Function Blocks135
Sublist of the System Status List (SSL)145

Alphabetical Index of Instructions152. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Applicability

5S7-400 Instruction List A5E00069511-07

Applicability

This list of instructions applies to the CPUs listed below.

NameOrder numbersubsequently described as* CPU 412-16ES7 412-1XF03-0AB0

CPU 412-26ES7 412-2XG00-0AB0CPU 412 CPU 412-2 PCI6ES7 612-2QH00-0AB4

CPU 414-26ES7 414-2XG03-0AB0 CPU 414-36ES7 414-3XJ00-0AB0CPU 414 CPU 414-4H6ES7 414-4HJ00-0AB0CPU 414 CPU 416-26ES7 416-2XK02-0AB0

CPU 416-2 PCI6ES7 616-2QL00-0AB4CPU 416 CPU 416-36ES7 416-3XL00-0AB0

CPU 417-46ES7 417-4XL00-0AB0 CPU 417-4 H6ES7 417-4HL01-0AB0CPU 417

*except in the tables, where a detailled differentiation is necessary

Address Identifier and Parameter Ranges

S7-400 Instruction List A5E00069511-07

Address Identifier and Parameter Ranges

Addr. Parameter Range Description IDCPU 412CPU 414CPU 416CPU 417

Q2)0.0 to 127.70.0 to 255.70.0 to 511.70.0 to 1023.7Output (in PIQ) QB2)0 to 1270 to 2550 to 5110 to 1023Output byte (in PIQ) QW2)0 to 1260 to 2540 to 5100 to 1022Output word (in PIQ) QD2)0 to 1240 to 2520 to 5080 to 1020Output double word (in PIQ)

DBX0.0 to 65533.71)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 655331)0 to 655330 to 655330 to 65533Data byte in DB

DBW0 to 655321)0 to 655320 to 655320 to 65532Data word in DB DBD0 to 655301)0 to 655300 to 655300 to 65530Data double word in DB

DIX0.0 to 65533.71)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 655331)0 to 655330 to 655330 to 65533Data byte in instance DB

DIW0 to 655321)0 to 655320 to 655320 to 65532Data word in instance DB DID0 to 655301)0 to 655300 to 655300 to 65530Data double word instance DB

1) Also restricted by the size of the working memory. 2) Default setting can be changed, see Technical Specifications

Address Identifier and Parameter Ranges, continued

S7-400 Instruction List A5E00069511-07

Address Identifier and Parameter Ranges, continued

Addr. Parameter Range Description IDCPU 412CPU 414CPU 416CPU 417

I2)0.0 to 127.70.0 to 255.70.0 to 511.70.0 to 1023.7Input bit (in PII) IB2)0 to 1270 to 2550 to 5110 to 1023Input byte (in PII) IW2)0 to 1260 to 2540 to 5100 to 1022Input word (in PII) ID2)0 to 1240 to 2520 to 5080 to 1020Input double word (in PII)

L2)0.0 to 4095.70.0 to 8191.70.0 to 16383.70.0 to 32767.0Local data LB2)0 to 40950 to 81910 to 163830 to 32767Local data byte LW2)0 to 40940 to 81900 to 163820 to 32766Local data word LD2)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

(Parte 1 de 8)

Comentários