The text of a manual · part 8 of 18
Simatic S5 to RSLogix 5000 Application Conversion Guide: Chapter 3: Software Conversions Instructions, pages 53 to 61
Pages 53 to 61 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 53
Chapter
3
Software Conversions Instructions
Introduction
The object of this chapter is to demonstrate how typical programming instruction in S5 can be performed in RSLogix 5000 software. It examines examples of S5 instructions in other programming languages and seeks to find the best RSLogix equivalent in each case. It is not advised to translate the code one on one to RSLogix 5000 software. Some advanced, predefined instructions in RSLogix 5000 software can replace whole parts of Step 5 code (instructions did not exist in Step 5). RSLogix 5000 software also offers more functionality such as aliasing, program/controller tags. Therefore consider other programming techniques rather than imitating the programming in Step 5. Optimizing code by using the standard Logix functionality can improve the scan time substantially. Also see Chapter 4 – Additional RSLogix 5000 Features.
53Publication LOGIX-AP010B-EN-P - May 2010
53
Page 54
Chapter 3
Software Conversions Instructions
Binary Instruction: AND SIMATIC S5
RSLogix 5000
S5 Control System Flowchart
RSLogix Function Block Diagram
S5 Statement List
RSLogix 5000 Structured Text
A I1.0 A I1.2 A I1.3 =Q3.0
IF data_bit1 AND data_bit2 AND data_bit3 THEN out_bit1:= 1; END_IF; SIMATIC S5 - Ladder
RSLogix 5000 - Ladder
54
Publication LOGIX-AP010B-EN-P - May 2010
Page 55
Software Conversions Instructions
Chapter 3
Binary Instruction: OR SIMATIC S5
RSLogix 5000
S5 Control System Flowchart
RSLogix Function Block Diagram
S5 Statement List
RSLogix 5000 Structured Text
O I1.0 O I1.2 O I1.3 =Q3.0
IF data_bit1 OR data_bit2 OR data_bit3 THEN out_bit1:= 1; END_IF;
SIMATIC S5 - Ladder
RSLogix 5000 - Ladder
Publication LOGIX-AP010B-EN-P - May 2010
55
Page 56
Chapter 3
Software Conversions Instructions
Binary Instruction: SET/RESET SIMATIC S5
RSLogix 5000
S5 Control System Flowchart
RSLogix Function Block Diagram
S5 Statement List
RSLogix 5000 Structured Text
A I1.0 S Q3.0 A I1.1 R Q3.0
IF data_bit1 THEN out_bit1:= 1; END_IF; IF data_bit2 THEN out_bit1:= 0; END_IF; SIMATIC S5 - Ladder
RSLogix 5000 - Ladder
56
Publication LOGIX-AP010B-EN-P - May 2010
Page 57
Software Conversions Instructions
Chapter 3
Binary Instruction: PULSE SIMATIC S5
RSLogix 5000
The pulse instruction is used to detect a change of state of a digital flag and it generates a pulse that is ON for once scan cycle when this change of state occurs. RSLogix 5000 software has a dedicated pulse function while in S5 the function can be constructed as shown below. This is a good example of where it may be an option to use another language in RSLogix 5000 software than in the original S5 project. S5 Statement List
RSLogix 5000 Structured Text
(F2.0 = 1 for one cycle after I1.0 =1)
(PulseOutput =1 for one cycle after PulseInput goes from 0 to 1)
A I1.0 AN F4.0 = F2.0 A I.0 = F4.0
IF PulseInput and NOT PulseFlag THEN PulseOutput :=1; ELSE PulseOutput:=0; END_IF; PulseFlag :=PulseInput; SIMATIC S5 - Ladder
RSLogix 5000 - Ladder
Publication LOGIX-AP010B-EN-P - May 2010
57
Page 58
Chapter 3
Software Conversions Instructions
Binary Instruction: Transfer/Move SIMATIC S5
RSLogix 5000
S5 Statement List
RSLogix 5000 Structured Text
L FW10 T FW12 data_word2 := data_word1;
SIMATIC S5 - Ladder
RSLogix 5000 - Ladder
58
Publication LOGIX-AP010B-EN-P - May 2010
Page 59
Software Conversions Instructions
Chapter 3
On Delay Timer The following example shows how a ON DELAY function in SIMATIC S5 can be converted into a similar function in RSLogix 5000 software for Statement List and Ladder formats. In S5 the time base is determined by the digit after the decimal point in the statement L KT xxx.y, where xxx denotes the preset of the timer and y denotes the time base as one of the following: .0 => 0.01sec .1 => 0.1sec .2 => 1sec .3 => 10sec In RSLogix 5000 software, the time base is in milliseconds. The RSLogix 5000-equivalent bit/word for each bit/word used in the S5 in the following example is shown below. Usage of the RES instruction is optional. Function Timer Enable Reset Output S5 Statement List A L SR A R A =
I1.0 KT9.2 T3 I1.1 T3 T3 Q4.0
Publication LOGIX-AP010B-EN-P - May 2010
S5 I1.0 I1.1 Q4.0
RSLogix 5000 data_bit1 data_bit2 out_bit1 RSLogix 5000 Structured Text T2.Pre := 9000; T2.Reset := data_bit2; T2.TimerEnable := data_bit1; out_bit1 := T2.DN; where timer T2 is defined as data type FBD_TIMER in the program tags as follows.
59
Page 60
Chapter 3
Software Conversions Instructions
SIMATIC S5 - Ladder
RSLogix 5000 - Ladder where timer T1 is defined as data type TIMER in the program tags as follows.
60
Publication LOGIX-AP010B-EN-P - May 2010
Page 61
Software Conversions Instructions
Chapter 3
Off Delay Timer The following example shows how an OFF DELAY function in SIMATIC S5 can be converted into a similar function in RSLogix 5000 for Statement List and Ladder formats. The RSLogix 5000-equivalent bit/word for each bit/word used in the S5 in the following example is shown below. Usage of the RES instruction is optional. Function Timer Enable Reset Output S5 Statement List AN L SF A R A =
I1.0 KT9.2 T3 I1.1 T3 T3 Q4.0
Publication LOGIX-AP010B-EN-P - May 2010
S5 I1.0 I1.1 Q4.0
RSLogix 5000 data_bit1 data_bit1 out_bit1 RSLogix 5000 Structured Text T1.Pre := 9000; T1.Reset := data_bit2; T1.TimerEnable := data_bit1; TOFR(T1); out_bit1 := T1.DN; where timer T1 is defined as data type FBD_TIMER in the program tags as follows.
61