A block convert from S7-300 Simatic Manager to S7-1200 V16

tulip

Member
Join Date
Oct 2005
Location
ist
Posts
236
Hello.We are trying to convert a program written with S7-300 Simatic Manager to S7-1200 V16.Unfortunately, there is only LAD,FBD option in S7-1200 TIA Software. The program is below and records the operating hours in a DB when the relevant engine is activated. And this program is called 25 times.
Parameter entries:
IN0: Pulse input once per minute.
IN1: Engine started information.
IN2:(Relevant engine number in byte format, from 0 to 24 decimal value)
IN3:Data Block.


FC10:

OPN #IN3
L #IN2
L L#6
*D
SLD 3
T #TEMP4
ON #IN0
ON #IN1
JC M001
L #TEMP4
+ L#8
T #TEMP5
L DBB [#TEMP5]
+ B#16#1
T DBB [#TEMP5]
L B#16#3C
<I
JC M001
L B#16#0
T DBB [#TEMP5]
L #TEMP5
+ L#8
T #TEMP5
L DBD [#TEMP5]
+ L#1
T DBD [#TEMP5]
M001: AN DBX [#TEMP4]
JC M002
L 0
T DBW [#TEMP4]
L #TEMP4
+ L#16
T #TEMP5
L L#0
T DBD [#TEMP5]
M002: BE

Thanks in advance for any help..
 
Example code:
Code:
FUNCTION "fc1_Engine" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
   VAR_INPUT 
      In0 : Bool;
      In1 : Bool;
      In2 : Byte;
      In3 : DB_ANY;
   END_VAR

   VAR_TEMP 
      TEMP4 : Int;
      TEMP5 : Int;
      byData : Byte;
      bData : Bool;
      wData : Word;
      diData : DInt;
   END_VAR


BEGIN
    #TEMP4 := BYTE_TO_INT(#In2) * 6;
    IF NOT #In0 OR NOT #In1 THEN
        GOTO M001;
    END_IF;
        #TEMP5 := #TEMP4 + 1;
        #byData := PEEK_BYTE(dbNumber := #In3, area := b#16#84, byteOffset := #TEMP5);
        #byData := #byData + 1;
        POKE(dbNumber := #In3,
             area := b#16#84,
             byteOffset := #TEMP5,
             value := #byData);
        IF #byData < 60 THEN
            GOTO M001;
        END_IF;
        #byData := 0;
        POKE(dbNumber := #In3,
             area := b#16#84,
             byteOffset := #TEMP5,
             value := #byData);
        #TEMP5 := #TEMP5 + 1;
        #diData := DWORD_TO_DINT(PEEK_DWORD(dbNumber := #In3, area := b#16#84, byteOffset := #TEMP5));
        #diData := #diData + 1;
        POKE(dbNumber := #In3,
             area := b#16#84,
             byteOffset := #TEMP5,
             value := DINT_TO_DWORD(#diData));
        
    M001: #bData := PEEK_BOOL(area := b#16#84, dbNumber := #In3, byteOffset := #TEMP4, bitOffset := 0);
        IF NOT #bData THEN
            GOTO M002;
        END_IF;
            #wData := 0;
            POKE(area:=b#16#84,
                 dbNumber:=#In3,
                 byteOffset:=#TEMP4,
                 value:=#wData);
            #TEMP4 := #TEMP4 + 2;
            #diData := 0;
            POKE(area := b#16#84,
                 dbNumber := #In3,
                 byteOffset := #TEMP4,
                 value := DINT_TO_DWORD(#diData));
            
            
    M002: RETURN;
        
        
        
        
    
END_FUNCTION
 

Similar Topics

Helo I have a FB-Libary in Step 7 v5.4 i want to use in TIA-Portal V11 Sp2. How can i convert this?
Replies
5
Views
5,159
How To Convert S5 Data Block To S7? When I Open The Data Block Of S5 Only..km Or Km Or Kh Or..format Allow Me To See. Regards
Replies
1
Views
4,727
Is there anyway to take an RsLogix 5000 Ladder and auto convert it to Function Block, or any software that would automatically do it. even Ladder...
Replies
1
Views
7,477
In the past, we have used AB 1492 feed thru screw terminals a lot. Lead time on these with our distributor is terrible. Is there an almost...
Replies
1
Views
119
Hello, This product that I have the 1790D-T8BV8B is discontinued, does anyone have the EDS file for it? I wonder if TechConnect will have this...
Replies
8
Views
188
Back
Top Bottom