The text of a manual · part 7 of 18
Simatic S5 to RSLogix 5000 Application Conversion Guide: Chapter 2: Software Conversions - Program Structure, pages 47 to 52
Pages 47 to 52 of 140, from Simatic S5 to RSLogix 5000 Application Conversion Guide
The original document is the PDF (3.5 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Siemens 6ES5-431-8MA11, Siemens 6ES5-451-8MA11 and Siemens 6ES5-452-8MR11
Page 47
Software Conversions - Program Structure
Chapter 2
The tag database will automatically create the required addresses for the number of valves specified in the dimensions of the array as shown below.
Publication LOGIX-AP010B-EN-P - May 2010
47
Page 48
Chapter 2
Software Conversions - Program Structure
Programming Languages
This section describes the programming languages that are available with Step 5 and RSLogix 5000 software. All languages are not standard and depends on the version of the software purchased. Selection of the RSLogix 5000 language most suitable to the task will result in easier program design, more rapid coding, and a program that is easier to understand. There is one significant difference between the Step 5 and RSLogix 5000 languages. In Step 5, Statement List is the native language of the controller. This means that other languages are translated to STL. In RSLogix 5000 software, all the languages are native languages in the controller so each is compiled without reference to any of the others. Step 5 has these three standard languages: • Statement List (STL) - is a text-based programming language that uses statements to define what to execute. In German it is referred to as Anweisungsliste (AWL). A similar format, called Structured Text, exists in RSLogix 5000 software. • Ladder Diagram (LAD) - is a programming method using graphic symbols in a schematic circuit diagram format. In German it is referred to as Kontaktplan (KOP). • Control System Flowcharts (CFS) - is a programming method using graphic symbols. In German it is referred to as Funktionsplan (FUP). This format also exists in RSLogix 5000 software and is referred to as Function Block Diagram. GRAPH 5 is an extension of Step 5 and a software package for graphical programming of sequential control systems. GRAPH 5 allows a sequence to be programmed by breaking it down into a series of steps and transitions, which are then programmed by using one of the standard languages (STL, LAD or CFS). RSLogix 5000 software has four programming languages: • Ladder Diagram (LD) – comparable to Step 5 LAD, with an expanded instruction set. • Structured Text (ST) – comparable in structure to higher level computer languages such as C and VBA. • Function Block Diagram (FBD) – Equivalent to Step 5 CFS. • Sequential Function Chart (SFC) – comparable to Step 5 GRAPH 5/II. When converting an application from S5 to Logix it is not necessary to choose the same language in RSLogix 5000 software as was used in Step 5.
48
Publication LOGIX-AP010B-EN-P - May 2010
Page 49
Software Conversions - Program Structure
Chapter 2
RSLogix 5000 Ladder Diagram Traditionally, Ladder Diagram is used for implementing Boolean combinational logic. In RSLogix 5000 software, it can also be used for sequential logic, motion, data manipulation, and mathematical calculations, although other languages may be more convenient for these tasks.
RSLogix 5000 Structured Text Structured Text is a high level procedural language that is similar in structure to Visual Basic, Pascal and C. It is used primarily for data manipulation and mathematical calculations, although motion, combinational, and sequential logic can also be programmed in Structured Text.
RSLogix 5000 Function Block Diagram Function Block Diagram describes graphically a Boolean or mathematical function relating input variables and output variables. Input and output variables are connected to blocks by connection lines. An output of a block may also be connected to an input of another block. It is a good practice to program PID loops in FBD. It is the most convenient language for process control.
RSLogix 5000 Sequential Function Chart SFC is a graphical tool for describing sequential logic as a set of states and transitions. Outputs may be assigned to a state, and conditions with Boolean results for transitions to other states defined.
Publication LOGIX-AP010B-EN-P - May 2010
49
Page 50
Chapter 2
Software Conversions - Program Structure
Conversion of STEP 5 Code to RSLogix 5000 Software
For most applications the easiest conversion is to convert the Step 5 program to RSLogix 5000 software with the same programming language. So a Step 5 program written in ladder logic should be converted to an RSLogix 5000 ladder program. Similarly, a Step 5 Control System Flowchart should be converted to an RSLogix 5000 Function Block Diagram program, and a Step 5 Structured Text program should be converted to an RSLogix 5000 Statement List program. However, sometimes it is better to consider another language. In Step 5, PLC code was often programmed in STL for execution speed (no internal translation to native STL language needed) and because it offered more flexibility and more powerful programming compared to the other languages. For example, consider RSLogix 5000 SFC programming language if the Step 5 application is mainly a series of discrete steps that must be executed in an easily defined sequence. Also, the one-shot instruction that did not exist in Step 5 and must be programmed in a STL can easily be done in an RSLogix 5000 Ladder diagram. Another consideration would be the PIDE block that only exists in FBD language in RSLogix 5000. RSLogix 5000 programming languages are more flexible and contain a wider variety of functions than the older Step 5 package. You may reduce converted code complexity with RS Logix 5000 functions unavailable in Step 5. For example, Step 5 does not allow mathematical calculations such as addition and subtraction to be performed on some data types. You cannot add a floating point number and an integer without first converting them to the same format. RSLogix 5000 software, however, can perform these mathematical calculations on other data types. RSLogix 5000 software also lets the programmer perform multiple mathematical calculations in one instruction with the Compute (CPT) function to reduce code size and complexity when converting from Step 5.
Calculation in RSLogix5000 Ladder Diagram
To perform a mathematical operation on two operands in Step 5 Statement List, load these operands into Accumulator Registers, perform the required mathematical operation on the Accumulator Registers, and transfer the result from the Accumulator Register to the desired location. RSLogix 5000 Structured Text performs operations directly on the required tags and transfers the result directly to the required destination without using Accumulator Registers as in Step 5.
Calculation in RSLogix5000 Structured Text
50
Publication LOGIX-AP010B-EN-P - May 2010
Page 51
Software Conversions - Program Structure
Chapter 2
One of the first decisions in developing a Logix 5000 project is to define the functions or operations of your machine or process. 1. Identify the major functions/operations of your machine or process. 2. For each function, choose the programming language that best fits the function. • This may require revising the functions list to take advantage of other languages. • Use any combination of the languages in the same project. If the function or group of functions represent
Use this language
Continuous or parallel execution of multiple operations (not sequenced) Boolean or bit-based operations Complex logical operations Message and communication processing
Ladder Logic (LD)
Machine interlocking Operations that service or maintenance personnel must interpret to troubleshoot the machine or process Continuous process and drive control Loop control
Function Block Diagram (FBD)
Calculations in circuit flow High-level management of multiple operations Repetitive sequences of operations Batch process
Sequential Function Chart (SFC)
Motion control with structured text State machine operations Complex mathematical operations Specialized array or table loop processing
Structured Text (ST)
ASCII string handling or protocol processing
Publication LOGIX-AP010B-EN-P - May 2010
51
Page 52
Chapter 2
Software Conversions - Program Structure
Notes:
52
Publication LOGIX-AP010B-EN-P - May 2010