ORGANIZATION_BLOCK "CYC_INT8_(10ms)"
TITLE =  "Cyclic Interrupt"
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : AE
VERSION : 0.1
   VAR_TEMP 
      OB35_EV_CLASS : Byte;   // Bits 0-3 = 1 (Coming event), Bits 4-7 = 1 (Event class 1)
      OB35_STRT_INF : Byte;   // 16#36 (OB 35 has started)
      OB35_PRIORITY : Byte;   // Priority of OB Execution
      OB35_OB_NUMBR : Byte;   // 35 (Organization block 35, OB35)
      OB35_RESERVED_1 : Byte;   // Reserved for system
      OB35_RESERVED_2 : Byte;   // Reserved for system
      OB35_PHASE_OFFSET : Word;   // Phase offset (msec)
      OB35_RESERVED_3 : Int;   // Reserved for system
      OB35_EXC_FREQ : Int;   // Frequency of execution (msec)
      OB35_DATE_TIME : Date_And_Time;   // Date and time OB35 started
      Save1 : DInt;
      Save2 : DInt;
   END_VAR


BEGIN
NETWORK
TITLE = AR1 und AR2 sichern
      TAR1;
      T #Save1;
      TAR2;
      T #Save2;

NETWORK
TITLE = Sensoren mit kurzen Imuls

///      L     "PEB112":P
///      T     "PEB112"
///      U     "TascheOK_M0051"
///      S     "DBereich"."Fast-Sensors".B1123

NETWORK
TITLE = 10ms Impuls
      L "MW38";
      + 1;//10ms-Takte aufaddieren
      T "MW38";

      CLR;
      ZV "Z35";

      SET;
      ZV "Z35";

      L "Z35";
      L 10;
      <I;
      SPB Ret;//bei 100ms weiter !

NETWORK
TITLE = 100ms Impuls / Takte aufaddieren
      L "MW36";
      + 1;//100ms-Takte aufaddieren
      T "MW36";

      SET;
      S "M35.0";//von OB35 (100ms Zeitinterrupt)
      R "Z35";

NETWORK
TITLE = AR1 und AR2 zurückschreiben
Ret:      L #Save1;
      LAR1;
      L #Save2;
      LAR2;

NETWORK
TITLE = Ende
      BE;

END_ORGANIZATION_BLOCK

