Simatic S7 to Logix5000 Application Conversion Guide.pdf

(4393 KB) Pobierz
untitled
Simatic S7 to Logix5000
Application Conversion Guide
Application Solution
201043059.003.png 201043059.004.png
Important User Information
Solid state equipment has operational characteristics differing from those of electromechanical equipment. Safety Guidelines for the Appli-
cation, Installation and Maintenance of Solid State Controls (publication SGI-1.1 available from your local Rockwell Automation sales office
or online at http://literature.rockwellautomation.com ) describes some important differences between solid state equipment and hard-wired
electromechanical devices. Because of this difference, and also because of the wide variety of uses for solid state equipment, all persons re-
sponsible for applying this equipment must satisfy themselves that each intended application of this equipment is acceptable.
In no event will Rockwell Automation, Inc. be responsible or liable for indirect or consequential damages resulting from the use or application
of this equipment.
The examples and diagrams in this manual are included solely for illustrative purposes. Because of the many variables and requirements as-
sociated with any particular installation, Rockwell Automation, Inc. cannot assume responsibility or liability for actual use based on the ex-
amples and diagrams.
No patent liability is assumed by Rockwell Automation, Inc. with respect to use of information, circuits, equipment, or software described in
this manual.
Reproduction of the contents of this manual, in whole or in part, without written permission of Rockwell Automation, Inc., is prohibited.
Throughout this manual, when necessary, we use notes to make you aware of safety considerations.
Identifies information about practices or circumstances that can cause an explosion in a
hazardous environment, which may lead to personal injury or death, property damage, or
economic loss.
Identifies information that is critical for successful application and understanding of the product.
Identifies information about practices or circumstances that can lead to personal injury or death,
property damage, or economic loss. Attentions help you identify a hazard, avoid a hazard, and
recognize the consequence
Labels may be on or inside the equipment, for example, a drive or motor, to alert people that
dangerous voltage may be present.
Labels may be on or inside the equipment, for example, a drive or motor, to alert people that
surfaces may reach dangerous temperatures.
Allen-Bradley, Rockwell Automation, and TechConnect are trademarks of Rockwell Automation, Inc.
Trademarks not belonging to Rockwell Automation are property of their respective companies.
201043059.005.png
Table of Contents
Preface
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Conversion versus Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Additional Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
PLC Logic Conversion Services Provided by Rockwell Automation . . 9
Service Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
One-stop PLC Program Conversion Services . . . . . . . . . . . . . . . . . 9
Service Benefits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Services Offered. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Basic Conversion Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Conversion Plus Initial Clean-up Package . . . . . . . . . . . . . . . . . . . 10
Additional Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Additional Program Conversions Available . . . . . . . . . . . . . . . . . . 11
Chapter 1
Hardware Conversion
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
S7 Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
I/O Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
S7 Local I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Selection and Configuration of S7 I/O Components . . . . . . . . . . 14
Logix Local I/O. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Selection and Configuration of Logix I/O Components . . . . . . . 18
S7 Remote I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Configuration of S7 Profibus DP Remote I/O . . . . . . . . . . . . . . . 21
Logix Distributed I/O. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Configuration of Logix Distributed I/O . . . . . . . . . . . . . . . . . . . . 22
Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Networks in S7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Networks in Logix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Conversion of HMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Conversion of Systems Containing Distributed Controllers . . . . . . . . 32
Hardware and Software Implementation . . . . . . . . . . . . . . . . . . . . 32
Connecting Siemens and Rockwell Automation Devices . . . . . . . . . . 34
Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Distributed Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Chapter 2
Logix Features that May Not be
Familiar to S7 Users
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
S7 Organization Blocks Compared to Logix Tasks . . . . . . . . . . . . . . . 36
Organization Blocks in S7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Tasks in Logix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Task Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Tags Not Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Data Areas in S7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Data in Logix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
I/O and Alias Tags. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Programming Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3 Publication LOGIX-AP008B-EN-P - June 2008
3
201043059.006.png
Table of Contents
Logix Ladder Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Logix Structured Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Logix Function Block Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Logix Sequential Function Chart . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Conversion of STEP 7 Code to Logix . . . . . . . . . . . . . . . . . . . . . . 55
Arrays not Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Add-On Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Add-On Instruction Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Backing Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
The Common Industrial Protocol (CIP). . . . . . . . . . . . . . . . . . . . . . . . 58
Viewing the Network. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Data Exchange between Controllers. . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Send / Receive in STEP 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Produced / Consumed Tags in Logix. . . . . . . . . . . . . . . . . . . . . . . 60
User-Defined Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Asynchronous I/O Updating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
The DINT Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Phase Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Phase Management in STEP 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
PhaseManager in Logix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Coordinated System Time (CST). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Timestamped Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Scheduled Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
No Temporary Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
No Accumulators or Special Registers needed . . . . . . . . . . . . . . . . . . . 66
Chapter 3
Conversion of System Software
and Standard Functions
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Logix System Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Date and Time Setting and Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Read System Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Handling of Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Status – Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Status – Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Status – for OBs and Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Conversion Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
String Handling Routines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Examples of System Function Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Setting the Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Disabling Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Read System Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Get Faults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Module Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
4
Publication LOGIX-AP008B-EN-P - June 2008
201043059.001.png
Table of Contents
Get Scan Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Chapter 4
Conversion of Typical Program
Structures
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Conversion Code Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Ladder Logic Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Jumps and Decision Making . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
User Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Pointers and Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
STEP 7 State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
STEP 7 Temporary Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Block Copy, COP and CPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Mathematical Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Other Topics Related to Programming. . . . . . . . . . . . . . . . . . . . . . . . 120
Scope of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
OBs, Tasks, and Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
A Larger Example - Control Module . . . . . . . . . . . . . . . . . . . . . . . . . 121
Components of the CM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
User Data Type Valve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
The Add-On Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Add-On Instruction Local Data . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Call-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Chapter 5
Common Mistakes when
Converting to Logix
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Not Selecting Appropriate Hardware . . . . . . . . . . . . . . . . . . . . . . . . . 129
Underestimating Impact of Task Scheduling . . . . . . . . . . . . . . . . . . . 130
Performing Translation Instead of Conversion . . . . . . . . . . . . . . . . . 130
Not Using the Most Appropriate Logix Languages . . . . . . . . . . . . . . 130
Implementation of Incorrect Data Types – DINT versus INT . . . . 131
Add DINTs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Add INTs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Timing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
User Code Emulating Existing Instructions . . . . . . . . . . . . . . . . . . . . 132
User Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
COP Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Incorrect Usage of COP, MOV, and CPS . . . . . . . . . . . . . . . . . . . . . 133
Incorrect Usage of CPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Not Handling Strings in Optimal Way . . . . . . . . . . . . . . . . . . . . . . . . 133
Extensive Usage of Jumps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Not Using Aliased Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Publication LOGIX-AP008B-EN-P - June 2008
5
201043059.002.png
Zgłoś jeśli naruszono regulamin