WHAT DOING THIS BLOCK ?

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
milhaushk
Posts: 9
Joined: Sun Sep 07, 2014 3:51 pm

WHAT DOING THIS BLOCK ?

Post by milhaushk »

Hi help my please what doing this block ?
https://ulozto.cz/!OvdiwNBm3vgs/fc1-awl
(close)
FC1.AWL
Show

Code: Select all

FUNCTION FC 1 : VOID
TITLE =
VERSION : 0.1


VAR_INPUT
  IN0 : BOOL ;	
  IN1 : INT ;	
  IN2 : BOOL ;	
  IN3 : BOOL ;	
END_VAR
VAR_OUTPUT
  OUT4 : BOOL ;	
END_VAR
VAR_IN_OUT
  IO5 : DINT ;	
END_VAR
VAR_TEMP
  TEMP6 : STRUCT 	
   TEMP7 : BOOL ;	
   TEMP8 : BOOL ;	
   TEMP9 : BOOL ;	
   TEMP10 : BOOL ;	
   TEMP11 : BOOL ;	
   TEMP12 : BOOL ;	
   TEMP13 : BOOL ;	
   TEMP14 : BOOL ;	
   TEMP15 : BYTE ;	
   TEMP16 : BYTE ;	
   True_if_IN2 : BOOL ;	//Pokud je IO2 1 tak je hodnota 1
   True_if_IN3 : BOOL ;	//Pokud je IO3 1 tak je hodnota 1
   TEMP19 : BOOL ;	
   TEMP20 : BOOL ;	
   TEMP21 : BOOL ;	
   TEMP22 : BOOL ;	
   TEMP23 : BOOL ;	
   TEMP24 : BOOL ;	
  END_STRUCT ;	
  IO1kr1 : BYTE ;	//IO1 nбsobek jednй IO1 * 1
  TEMP26 : BOOL ;	
  TEMP27 : BOOL ;	
  Math_2 : BYTE ;	//Nбsobek matematickэ 1*2 ????
  IO1bez2 : BYTE ;	//VstupIO1 menљн o 2
  TEMP30 : BOOL ;	
END_VAR
BEGIN
NETWORK
TITLE =

      L     1; 
      L     2; 
      *I    ; 
      T     #Math_2; // nasobek 1*2
      L     #IN1; 
      L     1; 
      *I    ; // nasobek vstup int1 * 1
      L     #Math_2; 
      -I    ; // odecti 
      T     #IO1bez2; // IN1 menљн o 2
      L     #IN1; // mensi temp28 o dva
      L     1; 
      *I    ; 
      T     #IO1kr1; // IO1 VYNБSOBENЭ 1 
      L     #IO5; 
      T     LD     0; 
NETWORK
TITLE =

      AN    #IN0; // pokud nenн InO 
      JCN   M004; // pokud nenн RLO 0 Skok nakonec Netvorku
      A     #IN2; // Pokud je INO 2 
      =     #TEMP6.True_if_IN2; // Nastav Temp6.Temp14 na 1
      A     #IN3; // Pokud je IN3 
      =     #TEMP6.True_if_IN3; // Nastav Temp6.Temp18 na 1
M004: NOP   1; 
NETWORK
TITLE =

      A     #TEMP6.TEMP7; 
      X     #TEMP6.TEMP19; 
      =     #TEMP26; 
      R     #TEMP6.TEMP20; 
      A     #TEMP6.TEMP7; 
      =     #TEMP6.TEMP19; 
      A     #IN0; 
      JCN   M001; 
      A     #TEMP6.TEMP7; 
      A(    ; 
      L     #TEMP6.TEMP16; 
      L     #Math_2; 
      >I    ; 
      )     ; 
      R     #TEMP6.True_if_IN2; 
      AN    #TEMP6.TEMP7; 
      A(    ; 
      L     #TEMP6.TEMP16; 
      L     #IO1kr1; 
      >=I   ; 
      )     ; 
      S     #TEMP6.True_if_IN2; 
      AN    #TEMP6.TEMP7; 
      A(    ; 
      L     #TEMP6.TEMP16; 
      L     #Math_2; 
      >I    ; 
      )     ; 
      R     #TEMP6.True_if_IN3; 
      A     #TEMP6.TEMP7; 
      A(    ; 
      L     #TEMP6.TEMP16; 
      L     #IO1kr1; 
      >=I   ; 
      )     ; 
      S     #TEMP6.True_if_IN3; 
M001: NOP   1; 
      AN    #TEMP6.TEMP7; 
      A     #TEMP6.True_if_IN2; 
      AN    #TEMP6.True_if_IN3; 
      O(    ; 
      A     #TEMP6.TEMP7; 
      AN    #TEMP6.True_if_IN2; 
      A     #TEMP6.True_if_IN3; 
      )     ; 
      =     #TEMP30; 
      A     #TEMP30; 
      S     #TEMP6.TEMP20; 
      AN    #TEMP30; 
      O     #TEMP6.TEMP14; 
      JCN   M002; 
      L     #TEMP6.TEMP16; 
      L     127; 
      <I    ; 
      A     M      1.5; 
      JCN   M002; 
      L     #TEMP6.TEMP16; 
      +     1; 
      T     #TEMP6.TEMP16; 
M002: NOP   1; 
      A(    ; 
      A     #TEMP26; 
      O     #TEMP6.TEMP20; 
      )     ; 
      AN    #TEMP6.TEMP14; 
      JCN   M003; 
      L     0; 
      T     #TEMP6.TEMP16; 
M003: NOP   1; 
NETWORK
TITLE =

      A(    ; 
      L     #TEMP6.TEMP16; 
      L     #IO1kr1; 
      >I    ; 
      AN    #TEMP6.TEMP14; 
      )     ; 
      O(    ; 
      AN    #TEMP30; 
      A     #TEMP6.TEMP20; 
      )     ; 
      JCN   M006; 
      SET   ; 
      R     #TEMP6.TEMP20; 
      S     #TEMP6.TEMP14; 
      L     0; 
      T     #TEMP6.TEMP16; 
M006: NOP   1; 
      A     #TEMP30; 
      A(    ; 
      L     #TEMP6.TEMP16; 
      L     2; 
      >=I   ; 
      )     ; 
      JCN   M007; 
      SET   ; 
      R     #TEMP6.TEMP14; 
      L     0; 
      T     #TEMP6.TEMP16; 
M007: NOP   1; 
NETWORK
TITLE =

      A     #TEMP6.TEMP20; 
      A     #TEMP6.True_if_IN2; 
      L     0; 
      JC    M008; 
      A     #TEMP6.TEMP20; 
      A     #TEMP6.True_if_IN3; 
      L     1; 
      JC    M008; 
      A     #TEMP6.TEMP7; 
      AN    #TEMP6.TEMP20; 
      L     2; 
      JC    M008; 
      AN    #TEMP6.TEMP7; 
      AN    #TEMP6.TEMP20; 
      L     3; 
      JC    M008; 
M008: NOP   1; 
      T     #TEMP6.TEMP15; 
NETWORK
TITLE =

      AN    #IN0; 
      JCN   M005; 
      A     #TEMP6.TEMP19; 
      =     #OUT4; 
M005: NOP   1; 
NETWORK
TITLE =

      L     LD     0; 
      T     #IO5; 
END_FUNCTION

almaz78
Posts: 108
Joined: Tue Dec 16, 2008 7:36 pm

Re: WHAT DOING THIS BLOCK ?

Post by almaz78 »

i just looove your question:)
SHKODRAN
Posts: 199
Joined: Wed Dec 24, 2008 4:37 pm
Location: Europe

Re: WHAT DOING THIS BLOCK ?

Post by SHKODRAN »

When one programmer starts a function with this statement....

Code: Select all

      L     1;
      L     2;
      *I    ;
      T     #Math_2; // nasobek 1*2
Rex2701
Posts: 374
Joined: Wed Oct 13, 2010 8:44 am
Location: Russian Federation

Re: WHAT DOING THIS BLOCK ?

Post by Rex2701 »

Comments are in сzech language, but the code looks like it was written by a Hindu.
milhaushk
Posts: 9
Joined: Sun Sep 07, 2014 3:51 pm

Re: WHAT DOING THIS BLOCK ?

Post by milhaushk »

we have this code in one machine.
The function is referenced to tap the functions.
Here is calling.

Code: Select all

       CALL FC 1
        IN0: = M7.0
        IN1: = 120
        IN2: = DB40.DBX0.6
        IN3: = DB40.DBX0.7
        OUT4: = DB41.DBX1.2
        IO5: = DB2.DBD0