FUNCTION_BLOCK "FB_Main"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
   VAR_IN_OUT 
      stInOutControlUnitCabinetOF1 : "UDT_MainState";
      stInOutControlUnitCabinetOF3 : "UDT_MainState";
      stInOutControlUnitCabinetOF2 : "UDT_MainState";
      stInOutControlUnitCabinetOF4 : "UDT_MainState";
   END_VAR

   VAR 
      fbSortConv2101 : "FB_Conveyor_Sort";   // Pin-Kreisel
      fbSortConv2102 : "FB_Conveyor_Sort";   // Pin-Kreisel
      fbSortConv2201 : "FB_Conveyor_Sort";   // Pin-Kreisel
      fbSortConv2202 : "FB_Conveyor_Sort";   // Pin-Kreisel
      fbSortConv2303 : "FB_Conveyor_Sort";   // Pin-Kreisel
      fbSortConv2304 : "FB_Conveyor_Sort";   // Pin-Kreisel
      fbCarousel2110 : "FB_Conveyor";   // Kreisel
      fbCarousel2112 : "FB_Conveyor";   // Kreisel
      fbExitConv2103 : "FB_Conveyor";   // Kreisel
      fbExitConv2104 : "FB_Conveyor";   // Kreisel
      fbExitConv2203 : "FB_Conveyor";   // Kreisel
      fbExitConv2204 : "FB_Conveyor";   // Kreisel
      fbExitConv2301 : "FB_Conveyor";   // Kreisel
      fbExitConv2302 : "FB_Conveyor";   // Kreisel
      fbPinControl2101_1 : "FB_SupervisionRasterSensor";   // Pin-Überwachung mit "Zappler"-Sensor
      fbPinControl2101_2 : "FB_SupervisionRasterSensor";
      fbPinControl2102_1 : "FB_SupervisionRasterSensor";   // Pin-Überwachung mit "Zappler"-Sensor
      fbPinControl2102_2 : "FB_SupervisionRasterSensor";
      fbPinControl2201_1 : "FB_SupervisionRasterSensor";   // Pin-Überwachung mit "Zappler"-Sensor
      fbPinControl2201_2 : "FB_SupervisionRasterSensor";
      fbPinControl2202_1 : "FB_SupervisionRasterSensor";   // Pin-Überwachung mit "Zappler"-Sensor
      fbPinControl2202_2 : "FB_SupervisionRasterSensor";
      fbPinControl2303_1 : "FB_SupervisionRasterSensor";   // Pin-Überwachung mit "Zappler"-Sensor
      fbPinControl2303_2 : "FB_SupervisionRasterSensor";
      fbPinControl2304_1 : "FB_SupervisionRasterSensor";   // Pin-Überwachung mit "Zappler"-Sensor
      fbPinControl2304_2 : "FB_SupervisionRasterSensor";
      fbMonPinControl2101_1 : "FB_Monitoring";
      fbMonPinControl2101_2 : "FB_Monitoring";
      fbMonPinControl2102_1 : "FB_Monitoring";
      fbMonPinControl2102_2 : "FB_Monitoring";
      fbMonPinControl2201_1 : "FB_Monitoring";
      fbMonPinControl2201_2 : "FB_Monitoring";
      fbMonPinControl2202_1 : "FB_Monitoring";
      fbMonPinControl2202_2 : "FB_Monitoring";
      fbMonPinControl2303_1 : "FB_Monitoring";
      fbMonPinControl2303_2 : "FB_Monitoring";
      fbMonPinControl2304_1 : "FB_Monitoring";
      fbMonPinControl2304_2 : "FB_Monitoring";
      fbEncoderMonitor2101 : "FB_EncoderMonitor";   // Pin-Überwachung mit Encoder Werten
      fbEncoderMonitor2102 : "FB_EncoderMonitor";   // Pin-Überwachung mit Encoder Werten
      fbEncoderMonitor2201 : "FB_EncoderMonitor";   // Pin-Überwachung mit Encoder Werten
      fbEncoderMonitor2202 : "FB_EncoderMonitor";   // Pin-Überwachung mit Encoder Werten
      fbEncoderMonitor2303 : "FB_EncoderMonitor";   // Pin-Überwachung mit Encoder Werten
      fbEncoderMonitor2304 : "FB_EncoderMonitor";   // Pin-Überwachung mit Encoder Werten
      fbEncoderGF3200 : "FB_EncoderTR";   // Encoder
      fbEncoderGF3201 : "FB_EncoderTR";   // Encoder
      fbEncoderGF3202 : "FB_EncoderTR";   // Encoder
      fbEncoderGF3203 : "FB_EncoderTR";   // Encoder
      fbEncoderGF3204 : "FB_EncoderTR";   // Encoder
      fbEncoderGF3205 : "FB_EncoderTR";   // Encoder
   END_VAR
   VAR RETAIN
      arCognexInterface { S7_SetPoint := 'False'} : Array[1.."cNoScanner"] of "stCognexInterface";   // Cognex Barcode Reader Profinet Interface
   END_VAR
   VAR 
      stCognexInterfaceDummy : "stCognexInterface";   // Cognex Barcode Reader Profinet Interface Platzhalter
      TRO300 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_Vario";   // Vario Loaded von Highway
      TRO301 : "FB_ILS_MTRO_1Sep";   // 1Sep Loaded von Highway
      TRO302 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_Vario";   // Vario Loaded von Highway
      TRO303 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_Vario";   // Vario Empty von Highway
      TRO304 : "FB_ILS_MTRO_1Sep";   // 1Sep Empty von Highway
      TRO305 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_Vario";   // Vario Empty von Highway
      TRO306 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_Vario";   // Vario Empty zu Highway
      TRO307 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_Vario";   // Vario Loaded zu Highway
      TRO308 : "FB_ILS_MTRO_Vario";   // Vario von F2H
      TRO309 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_1Sep";   // 1Sep Level Eingang
      TRO310 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_1Sep";   // 1Sep Level Eingang
      TRO311 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_1Sep";   // 1Sep Level Eingang
      TRO312 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_1Sep";   // 1Sep Level Eingang
      TRO313 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Level Eingang
      TRO314 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_1Sep1Swi";   // 2Sep1Swi Block 2 Eingang
      TRO315 : "FB_ILS_MTRO_1Sep";   // 2Sep1Swi Block 1 Eingang
      TRO316 : "FB_ILS_MTRO_1Sep";   // 2Sep1Swi Block 3 Eingang (aktuell wie 1Sep)
      TRO317 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 1 zu Level 1
      TRO318 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 1 Einlagern
      TRO319 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 1 Auslagern
      TRO320 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 1 Auslagern
      TRO321 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 1 Auslagern
      TRO322 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 1 Auslagern
      TRO323 : "FB_ILS_MTRO_1Sep";   // 1Sep Block 1 Ausgang
      TRO324 : "FB_ILS_MTRO_Vario";   // Vario Block 1 von Level 1
      TRO325 : "FB_ILS_MTRO_1Sep";   // 1Sep Block 1 Ausgang
      TRO326 : "FB_ILS_MTRO_1Sep";   // 1Sep Block 1 Ausgang
      TRO327 : "FB_ILS_MTRO_PinStore_Auto";   // PinStore Block 2.1.1
      TRO328 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_Vario";   // Vario Rückführung 2.1.1
      TRO329 : "FB_ILS_MTRO_1Sep";   // 1Sep Rückführung 2.1.1
      TRO330 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_PinStore_Auto";   // PinStore Block 2.1.2
      TRO331 : "FB_ILS_MTRO_Vario";   // Vario Rückführung 2.1.2
      TRO332 : "FB_ILS_MTRO_1Sep";   // 1Sep Rückführung 2.1.2
      TRO333 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_PinStore_Auto";   // PinStore Block 2.1.3
      TRO334 : "FB_ILS_MTRO_Vario";   // Vario Rückführung 2.1.3
      TRO335 : "FB_ILS_MTRO_1Sep";   // 1Sep Rückführung 2.1.3
      TRO336 : "FB_ILS_MTRO_PinStore_Auto";   // PinStore Block 2.1.4
      TRO337 : "FB_ILS_MTRO_Vario";   // Vario Rückführung 2.1.4
      TRO338 : "FB_ILS_MTRO_1Sep";   // 1Sep Rückführung 2.1.4
      TRO339 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 2 zu Level 1
      TRO340 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 2 Einlagern
      TRO341 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 2 Auslagern
      TRO342 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 2 Auslagern
      TRO343 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 2 Auslagern
      TRO344 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 2 Auslagern
      TRO345 : "FB_ILS_MTRO_1Sep";   // 1Sep Block 2 Ausgang
      TRO346 : "FB_ILS_MTRO_Vario";   // Vario Block 2 von Level 1
      TRO347 : "FB_ILS_MTRO_1Sep";   // 1Sep Block 2 Ausgang
      TRO348 : "FB_ILS_MTRO_1Sep";   // 1Sep Block 2 Ausgang
      TRO349 : "FB_ILS_MTRO_PinStore_Auto";   // PinStore Block 2.2.1
      TRO350 : "FB_ILS_MTRO_Vario";   // Vario Rückführung 2.2.1
      TRO351 : "FB_ILS_MTRO_1Sep";   // 1Sep Rückführung 2.2.1
      TRO352 : "FB_ILS_MTRO_PinStore_Auto";   // PinStore Block 2.2.2
      TRO353 : "FB_ILS_MTRO_Vario";   // Vario Rückführung 2.2.2
      TRO354 : "FB_ILS_MTRO_1Sep";   // 1Sep Rückführung 2.2.2
      TRO355 : "FB_ILS_MTRO_PinStore_Auto";   // PinStore Block 2.2.3
      TRO356 : "FB_ILS_MTRO_Vario";   // Vario Rückführung 2.2.3
      TRO357 : "FB_ILS_MTRO_1Sep";   // 1Sep Rückführung 2.2.3
      TRO358 : "FB_ILS_MTRO_PinStore_Auto";   // PinStore Block 2.2.4
      TRO359 : "FB_ILS_MTRO_Vario";   // Vario Rückführung 2.2.4
      TRO360 : "FB_ILS_MTRO_1Sep";   // 1Sep Rückführung 2.2.4
      TRO361 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 3 zu Level 1
      TRO362 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 3 Einlagern
      TRO363 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 3 Auslagern
      TRO364 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 3 Auslagern
      TRO365 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 3 Auslagern
      TRO366 : "FB_ILS_MTRO_1Sep1Swi";   // 1Sep1Swi Block 3 Auslagern
      TRO367 : "FB_ILS_MTRO_1Sep";   // 1Sep Block 3 Ausgang
      TRO368 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_Vario";   // Vario Block 3 von Level 1
      TRO369 : "FB_ILS_MTRO_1Sep";   // 1Sep Block 3 Ausgang
      TRO370 : "FB_ILS_MTRO_1Sep";   // 1Sep Block 3 Ausgang
      TRO371 : "FB_ILS_MTRO_PinStore_Auto";   // PinStore Block 2.3.1
      TRO372 : "FB_ILS_MTRO_Vario";   // Vario Rückführung 2.3.1
      TRO373 : "FB_ILS_MTRO_1Sep";   // 1Sep Rückführung 2.3.1
      TRO374 : "FB_ILS_MTRO_PinStore_Auto";   // PinStore Block 2.3.2
      TRO375 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_Vario";   // Vario Rückführung 2.3.2
      TRO376 : "FB_ILS_MTRO_1Sep";   // 1Sep Rückführung 2.3.2
      TRO377 : "FB_ILS_MTRO_PinStore_Auto";   // PinStore Block 2.3.3
      TRO378 : "FB_ILS_MTRO_Vario";   // Vario Rückführung 2.3.3
      TRO379 : "FB_ILS_MTRO_1Sep";   // 1Sep Rückführung 2.3.3
      TRO380 : "FB_ILS_MTRO_PinStore_Auto";   // PinStore Block 2.3.4
      TRO381 : "FB_ILS_MTRO_Vario";   // Vario Rückführung 2.3.4
      TRO382 : "FB_ILS_MTRO_1Sep";   // 1Sep Rückführung 2.3.4
      TRO383 : "FB_ILS_MTRO_Vario";   // Vario von F2H
      TRO386 : "FB_ILS_MTRO_1Sep";
      fbBlink1 : "FB_Blinker";
      fbBlink2 : "FB_Blinker";
      fbBlink3 : "FB_Blinker";
      fbBlink4 : "FB_Blinker";
      fbBlink5 : "FB_Blinker";
      fbBlink6 : "FB_Blinker";
      rTrig_TRO271_TRO306 {InstructionName := 'R_TRIG'; LibVersion := '1.0'} : R_TRIG;
      rTrig_TRO273_TRO307 {InstructionName := 'R_TRIG'; LibVersion := '1.0'} : R_TRIG;
      rTrig_PinConv3 {InstructionName := 'R_TRIG'; LibVersion := '1.0'} : R_TRIG;
      rTrig_PinConv4 {InstructionName := 'R_TRIG'; LibVersion := '1.0'} : R_TRIG;
      rTrig_PinConv5 {InstructionName := 'R_TRIG'; LibVersion := '1.0'} : R_TRIG;
      rTrig_PinConv6 {InstructionName := 'R_TRIG'; LibVersion := '1.0'} : R_TRIG;
      nPosPin3 : DInt;
      nPosPin4 : DInt;
      nPosPin5 : DInt;
      nPosPin6 : DInt;
      xReInit : Bool;
      rTrigReInit {InstructionName := 'R_TRIG'; LibVersion := '1.0'; S7_SetPoint := 'False'} : R_TRIG;
      nBarcodeEmpty : DInt;   // NIU
   END_VAR

   VAR_TEMP 
      t_Automatik_OF1 : Bool;
      t_Automatik_OF2 : Bool;
      t_Automatik_OF3 : Bool;
      t_Automatik_OF4 : Bool;
      nActCar : Int;
      nActNo : Int;
      nNiu : DInt;
      stGenerateCarrier : "stCarrier";
      nCounter1 : DInt;
      xResult1 : Bool;
      nIdx : Int;
      nIdx2 : Int;
      nFound : Int;
      stEmptyCarrier : "stCarrier";
      stEmptyCarrierData : "stJamData";
      arCarrierPlaceHolder : Array[1..1] of "stCarrier";   // Platzhalter
      stJamDataPlaceHolder : "stJamData";
      stHMISwitchPlaceholder : "UDT_HMI_UnloadingStation";
      idx : Int;
      arEmptyStorageLine_1 : Int;
      arEmptyStorageLine : Array[1..1] of "stCarrier";
      arCarrierHandoverJam1109 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam1109 : "stJamData";
      arCarrierHandoverJam1209 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam1209 : "stJamData";
      arCarrierHandoverJam1309 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam1309 : "stJamData";
      arCarrierHandoverJam1401 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam1401 : "stJamData";
      arCarrierHandoverJam1501 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam1501 : "stJamData";
      arCarrierHandoverJam1601 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam1601 : "stJamData";
      arDummyEventCorrectionInfo : Array[0..1] of "stEventCorrectionInfo";
      arCarrierHandoverJam4301 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam4301 : "stJamData";
      arCarrierHandoverJam4401 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam4401 : "stJamData";
      nIdxUnloading : Int;
      tmpTSHRCounter : DInt;
      tmpTSHRResult : Bool;
      tmpPlaceHolderLaneStatus : Array[0..4] of String;
   END_VAR


BEGIN
	REGION Reinitialisieren
	    IF NOT #xReInit THEN
	        #xReInit := TRUE;
	    END_IF;
	    
	    #rTrigReInit(CLK := #xReInit);
	    
	    IF #rTrigReInit.Q THEN
	        
	        #TRO300.nState := "DB_GLOB_TroState".arTroState["cMainTro300"];
	        #TRO301.nState := "DB_GLOB_TroState".arTroState["cMainTro301"];
	        #TRO302.nState := "DB_GLOB_TroState".arTroState["cMainTro302"];
	        #TRO303.nState := "DB_GLOB_TroState".arTroState["cMainTro303"];
	        #TRO304.nState := "DB_GLOB_TroState".arTroState["cMainTro304"];
	        #TRO305.nState := "DB_GLOB_TroState".arTroState["cMainTro305"];
	        #TRO306.nState := "DB_GLOB_TroState".arTroState["cMainTro306"];
	        #TRO307.nState := "DB_GLOB_TroState".arTroState["cMainTro307"];
	        #TRO308.nState := "DB_GLOB_TroState".arTroState["cMainTro308"];
	        #TRO309.nState := "DB_GLOB_TroState".arTroState["cMainTro309"];
	        #TRO310.nState := "DB_GLOB_TroState".arTroState["cMainTro310"];
	        #TRO311.nState := "DB_GLOB_TroState".arTroState["cMainTro311"];
	        #TRO312.nState := "DB_GLOB_TroState".arTroState["cMainTro312"];
	        #TRO313.nState := "DB_GLOB_TroState".arTroState["cMainTro313"];
	        #TRO314.nState := "DB_GLOB_TroState".arTroState["cMainTro314"];
	        #TRO315.nState := "DB_GLOB_TroState".arTroState["cMainTro315"];
	        #TRO316.nState := "DB_GLOB_TroState".arTroState["cMainTro316"];
	        #TRO317.nState := "DB_GLOB_TroState".arTroState["cMainTro317"];
	        #TRO318.nState := "DB_GLOB_TroState".arTroState["cMainTro318"];
	        #TRO319.nState := "DB_GLOB_TroState".arTroState["cMainTro319"];
	        #TRO320.nState := "DB_GLOB_TroState".arTroState["cMainTro320"];
	        #TRO321.nState := "DB_GLOB_TroState".arTroState["cMainTro321"];
	        #TRO322.nState := "DB_GLOB_TroState".arTroState["cMainTro322"];
	        #TRO323.nState := "DB_GLOB_TroState".arTroState["cMainTro323"];
	        #TRO324.nState := "DB_GLOB_TroState".arTroState["cMainTro324"];
	        #TRO325.nState := "DB_GLOB_TroState".arTroState["cMainTro325"];
	        #TRO326.nState := "DB_GLOB_TroState".arTroState["cMainTro326"];
	        //     #TRO327.nState := "DB_GLOB_TroState".arTroState["cMainTro327"];
	        #TRO328.nState := "DB_GLOB_TroState".arTroState["cMainTro328"];
	        #TRO329.nState := "DB_GLOB_TroState".arTroState["cMainTro329"];
	        //     #TRO330.nState := "DB_GLOB_TroState".arTroState["cMainTro330"];
	        #TRO331.nState := "DB_GLOB_TroState".arTroState["cMainTro331"];
	        #TRO332.nState := "DB_GLOB_TroState".arTroState["cMainTro332"];
	        //     #TRO333.nState := "DB_GLOB_TroState".arTroState["cMainTro333"];
	        #TRO334.nState := "DB_GLOB_TroState".arTroState["cMainTro334"];
	        #TRO335.nState := "DB_GLOB_TroState".arTroState["cMainTro335"];
	        //     #TRO336.nState := "DB_GLOB_TroState".arTroState["cMainTro336"];
	        #TRO337.nState := "DB_GLOB_TroState".arTroState["cMainTro337"];
	        #TRO338.nState := "DB_GLOB_TroState".arTroState["cMainTro338"];
	        #TRO339.nState := "DB_GLOB_TroState".arTroState["cMainTro339"];
	        #TRO340.nState := "DB_GLOB_TroState".arTroState["cMainTro340"];
	        #TRO341.nState := "DB_GLOB_TroState".arTroState["cMainTro341"];
	        #TRO342.nState := "DB_GLOB_TroState".arTroState["cMainTro342"];
	        #TRO343.nState := "DB_GLOB_TroState".arTroState["cMainTro343"];
	        #TRO344.nState := "DB_GLOB_TroState".arTroState["cMainTro344"];
	        #TRO345.nState := "DB_GLOB_TroState".arTroState["cMainTro345"];
	        #TRO346.nState := "DB_GLOB_TroState".arTroState["cMainTro346"];
	        #TRO347.nState := "DB_GLOB_TroState".arTroState["cMainTro347"];
	        #TRO348.nState := "DB_GLOB_TroState".arTroState["cMainTro348"];
	        //#TRO349.nState := "DB_GLOB_TroState".arTroState["cMainTro349"];
	        #TRO350.nState := "DB_GLOB_TroState".arTroState["cMainTro350"];
	        #TRO351.nState := "DB_GLOB_TroState".arTroState["cMainTro351"];
	        //       #TRO352.nState := "DB_GLOB_TroState".arTroState["cMainTro352"];
	        #TRO353.nState := "DB_GLOB_TroState".arTroState["cMainTro353"];
	        #TRO354.nState := "DB_GLOB_TroState".arTroState["cMainTro354"];
	        // #TRO355.nState := "DB_GLOB_TroState".arTroState["cMainTro355"];
	        #TRO356.nState := "DB_GLOB_TroState".arTroState["cMainTro356"];
	        #TRO357.nState := "DB_GLOB_TroState".arTroState["cMainTro357"];
	        // #TRO358.nState := "DB_GLOB_TroState".arTroState["cMainTro358"];
	        #TRO359.nState := "DB_GLOB_TroState".arTroState["cMainTro359"];
	        #TRO360.nState := "DB_GLOB_TroState".arTroState["cMainTro360"];
	        #TRO361.nState := "DB_GLOB_TroState".arTroState["cMainTro361"];
	        #TRO362.nState := "DB_GLOB_TroState".arTroState["cMainTro362"];
	        #TRO363.nState := "DB_GLOB_TroState".arTroState["cMainTro363"];
	        #TRO364.nState := "DB_GLOB_TroState".arTroState["cMainTro364"];
	        #TRO365.nState := "DB_GLOB_TroState".arTroState["cMainTro365"];
	        #TRO366.nState := "DB_GLOB_TroState".arTroState["cMainTro366"];
	        #TRO367.nState := "DB_GLOB_TroState".arTroState["cMainTro367"];
	        #TRO369.nState := "DB_GLOB_TroState".arTroState["cMainTro369"];
	        #TRO370.nState := "DB_GLOB_TroState".arTroState["cMainTro370"];
	        // #TRO371.nState := "DB_GLOB_TroState".arTroState["cMainTro371"];
	        #TRO372.nState := "DB_GLOB_TroState".arTroState["cMainTro372"];
	        #TRO373.nState := "DB_GLOB_TroState".arTroState["cMainTro373"];
	        // #TRO374.nState := "DB_GLOB_TroState".arTroState["cMainTro374"];
	        #TRO375.nState := "DB_GLOB_TroState".arTroState["cMainTro375"];
	        #TRO376.nState := "DB_GLOB_TroState".arTroState["cMainTro376"];
	        // #TRO377.nState := "DB_GLOB_TroState".arTroState["cMainTro377"];
	        #TRO378.nState := "DB_GLOB_TroState".arTroState["cMainTro378"];
	        #TRO379.nState := "DB_GLOB_TroState".arTroState["cMainTro379"];
	        // #TRO380.nState := "DB_GLOB_TroState".arTroState["cMainTro380"];
	        #TRO381.nState := "DB_GLOB_TroState".arTroState["cMainTro381"];
	        #TRO382.nState := "DB_GLOB_TroState".arTroState["cMainTro382"];
	        #TRO386.nState := "DB_GLOB_TroState".arTroState["cMainTro386"];
	        
	        
	    END_IF;
	    
	END_REGION
	
	REGION Automatik
	   // #t_Automatik := #stInOutControlUnitCabinet.xRunning AND NOT #stInOutControlUnitCabinet.xStarting AND "DB_InterfaceSafety".stFromSafety.EStopMain.Q;
	    
	    
	    #t_Automatik_OF1 := "DB_InterfaceSafety".stFromSafety.stMainContactorsUH03.Q; //#stInOutControlUnitCabinetOF1.xRunning AND NOT #stInOutControlUnitCabinetOF1.xStarting AND "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q(* AND "IBN".xAutomatikON *);
	    #t_Automatik_OF2 := "DB_InterfaceSafety".stFromSafety.stMainContactorsUC031.Q; //#stInOutControlUnitCabinetOF2.xRunning AND NOT #stInOutControlUnitCabinetOF2.xStarting AND "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q(* AND "IBN".xAutomatikON *);
	    #t_Automatik_OF3 := "DB_InterfaceSafety".stFromSafety.stMainContactorsUC032.Q; //#stInOutControlUnitCabinetOF3.xRunning AND NOT #stInOutControlUnitCabinetOF3.xStarting AND "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q(* AND "IBN".xAutomatikON *);
	    #t_Automatik_OF4 := "DB_InterfaceSafety".stFromSafety.stMainContactorsUC033.Q; //#stInOutControlUnitCabinetOF4.xRunning AND NOT #stInOutControlUnitCabinetOF4.xStarting AND "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q(* AND "IBN".xAutomatikON *);
	END_REGION
	
	REGION Conveyor
	    REGION Pin-Sorter
	        REGION Conveyor 2101
	            #fbSortConv2101.Settings.tEnergySafeTime := T#120s; // Konstante TODO
	            #fbSortConv2101.Settings.tStartingTime := T#50ms;
	            #fbSortConv2101.Settings.xGridActive := FALSE;
	            #fbSortConv2101.Settings.sMotorProtectName := 'FC0140';
	           
	            #fbSortConv2101(xInEnabled :=
	                            "SF0120" AND "SF0122" AND 
	                            NOT #fbPinControl2101_1.xOutErrorRasterSensor AND
	                            NOT #fbPinControl2101_2.xOutErrorRasterSensor AND 
	                            NOT #fbEncoderMonitor2101.xOutError AND 
	                            NOT #TRO327.xOutUnloadingError AND
	                            NOT #TRO330.xOutUnloadingError,
	                            xInFull := "cTodoFalse",
	                            xInNextConveyorReady := "cTodoTRUE",
	                            xInAutomaticMode := #t_Automatik_OF2,
	                            xInEnergySafeRequest := NOT #stInOutControlUnitCabinetOF2.xRestart AND NOT #TRO327.xOutConvReqSort AND
	                            NOT #TRO330.xOutConvReqSort AND NOT #TRO329.xOutCarouselReq AND
	                            NOT #TRO332.xOutCarouselReq AND NOT #TRO318.xOutCarouselReq2,
	                            xInChainBreakMonitoring := TRUE,
	                            xInChainBreakMonitoringSmoothing := false,
	                            xInMotorProtectionMonitoring := "FC0140",
	                            xInSafetyEnable := "cTodoTRUE",
	                            xOutPowerContactor => "MA0140",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF2,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".#stConveyors.stSort.stCS2101);
	            
	            REGION Überwachung Pins 1
	                
	                #fbPinControl2101_1.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl2101_1.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl2101_1.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2101_1.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2101_1(stInSenRaster := "DB_Inputs".Sensors["cInBG3061"],
	                                  xInErrorQuit := "SF0121" OR "SF0123" OR "SF0117",
	                                  xInMotorRun := #fbSortConv2101.xOutConveyorFullSpeed);
	              
	              REGION Monitoring
	                  #fbMonPinControl2101_1.stSettings.nErrorType := 1;
	                  #fbMonPinControl2101_1.stSettings.xErrLedIfMachineIsOff := TRUE;
	                  #fbMonPinControl2101_1.stSettings.xSelfQuit := TRUE;
	                  #fbMonPinControl2101_1.stSettings.tDelay := T#1s;
	                  #fbMonPinControl2101_1(sInFctnName := 'Rastersensorueberwachung',
	                                         sInPrefix := 'KR-M2101',
	                                         wInTextListId_Function := 3000,
	                                         wInTextListId_Message := 3000,
	                                         sInSuffix := "DB_Inputs".Sensors["cInBG3061"].sName,
	                                         InOutMachineState := #stInOutControlUnitCabinetOF2,
	                                         xInQuitError := #stInOutControlUnitCabinetOF2.xQuitError,
	                                         xInSignal := NOT #fbPinControl2101_1.xOutErrorRasterSensor,
	                                         sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	              END_REGION
	                
	          END_REGION
	          
	          REGION Überwachung Pins 2
	              
	              #fbPinControl2101_2.stInSettings.xInEnableSupervision := TRUE;
	              #fbPinControl2101_2.stInSettings.tInDelayMotorRun := T#1000ms;
	              #fbPinControl2101_2.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	              #fbPinControl2101_2.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	              #fbPinControl2101_2(stInSenRaster := "DB_Inputs".Sensors["cInBG3001"],
	                                  xInErrorQuit := "SF0121" OR "SF0123" OR "SF0117",
	                                  xInMotorRun := #fbSortConv2101.xOutConveyorFullSpeed);
	              
	              REGION Monitoring
	                  #fbMonPinControl2101_2.stSettings.nErrorType := 1;
	                  #fbMonPinControl2101_2.stSettings.xErrLedIfMachineIsOff := TRUE;
	                  #fbMonPinControl2101_2.stSettings.xSelfQuit := TRUE;
	                  #fbMonPinControl2101_2.stSettings.tDelay := T#1s;
	                  #fbMonPinControl2101_2(sInFctnName := 'Rastersensorueberwachung',
	                                         sInPrefix := 'KR-M2101',
	                                         wInTextListId_Function := 3000,
	                                         wInTextListId_Message := 3000,
	                                         sInSuffix := "DB_Inputs".Sensors["cInBG3001"].sName,
	                                         InOutMachineState := #stInOutControlUnitCabinetOF2,
	                                         xInQuitError := #stInOutControlUnitCabinetOF2.xQuitError,
	                                         xInSignal := NOT #fbPinControl2101_2.xOutErrorRasterSensor,
	                                         sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	              END_REGION
	              
	          END_REGION
	            
	            REGION Überwachung Encoder
	                #fbEncoderMonitor2101(sInConveyorName := 'KR-2101',
	                                      sInEncoderName := 'GF3200',
	                                      nInEncoderValue := "GF3200_PosAct",
	                                      nInEncoderMax := "cEncoderGF3200",
	                                      nInEncMonVal := "cEncMonVal",
	                                      xInClock := "Clock_2Hz",
	                                      xInConveyorRun := #fbSortConv2101.xOutConveyorFullSpeed,
	                                      xInQuit := "SF0121" OR "SF0123" OR "SF0117",
	                                      xInActivate := TRUE,
	                                      stInOutControlUnitCabinet:=#stInOutControlUnitCabinetOF2);
	            END_REGION
	            
	        END_REGION
	        
	        REGION Conveyor 2102
	            #fbSortConv2102.Settings.tEnergySafeTime := T#120s; // Konstante TODO
	            #fbSortConv2102.Settings.tStartingTime := T#50ms;
	            #fbSortConv2102.Settings.xGridActive := FALSE;
	            #fbSortConv2102.Settings.sMotorProtectName := 'FC0141';
	            #fbSortConv2102(xInEnabled :=
	                            "SF0124" AND "SF0126" AND
	                            NOT #fbPinControl2102_1.xOutErrorRasterSensor AND
	                            NOT #fbPinControl2102_2.xOutErrorRasterSensor AND 
	                            NOT #fbEncoderMonitor2102.xOutError AND
	                            NOT #TRO333.xOutUnloadingError AND
	                            NOT #TRO336.xOutUnloadingError,
	                            xInFull := "cTodoFalse",
	                            xInNextConveyorReady := "cTodoTRUE",
	                            xInAutomaticMode := #t_Automatik_OF2,
	                            xInEnergySafeRequest := NOT #stInOutControlUnitCabinetOF2.xRestart AND NOT #TRO333.xOutConvReqSort AND
	                            NOT #TRO336.xOutConvReqSort AND NOT #TRO335.xOutCarouselReq AND
	                            NOT #TRO338.xOutCarouselReq AND NOT #TRO318.xOutCarouselReq1 AND NOT #TRO318.xOutCarouselReq2 AND 
	                            NOT #TRO317.xOutCarouselReq1 AND NOT #TRO317.xOutCarouselReq2 AND
	                            NOT #TRO315.xOutCarouselReq,
	                            xInChainBreakMonitoring := TRUE,
	                            xInChainBreakMonitoringSmoothing := false,
	                            xInMotorProtectionMonitoring := "FC0141",
	                            xInSafetyEnable := "cTodoTRUE",
	                            xOutPowerContactor => "MA0141",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF2,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".stConveyors.stSort.stCS2102);
	            
	            REGION Überwachung Pins 1
	                
	                #fbPinControl2102_1.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl2102_1.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl2102_1.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2102_1.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2102_1(stInSenRaster := "DB_Inputs".Sensors["cInBG3121"],
	                                    xInErrorQuit := "SF0125" OR "SF0127" OR "SF0117",
	                                    xInMotorRun := #fbSortConv2102.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl2102_1.stSettings.nErrorType := 1;
	                    #fbMonPinControl2102_1.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl2102_1.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl2102_1.stSettings.tDelay := T#1s;
	                    #fbMonPinControl2102_1(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M2102',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG3121"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF2,
	                                           xInQuitError := #stInOutControlUnitCabinetOF2.xQuitError,
	                                           xInSignal := NOT #fbPinControl2102_1.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	                
	            END_REGION
	            
	            REGION Überwachung Pins 2
	                
	                #fbPinControl2102_2.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl2102_2.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl2102_2.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2102_2.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2102_2(stInSenRaster := "DB_Inputs".Sensors["cInBG3181"],
	                                    xInErrorQuit := "SF0125" OR "SF0127" OR "SF0117",
	                                    xInMotorRun := #fbSortConv2102.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl2102_2.stSettings.nErrorType := 1;
	                    #fbMonPinControl2102_2.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl2102_2.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl2102_2.stSettings.tDelay := T#1s;
	                    #fbMonPinControl2102_2(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M2102',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG3181"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF2,
	                                           xInQuitError := #stInOutControlUnitCabinetOF2.xQuitError,
	                                           xInSignal := NOT #fbPinControl2102_2.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	                
	            END_REGION
	            
	            REGION Überwachung Encoder
	                #fbEncoderMonitor2102(sInConveyorName := 'KR-2102',
	                                      sInEncoderName := 'GF3201',
	                                      nInEncoderValue := "GF3201_PosAct",
	                                      nInEncoderMax := "cEncoderGF3201",
	                                      nInEncMonVal := "cEncMonVal",
	                                      xInClock := "Clock_2Hz",
	                                      xInConveyorRun := #fbSortConv2102.xOutConveyorFullSpeed,
	                                      xInQuit := "SF0125" OR "SF0127" OR "SF0117",
	                                      xInActivate := TRUE,
	                                      stInOutControlUnitCabinet:=#stInOutControlUnitCabinetOF2);
	            END_REGION
	            
	        END_REGION
	        
	        REGION Conveyor 2201
	            #fbSortConv2201.Settings.tEnergySafeTime := T#120s; // Konstante TODO
	            #fbSortConv2201.Settings.tStartingTime := T#50ms;
	            #fbSortConv2201.Settings.xGridActive := FALSE;
	            #fbSortConv2201.Settings.sMotorProtectName := 'FC0062';
	            #fbSortConv2201(xInEnabled :=
	                            "SF0050" AND "SF0052" AND
	                            NOT #fbPinControl2201_1.xOutErrorRasterSensor AND
	                            NOT #fbPinControl2201_2.xOutErrorRasterSensor AND 
	                            NOT #fbEncoderMonitor2201.xOutError AND
	                            NOT #TRO349.xOutUnloadingError AND
	                            NOT #TRO352.xOutUnloadingError,
	                            xInFull := "cTodoFalse",
	                            xInNextConveyorReady := "cTodoTRUE",
	                            xInAutomaticMode := #t_Automatik_OF1,
	                            xInEnergySafeRequest := NOT #stInOutControlUnitCabinetOF1.xRestart AND NOT #TRO349.xOutConvReqSort AND
	                            NOT #TRO352.xOutConvReqSort AND NOT #TRO351.xOutCarouselReq AND
	                            NOT #TRO354.xOutCarouselReq AND NOT #TRO340.xOutCarouselReq2 AND NOT #TRO340.xOutCarouselReq1,
	                            xInChainBreakMonitoring := TRUE,
	                            xInChainBreakMonitoringSmoothing := false,
	                            xInMotorProtectionMonitoring := "FC0062",
	                            xInSafetyEnable := "cTodoTRUE",
	                            xOutPowerContactor => "MA0062",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".stConveyors.stSort.stCS2201);
	            
	            REGION Überwachung Pins 1
	                
	                #fbPinControl2201_1.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl2201_1.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl2201_1.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2201_1.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2201_1(stInSenRaster := "DB_Inputs".Sensors["cInBG3481"],
	                                    xInErrorQuit := "SF0051",
	                                    xInMotorRun := #fbSortConv2201.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl2201_1.stSettings.nErrorType := 1;
	                    #fbMonPinControl2201_1.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl2201_1.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl2201_1.stSettings.tDelay := T#1s;
	                    #fbMonPinControl2201_1(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M2201',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG3481"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF1,
	                                           xInQuitError := #stInOutControlUnitCabinetOF1.xQuitError,
	                                           xInSignal := NOT #fbPinControl2201_1.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	          END_REGION
	            
	          REGION Überwachung Pins 2
	              
	              #fbPinControl2201_2.stInSettings.xInEnableSupervision := 0;//TRUE;
	              #fbPinControl2201_2.stInSettings.tInDelayMotorRun := T#1000ms;
	              #fbPinControl2201_2.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	              #fbPinControl2201_2.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	              #fbPinControl2201_2(stInSenRaster := "DB_Inputs".Sensors["cInBG3541"],
	                                  xInErrorQuit := "SF0053",
	                                  xInMotorRun := #fbSortConv2201.xOutConveyorFullSpeed);
	              
	              REGION Monitoring
	                  #fbMonPinControl2201_2.stSettings.nErrorType := 1;
	                  #fbMonPinControl2201_2.stSettings.xErrLedIfMachineIsOff := TRUE;
	                  #fbMonPinControl2201_2.stSettings.xSelfQuit := TRUE;
	                  #fbMonPinControl2201_2.stSettings.tDelay := T#1s;
	                  #fbMonPinControl2201_2(sInFctnName := 'Rastersensorueberwachung',
	                                         sInPrefix := 'KR-M2201',
	                                         wInTextListId_Function := 3000,
	                                         wInTextListId_Message := 3000,
	                                         sInSuffix := "DB_Inputs".Sensors["cInBG3541"].sName,
	                                         InOutMachineState := #stInOutControlUnitCabinetOF1,
	                                         xInQuitError := #stInOutControlUnitCabinetOF1.xQuitError,
	                                         xInSignal := NOT #fbPinControl2201_2.xOutErrorRasterSensor,
	                                         sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	              END_REGION
	              
	
	          END_REGION
	            
	            REGION Überwachung Encoder
	                #fbEncoderMonitor2201(sInConveyorName := 'KR-2201',
	                                      sInEncoderName := 'GF3202',
	                                      nInEncoderValue := "GF3202_PosAct",
	                                      nInEncoderMax := "cEncoderGF3202",
	                                      nInEncMonVal := "cEncMonVal",
	                                      xInClock := "Clock_2Hz",
	                                      xInConveyorRun := #fbSortConv2201.xOutConveyorFullSpeed,
	                                      xInQuit := "SF0051" OR "SF0053",
	                                      xInActivate := TRUE,
	                                      stInOutControlUnitCabinet:=#stInOutControlUnitCabinetOF1);
	            END_REGION
	            
	        END_REGION
	        
	        REGION Conveyor 2202
	            #fbSortConv2202.Settings.tEnergySafeTime := T#120s; // Konstante TODO
	            #fbSortConv2202.Settings.tStartingTime := T#50ms;
	            #fbSortConv2202.Settings.xGridActive := FALSE;
	            #fbSortConv2202.Settings.sMotorProtectName := 'FC0063';
	            #fbSortConv2202(xInEnabled :=
	                            "SF0054" AND "SF0056" AND
	                            NOT #fbPinControl2202_1.xOutErrorRasterSensor AND
	                            NOT #fbPinControl2202_2.xOutErrorRasterSensor AND
	                            NOT #fbEncoderMonitor2202.xOutError AND
	                            NOT #TRO355.xOutUnloadingError AND
	                            NOT #TRO358.xOutUnloadingError,
	                            xInFull := "cTodoFalse",
	                            xInNextConveyorReady := "cTodoTRUE",
	                            xInAutomaticMode := #t_Automatik_OF1,
	                            xInEnergySafeRequest := NOT #stInOutControlUnitCabinetOF1.xRestart AND NOT #TRO355.xOutConvReqSort AND
	                            NOT #TRO358.xOutConvReqSort AND NOT #TRO357.xOutCarouselReq AND
	                            NOT #TRO360.xOutCarouselReq AND NOT #TRO340.xOutCarouselReq1 AND
	                            NOT #TRO339.xOutCarouselReq1 AND NOT #TRO339.xOutCarouselReq2 AND
	                            NOT #TRO314.xOutCarouselReq1 AND NOT #TRO314.xOutCarouselReq2,
	                            xInChainBreakMonitoring := TRUE,
	                            xInChainBreakMonitoringSmoothing := false,
	                            xInMotorProtectionMonitoring := "FC0063",
	                            xInSafetyEnable := "cTodoTRUE",
	                            xOutPowerContactor => "MA0063",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".stConveyors.stSort.stCS2202);
	            
	            REGION Überwachung Pins 1
	                
	                #fbPinControl2202_1.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl2202_1.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl2202_1.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2202_1.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2202_1(stInSenRaster := "DB_Inputs".Sensors["cInBG3601"],
	                                    xInErrorQuit := "SF0055",
	                                    xInMotorRun := #fbSortConv2202.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl2202_1.stSettings.nErrorType := 1;
	                    #fbMonPinControl2202_1.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl2202_1.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl2202_1.stSettings.tDelay := T#1s;
	                    #fbMonPinControl2202_1(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M2202',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG3601"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF1,
	                                           xInQuitError := #stInOutControlUnitCabinetOF1.xQuitError,
	                                           xInSignal := NOT #fbPinControl2202_1.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	          END_REGION
	          
	          REGION Überwachung Pins 2
	              
	              #fbPinControl2202_2.stInSettings.xInEnableSupervision := TRUE;
	              #fbPinControl2202_2.stInSettings.tInDelayMotorRun := T#1000ms;
	              #fbPinControl2202_2.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	              #fbPinControl2202_2.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	              #fbPinControl2202_2(stInSenRaster := "DB_Inputs".Sensors["cInBG3661"],
	                                  xInErrorQuit := "SF0057",
	                                  xInMotorRun := #fbSortConv2202.xOutConveyorFullSpeed);
	              
	              REGION Monitoring
	                  #fbMonPinControl2202_2.stSettings.nErrorType := 1;
	                  #fbMonPinControl2202_2.stSettings.xErrLedIfMachineIsOff := TRUE;
	                  #fbMonPinControl2202_2.stSettings.xSelfQuit := TRUE;
	                  #fbMonPinControl2202_2.stSettings.tDelay := T#1s;
	                  #fbMonPinControl2202_2(sInFctnName := 'Rastersensorueberwachung',
	                                         sInPrefix := 'KR-M2202',
	                                         wInTextListId_Function := 3000,
	                                         wInTextListId_Message := 3000,
	                                         sInSuffix := "DB_Inputs".Sensors["cInBG3661"].sName,
	                                         InOutMachineState := #stInOutControlUnitCabinetOF1,
	                                         xInQuitError := #stInOutControlUnitCabinetOF1.xQuitError,
	                                         xInSignal := NOT #fbPinControl2202_2.xOutErrorRasterSensor,
	                                         sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	              END_REGION
	          END_REGION
	            
	          REGION Überwachung Encoder
	              #fbEncoderMonitor2202(sInConveyorName := 'KR-2202',
	                                    sInEncoderName := 'GF3203',
	                                    nInEncoderValue := "GF3203_PosAct",
	                                    nInEncoderMax := "cEncoderGF3203",
	                                    nInEncMonVal := "cEncMonVal",
	                                    xInClock := "Clock_2Hz",
	                                    xInConveyorRun := #fbSortConv2202.xOutConveyorFullSpeed,
	                                    xInQuit := "SF0055" OR "SF0057",
	                                    xInActivate := TRUE,
	                                    stInOutControlUnitCabinet:=#stInOutControlUnitCabinetOF1);
	          END_REGION
	            
	        END_REGION
	        
	        REGION Conveyor 2303
	            #fbSortConv2303.Settings.tEnergySafeTime := T#120s; // Konstante TODO
	            #fbSortConv2303.Settings.tStartingTime := T#50ms;
	            #fbSortConv2303.Settings.xGridActive := FALSE;
	            #fbSortConv2303.Settings.sMotorProtectName := 'FC0206';
	            #fbSortConv2303(xInEnabled :=
	                            "SF0240" AND "SF0242" AND
	                            NOT #fbPinControl2303_1.xOutErrorRasterSensor AND
	                            NOT #fbPinControl2303_2.xOutErrorRasterSensor AND
	                            NOT #fbEncoderMonitor2303.xOutError AND
	                            NOT #TRO371.xOutUnloadingError AND
	                            NOT #TRO374.xOutUnloadingError,
	                            xInFull := "cTodoFalse",
	                            xInNextConveyorReady := "cTodoTRUE",
	                            xInAutomaticMode := #t_Automatik_OF4,
	                            xInEnergySafeRequest := NOT #stInOutControlUnitCabinetOF4.xRestart AND NOT #TRO371.xOutConvReqSort AND
	                            NOT #TRO374.xOutConvReqSort AND NOT #TRO373.xOutCarouselReq AND
	                            NOT #TRO376.xOutCarouselReq AND NOT #TRO362.xOutCarouselReq1,
	                            xInChainBreakMonitoring := TRUE,
	                            xInChainBreakMonitoringSmoothing := false,
	                            xInMotorProtectionMonitoring := "FC0260",
	                            xInSafetyEnable := "cTodoTRUE",
	                            xOutPowerContactor => "MA0260",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF4,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".stConveyors.stSort.stCS2303);
	            
	            REGION Überwachung Pins 1
	                
	                #fbPinControl2303_1.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl2303_1.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl2303_1.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2303_1.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2303_1(stInSenRaster := "DB_Inputs".Sensors["cInBG4261"],
	                                    xInErrorQuit := "SF0243" OR "SF0237",
	                                    xInMotorRun := #fbSortConv2303.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl2303_1.stSettings.nErrorType := 1;
	                    #fbMonPinControl2303_1.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl2303_1.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl2303_1.stSettings.tDelay := T#1s;
	                    #fbMonPinControl2303_1(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M2303',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG4261"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF4,
	                                           xInQuitError := #stInOutControlUnitCabinetOF4.xQuitError,
	                                           xInSignal := NOT #fbPinControl2303_1.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	            END_REGION
	            
	            REGION Überwachung Pins 2
	                
	                #fbPinControl2303_2.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl2303_2.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl2303_2.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2303_2.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2303_2(stInSenRaster := "DB_Inputs".Sensors["cInBG4201"],
	                                    xInErrorQuit := "SF0241" OR "SF0237",
	                                    xInMotorRun := #fbSortConv2303.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl2303_2.stSettings.nErrorType := 1;
	                    #fbMonPinControl2303_2.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl2303_2.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl2303_2.stSettings.tDelay := T#1s;
	                    #fbMonPinControl2303_2(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M2303',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG4201"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF4,
	                                           xInQuitError := #stInOutControlUnitCabinetOF4.xQuitError,
	                                           xInSignal := NOT #fbPinControl2303_2.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	            END_REGION
	            
	            REGION Überwachung Encoder
	                #fbEncoderMonitor2303(sInConveyorName := 'KR-2303',
	                                      sInEncoderName := 'GF3204',
	                                      nInEncoderValue := "GF3204_PosAct",
	                                      nInEncoderMax := "cEncoderGF3204",
	                                      nInEncMonVal := "cEncMonVal",
	                                      xInClock := "Clock_2Hz",
	                                      xInConveyorRun := #fbSortConv2303.xOutConveyorFullSpeed,
	                                      xInQuit := "SF0241" OR "SF0243" OR "SF0237",
	                                      xInActivate := TRUE,
	                                      stInOutControlUnitCabinet:=#stInOutControlUnitCabinetOF4);
	            END_REGION
	            
	        END_REGION
	        
	        REGION Conveyor 2304
	            #fbSortConv2304.Settings.tEnergySafeTime := T#120s; // Konstante TODO
	            #fbSortConv2304.Settings.tStartingTime := T#50ms;
	            #fbSortConv2304.Settings.xGridActive := FALSE;
	            #fbSortConv2304.Settings.sMotorProtectName := 'FC0261';
	            #fbSortConv2304(xInEnabled :=
	                            "SF0244" AND "SF0246" AND 
	                            NOT #fbPinControl2304_1.xOutErrorRasterSensor AND
	                            NOT #fbPinControl2304_2.xOutErrorRasterSensor AND 
	                            NOT #fbEncoderMonitor2304.xOutError AND
	                            NOT #TRO377.xOutUnloadingError AND
	                            NOT #TRO380.xOutUnloadingError,
	                            xInFull := "cTodoFalse",
	                            xInNextConveyorReady := "cTodoTRUE",
	                            xInAutomaticMode := #t_Automatik_OF4,
	                            xInEnergySafeRequest := NOT #stInOutControlUnitCabinetOF4.xRestart AND NOT #TRO377.xOutConvReqSort AND
	                            NOT #TRO380.xOutConvReqSort AND NOT #TRO379.xOutCarouselReq AND
	                            NOT #TRO382.xOutCarouselReq AND NOT #TRO362.xOutCarouselReq2 AND
	                            NOT #TRO361.xOutCarouselReq1 AND NOT #TRO361.xOutCarouselReq2 AND
	                            NOT #TRO362.xOutCarouselReq1 AND 
	                            NOT #TRO316.xOutCarouselReq,
	                            xInChainBreakMonitoring := TRUE,
	                            xInChainBreakMonitoringSmoothing := false,
	                            xInMotorProtectionMonitoring := "FC0261",
	                            xInSafetyEnable := "cTodoTRUE",
	                            xOutPowerContactor => "MA0261",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF4,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".stConveyors.stSort.stCS2304);
	            
	            REGION Überwachung Pins 1
	                
	                #fbPinControl2304_1.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl2304_1.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl2304_1.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2304_1.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl2304_1(stInSenRaster := "DB_Inputs".Sensors["cInBG4321"],
	                                    xInErrorQuit := "SF0245" OR "SF0237",
	                                    xInMotorRun := #fbSortConv2304.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl2304_1.stSettings.nErrorType := 1;
	                    #fbMonPinControl2304_1.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl2304_1.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl2304_1.stSettings.tDelay := T#1s;
	                    #fbMonPinControl2304_1(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M2304',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG4321"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF4,
	                                           xInQuitError := #stInOutControlUnitCabinetOF4.xQuitError,
	                                           xInSignal := NOT #fbPinControl2304_1.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	                
	          END_REGION
	          
	          REGION Überwachung Pins 2
	              
	              #fbPinControl2304_2.stInSettings.xInEnableSupervision := TRUE;
	              #fbPinControl2304_2.stInSettings.tInDelayMotorRun := T#1000ms;
	              #fbPinControl2304_2.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	              #fbPinControl2304_2.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	              #fbPinControl2304_2(stInSenRaster := "DB_Inputs".Sensors["cInBG4381"],
	                                  xInErrorQuit := "SF0247" OR "SF0237",
	                                  xInMotorRun := #fbSortConv2304.xOutConveyorFullSpeed);
	              
	              REGION Monitoring
	                  #fbMonPinControl2304_2.stSettings.nErrorType := 1;
	                  #fbMonPinControl2304_2.stSettings.xErrLedIfMachineIsOff := TRUE;
	                  #fbMonPinControl2304_2.stSettings.xSelfQuit := TRUE;
	                  #fbMonPinControl2304_2.stSettings.tDelay := T#1s;
	                  #fbMonPinControl2304_2(sInFctnName := 'Rastersensorueberwachung',
	                                         sInPrefix := 'KR-M2304',
	                                         wInTextListId_Function := 3000,
	                                         wInTextListId_Message := 3000,
	                                         sInSuffix := "DB_Inputs".Sensors["cInBG4381"].sName,
	                                         InOutMachineState := #stInOutControlUnitCabinetOF4,
	                                         xInQuitError := #stInOutControlUnitCabinetOF4.xQuitError,
	                                         xInSignal := NOT #fbPinControl2304_2.xOutErrorRasterSensor,
	                                         sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	              END_REGION
	          END_REGION
	            
	            REGION Überwachung Encoder
	                #fbEncoderMonitor2304(sInConveyorName := 'KR-2304',
	                                      sInEncoderName := 'GF3205',
	                                      nInEncoderValue := "GF3205_PosAct",
	                                      nInEncoderMax := "cEncoderGF3205",
	                                      nInEncMonVal := "cEncMonVal",
	                                      xInClock := "Clock_2Hz",
	                                      xInConveyorRun := #fbSortConv2304.xOutConveyorFullSpeed,
	                                      xInQuit := "SF0245" OR "SF0247" OR "SF0237",
	                                      xInActivate := TRUE,
	                                      stInOutControlUnitCabinet:=#stInOutControlUnitCabinetOF4);
	            END_REGION
	            
	        END_REGION
	    END_REGION
	    
	    REGION Kreisel
	        
	        REGION Conveyor 2110
	            #fbCarousel2110.Settings.tEnergySafeTime := T#90s;
	            #fbCarousel2110.Settings.tStartingTime := T#50ms;
	            #fbCarousel2110.Settings.xGridActive := TRUE;
	            #fbCarousel2110.Settings.sMotorProtectName := 'FC0071';
	            #fbCarousel2110.Settings.sGridSenName := 'BG4505';
	            #fbCarousel2110(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *) #stInOutControlUnitCabinetOF1.xRestart OR
	                            #TRO309.xOutCarouselReq OR #TRO310.xOutCarouselReq OR
	                            #TRO311.xOutCarouselReq OR #TRO312.xOutCarouselReq OR
	                            #TRO313.xOutCarouselReq1 OR #TRO313.xOutCarouselReq2 OR
	                            #TRO314.xOutCarouselReq1 OR #TRO314.xOutCarouselReq2 OR
	                            #TRO315.xOutCarouselReq OR #TRO386.xOutCarouselReq,
	                            xInEnabled := "SF0080",
	                            xInGridSen := "DB_Inputs".Sensors["cInBG4505"].xDirectSensor,
	                            xInGridQuit := "SF0081",
	                            xInAutomaticMode := #t_Automatik_OF1,
	                            xInMotorProtectionMonitoring := "FC0071",
	                            xOutPowerContactor => "MA0071",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                            stInOutInterfaceHMI:="DB_Interface_HMI".stConveyors.stCarousel.stCarEntr1);
	        END_REGION
	        
	        REGION Conveyor 2112
	            #fbCarousel2112.Settings.tEnergySafeTime := T#90s;
	            #fbCarousel2112.Settings.tStartingTime := T#50ms;
	            #fbCarousel2112.Settings.xGridActive := TRUE;
	            #fbCarousel2112.Settings.sMotorProtectName := 'FC0072';
	            #fbCarousel2112.Settings.sGridSenName := 'BG4396';
	            #fbCarousel2112(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *) #stInOutControlUnitCabinetOF1.xRestart OR
	                            #TRO313.xOutCarouselReq1 OR #TRO313.xOutCarouselReq2 OR
	                            #TRO316.xOutCarouselReq,
	                            xInEnabled := "SF0082",
	                            xInGridSen := "DB_Inputs".Sensors["cInBG4396"].xDirectSensor,
	                            xInGridQuit := "SF0083",
	                            xInAutomaticMode := #t_Automatik_OF1,
	                            xInMotorProtectionMonitoring := "FC0072",
	                            xOutPowerContactor => "MA0072",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                            stInOutInterfaceHMI:="DB_Interface_HMI".stConveyors.stCarousel.stCarEntr2);
	        END_REGION
	        
	        REGION "Exit" Conv 2103          
	            #fbExitConv2103.Settings.tEnergySafeTime := T#90s;
	            #fbExitConv2103.Settings.tStartingTime := T#50ms;
	            #fbExitConv2103.Settings.xGridActive := TRUE;
	            #fbExitConv2103.Settings.sMotorProtectName := 'FC0060';
	            #fbExitConv2103.Settings.sGridSenName := 'BG3306';
	            #fbExitConv2103(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *) #stInOutControlUnitCabinetOF1.xRestart OR
	                            #TRO327.xOutConvReqExit OR #TRO330.xOutConvReqExit OR
	                            #TRO319.xOutCarouselReq1 OR #TRO319.xOutCarouselReq2 OR
	                            #TRO320.xOutCarouselReq1 OR #TRO320.xOutCarouselReq2 OR
	                            #TRO322.xOutCarouselReq1,
	                            xInEnabled := "SF0040" AND "SF0042",
	                            xInGridSen := "DB_Inputs".Sensors["cInBG3306"].xDirectSensor,
	                            xInGridQuit := "SF0041" OR "SF0043",
	                            xInAutomaticMode := #t_Automatik_OF1,
	                            xInMotorProtectionMonitoring := "FC0060",
	                            xOutPowerContactor => "MA0060",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                            stInOutInterfaceHMI:="DB_Interface_HMI".stConveyors.stCarousel.stCar2103Exit);
	        END_REGION
	        
	        REGION "Exit" Conv 2104
	            #fbExitConv2104.Settings.tEnergySafeTime := T#90s;
	            #fbExitConv2104.Settings.tStartingTime := T#50ms;
	            #fbExitConv2104.Settings.xGridActive := TRUE;
	            #fbExitConv2104.Settings.sMotorProtectName := 'FC0061';
	            #fbExitConv2104.Settings.sGridSenName := 'BG3436';
	            #fbExitConv2104(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *) #stInOutControlUnitCabinetOF1.xRestart OR
	                            #TRO333.xOutConvReqExit OR #TRO336.xOutConvReqExit OR
	                            #TRO321.xOutCarouselReq1 OR #TRO321.xOutCarouselReq2 OR
	                            #TRO322.xOutCarouselReq1 OR #TRO322.xOutCarouselReq2 OR
	                            #TRO320.xOutCarouselReq2 OR #TRO323.xOutCarouselReq OR
	                            #TRO325.xOutCarouselReq OR #TRO326.xOutCarouselReq,
	                            xInEnabled := "SF0044" AND "SF0046",
	                            xInGridSen := "DB_Inputs".Sensors["cInBG3436"].xDirectSensor,
	                            xInGridQuit := "SF0055" OR "SF0057",
	                            xInAutomaticMode := #t_Automatik_OF1,
	                            xInMotorProtectionMonitoring := "FC0061",
	                            xOutPowerContactor => "MA0061",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                            stInOutInterfaceHMI:="DB_Interface_HMI".stConveyors.stCarousel.stCar2104Exit);
	        END_REGION
	        
	        REGION "Exit" Conv 2203
	            #fbExitConv2203.Settings.tEnergySafeTime := T#90s;
	            #fbExitConv2203.Settings.tStartingTime := T#50ms;
	            #fbExitConv2203.Settings.xGridActive := TRUE;
	            #fbExitConv2203.Settings.sMotorProtectName := 'FC0200';
	            #fbExitConv2203.Settings.sGridSenName := 'BG3786';
	            #fbExitConv2203(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *) #stInOutControlUnitCabinetOF3.xRestart OR
	                            #TRO349.xOutConvReqExit OR #TRO352.xOutConvReqExit OR
	                            #TRO341.xOutCarouselReq1 OR #TRO341.xOutCarouselReq2 OR
	                            #TRO342.xOutCarouselReq1 OR #TRO342.xOutCarouselReq2 OR
	                            #TRO344.xOutCarouselReq1,
	                            xInEnabled := "SF0180" AND "SF0182",
	                            xInGridSen := "DB_Inputs".Sensors["cInBG3786"].xDirectSensor,
	                            xInGridQuit := "SF0181" OR "SF0183",
	                            xInAutomaticMode := #t_Automatik_OF3,
	                            xInMotorProtectionMonitoring := "FC0200",
	                            xOutPowerContactor => "MA0200",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF3,
	                            stInOutInterfaceHMI:="DB_Interface_HMI".stConveyors.stCarousel.stCar2203Exit);
	        END_REGION
	        
	        REGION "Exit" Conv 2204
	            #fbExitConv2204.Settings.tEnergySafeTime := T#90s;
	            #fbExitConv2204.Settings.tStartingTime := T#50ms;
	            #fbExitConv2204.Settings.xGridActive := TRUE;
	            #fbExitConv2204.Settings.sMotorProtectName := 'FC0201';
	            #fbExitConv2204.Settings.sGridSenName := 'BG3916';
	            #fbExitConv2204(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *) #stInOutControlUnitCabinetOF3.xRestart OR
	                            #TRO355.xOutConvReqExit OR #TRO358.xOutConvReqExit OR
	                            #TRO343.xOutCarouselReq1 OR #TRO343.xOutCarouselReq2 OR
	                            #TRO344.xOutCarouselReq1 OR #TRO344.xOutCarouselReq2 OR
	                            #TRO342.xOutCarouselReq2 OR #TRO345.xOutCarouselReq OR
	                            #TRO347.xOutCarouselReq OR #TRO348.xOutCarouselReq,
	                            xInEnabled := "SF0184" AND "SF0186",
	                            xInGridSen := "DB_Inputs".Sensors["cInBG3916"].xDirectSensor,
	                            xInGridQuit := "SF0185" OR "SF0187",
	                            xInAutomaticMode := #t_Automatik_OF3,
	                            xInMotorProtectionMonitoring := "FC0201",
	                            xOutPowerContactor => "MA0201",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF3,
	                            stInOutInterfaceHMI:="DB_Interface_HMI".stConveyors.stCarousel.stCar2204Exit);
	        END_REGION
	        
	        REGION "Exit" Conv 2301
	            #fbExitConv2301.Settings.tEnergySafeTime := T#90s;
	            #fbExitConv2301.Settings.tStartingTime := T#50ms;
	            #fbExitConv2301.Settings.xGridActive := TRUE;
	            #fbExitConv2301.Settings.sMotorProtectName := 'FC0202';
	            #fbExitConv2301.Settings.sGridSenName := 'BG4026';
	            #fbExitConv2301(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *) #stInOutControlUnitCabinetOF3.xRestart OR
	                            #TRO371.xOutConvReqExit OR #TRO374.xOutConvReqExit OR
	                            #TRO363.xOutCarouselReq1 OR #TRO363.xOutCarouselReq2 OR
	                            #TRO364.xOutCarouselReq1 OR #TRO364.xOutCarouselReq2 OR
	                            #TRO366.xOutCarouselReq2,
	                            xInEnabled := "SF0190" AND "SF0192",
	                            xInGridSen := "DB_Inputs".Sensors["cInBG4026"].xDirectSensor,
	                            xInGridQuit := "SF0191" OR "SF0193",
	                            xInAutomaticMode := #t_Automatik_OF3,
	                            xInMotorProtectionMonitoring := "FC0202",
	                            xOutPowerContactor => "MA0202",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF3,
	                            stInOutInterfaceHMI:="DB_Interface_HMI".stConveyors.stCarousel.stCar2301Exit);
	        END_REGION
	        
	        REGION "Exit" Conv 2302
	            #fbExitConv2302.Settings.tEnergySafeTime := T#90s;
	            #fbExitConv2302.Settings.tStartingTime := T#50ms;
	            #fbExitConv2302.Settings.xGridActive := TRUE;
	            #fbExitConv2302.Settings.sMotorProtectName := 'FC0203';
	            #fbExitConv2302.Settings.sGridSenName := 'BG4150';
	            #fbExitConv2302(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *) #stInOutControlUnitCabinetOF3.xRestart OR
	                            #TRO377.xOutConvReqExit OR #TRO380.xOutConvReqExit OR
	                            #TRO365.xOutCarouselReq1 OR #TRO365.xOutCarouselReq2 OR
	                            #TRO366.xOutCarouselReq1 OR #TRO366.xOutCarouselReq2 OR
	                            #TRO364.xOutCarouselReq1 OR #TRO367.xOutCarouselReq OR
	                            #TRO369.xOutCarouselReq OR #TRO370.xOutCarouselReq,
	                            xInEnabled := "SF0194" AND "SF0196",
	                            xInGridSen := "DB_Inputs".Sensors["cInBG4150"].xDirectSensor,
	                            xInGridQuit := "SF0195" OR "SF0197",
	                            xInAutomaticMode := #t_Automatik_OF3,
	                            xInMotorProtectionMonitoring := "FC0203",
	                            xOutPowerContactor => "MA0203",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF3,
	                            stInOutInterfaceHMI:="DB_Interface_HMI".stConveyors.stCarousel.stCar2302Exit);
	        END_REGION
	        
	    END_REGION
	END_REGION ;
	
	REGION Encoder
	    REGION GF3200
	        #fbEncoderGF3200(nInPosAct := "GF3200_PosAct",
	                         xInPresetAdjQuit := "GF3200_PresetAdjQuit",
	                         nInEncoderMax := "cEncoderGF3200", 
	                         nInHooksSorterMax := "cHooksSorterMaxPin",
	                         stInSensorReference := "DB_Inputs".Sensors["cInBG3061"],
	                         nInPitch := 250); //Konstante
	        
	        "GF3200_PresetAdjSet" := #fbEncoderGF3200.xOutPresetAdjSet;
	        "GF3200_PresetAdjValue" := #fbEncoderGF3200.nOutPresetAdjSetValue;
	    END_REGION
	    
	    REGION GF3201
	        #fbEncoderGF3201(nInPosAct := "GF3201_PosAct",
	                         xInPresetAdjQuit := "GF3201_PresetAdjQuit",
	                         nInEncoderMax := "cEncoderGF3201",
	                         nInHooksSorterMax := "cHooksSorterMaxPin",
	                         stInSensorReference := "DB_Inputs".Sensors["cInBG3121"],
	                         nInPitch := 250); //Konstante
	        
	        "GF3201_PresetAdjSet" := #fbEncoderGF3201.xOutPresetAdjSet;
	        "GF3201_PresetAdjValue" := #fbEncoderGF3201.nOutPresetAdjSetValue;
	    END_REGION
	    
	    REGION GF3202
	        #fbEncoderGF3202(nInPosAct := "GF3202_PosAct",
	                         xInPresetAdjQuit := "GF3202_PresetAdjQuit",
	                         nInEncoderMax := "cEncoderGF3202",
	                         nInHooksSorterMax := "cHooksSorterMaxPin",
	                         stInSensorReference := "DB_Inputs".Sensors["cInBG3541"],
	                         nInPitch := 250); //Konstante
	        
	        "GF3202_PresetAdjSet" := #fbEncoderGF3202.xOutPresetAdjSet;
	        "GF3202_PresetAdjValue" := #fbEncoderGF3202.nOutPresetAdjSetValue;
	    END_REGION
	    
	    REGION GF3203
	        #fbEncoderGF3203(nInPosAct := "GF3203_PosAct",
	                         xInPresetAdjQuit := "GF3203_PresetAdjQuit",
	                         nInEncoderMax := "cEncoderGF3203",
	                         nInHooksSorterMax := "cHooksSorterMaxPin",
	                         stInSensorReference := "DB_Inputs".Sensors["cInBG3601"],
	                         nInPitch := 250); //Konstante
	        
	        "GF3203_PresetAdjSet" := #fbEncoderGF3203.xOutPresetAdjSet;
	        "GF3203_PresetAdjValue" := #fbEncoderGF3203.nOutPresetAdjSetValue;
	    END_REGION
	    
	    REGION GF3204
	        #fbEncoderGF3204(nInPosAct := "GF3204_PosAct",
	                         xInPresetAdjQuit := "GF3204_PresetAdjQuit",
	                         nInEncoderMax := "cEncoderGF3204",
	                         nInHooksSorterMax := "cHooksSorterMaxPin",
	                         stInSensorReference := "DB_Inputs".Sensors["cInBG4261"],
	                         nInPitch := 250); //Konstante
	        
	        "GF3204_PresetAdjSet" := #fbEncoderGF3204.xOutPresetAdjSet;
	        "GF3204_PresetAdjValue" := #fbEncoderGF3204.nOutPresetAdjSetValue;
	    END_REGION
	    
	    REGION GF3205
	        #fbEncoderGF3205(nInPosAct := "GF3205_PosAct",
	                         xInPresetAdjQuit := "GF3205_PresetAdjQuit",
	                         nInEncoderMax := "cEncoderGF3205",
	                         nInHooksSorterMax := "cHooksSorterMaxPin",
	                         stInSensorReference := "DB_Inputs".Sensors["cInBG4321"],
	                         nInPitch := 250); //Konstante
	        
	        "GF3205_PresetAdjSet" := #fbEncoderGF3205.xOutPresetAdjSet;
	        "GF3205_PresetAdjValue" := #fbEncoderGF3205.nOutPresetAdjSetValue;
	    END_REGION
	
	END_REGION
	
	REGION SECTION 2.1
	    REGION BLOCK 2.1.1 (TRO 327)                      
	            REGION Encoder Settings
	                #TRO327.stInEncoderParameter.nPosActDif := #fbEncoderGF3200.nOutPosActDif;
	                #TRO327.stInEncoderParameter.nPosPitchPart := #fbEncoderGF3200.nOutPosPitchPart;
	            END_REGION
	            
	            REGION ConveyorStation Settings
	                #TRO327.stInSettings.nDestGeneral := "cDest21100";
	                #TRO327.stInSettings.nConvStations := "cHooksSorterMaxPin211"; //Konstante todo
	                #TRO327.stInSettings.nStationsMax := "cStationsMax211"; // Konstante todo
	                #TRO327.stInSettings.nStorageThreshold := "cNoPositionsBlock1";
	                #TRO327.stInSettings.nNoOfLines := 19;
	            END_REGION
	            
	            REGION Pin Query / "Zappler"
	                #TRO327.stInSensorReference := "DB_Inputs".Sensors["cInBG3001"];
	            END_REGION
	            
	            REGION Barcode Reader In (BX3107)
	                #TRO327.stInBarcodeReader.Settings.nStation := 211; // todo Konstante
	                #TRO327.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	                #TRO327.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	                #TRO327.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	                
	                #arCognexInterface["cScannerBX3107"].xInCamTriggerReady := "bx3107-TriggerReady";
	                #arCognexInterface["cScannerBX3107"].xInCamTriggerAck := "bx3107-TriggerAck";
	                #arCognexInterface["cScannerBX3107"].xInCamResultsAvailable := "bx3107-Results Available";
	                #arCognexInterface["cScannerBX3107"].xInCamGeneralFault := "bx3107-General Fault";
	                #arCognexInterface["cScannerBX3107"].hwInCamInspectionResults := "=A01+UC031-BX3107~Ergebnisse_–_64_Bytes_1";
	            END_REGION
	            
	            REGION Separator Settings
	                REGION Sep Pin
	                    #TRO327.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3000"];
	                    #TRO327.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                    #TRO327.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                    #TRO327.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	                END_REGION
	                
	                REGION Sep Store 1
	                    #nActNo := 1;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := 4;//"cStorage211ExitJam1";
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3270"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 2
	                    #nActNo := 2;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam2";
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3271"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 3
	                    #nActNo := 3;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam3";
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3272"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 4
	                    #nActNo := 4;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam4";
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3273"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 5
	                    #nActNo := 5;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam5";
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3274"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 6
	                    #nActNo := 6;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam6";
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3275"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 7
	                    #nActNo := 7;
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam7";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3276"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 8
	                    #nActNo := 8;
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam8";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3277"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 9
	                    #nActNo := 9;
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam9";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3280"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 10
	                    #nActNo := 10;
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam10";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3281"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 11
	                    #nActNo := 11;
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam11";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3282"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 12
	                    #nActNo := 12;
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam12";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3283"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 13
	                    #nActNo := 13;
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam13";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3284"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 14
	                    #nActNo := 14;
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam14";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3285"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 15
	                    #nActNo := 15;
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam15";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3286"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 16
	                    #nActNo := 16;
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam16";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3287"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 17
	                    #nActNo := 17;
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam17";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3290"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 18
	                    #nActNo := 18;
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam18";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3291"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	                
	                REGION Sep Store 19
	                    #nActNo := 19;
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                    #TRO327.arInSep[#nActNo].stSettings.nJamLength := "cStorage211ExitJam19";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                    #TRO327.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                    #TRO327.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3292"];
	                    #TRO327.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                    #TRO327.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	                END_REGION
	            END_REGION
	            
	            REGION UnloadingStations Settings
	                #TRO327.xInQuitLocal := "SF0121" OR "SF0117";
	                
	                #TRO327.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3030"];
	                
	                #TRO327.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3031"];
	                
	                #TRO327.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3032"];
	                
	                #TRO327.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3033"];
	                
	                #TRO327.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3034"];
	                
	                #TRO327.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3035"];
	                
	                #TRO327.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3036"];
	                
	                #TRO327.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3037"];
	                
	                #TRO327.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3040"];
	                
	                #TRO327.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3041"];
	                
	                #TRO327.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3042"];
	                
	                #TRO327.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3043"];
	                
	                #TRO327.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3044"];
	                
	                #TRO327.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG3045"];
	                
	                #TRO327.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG3046"];
	                
	                #TRO327.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG3047"];
	                
	                #TRO327.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG3050"];
	                
	                #TRO327.arInJamSensor[18] := "DB_Inputs".Sensors["cInBG3051"];
	                
	                #TRO327.arInJamSensor[19] := "DB_Inputs".Sensors["cInBG3052"];
	          
	            END_REGION
	            
	            REGION Aufruf: TRO327
	                
	                #TRO327.stInPriorityManager.xReleaseOk := TRUE;
	                
	                #TRO327(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                        nInTestTarget := "IBN".nTestTarget211,
	                        xInAllRdyToStart := TRUE,
	                        xInCancel := "cTodoFalse",
	                        xInRelease := "DB_TRO_Test".TRO327,
	                        xInConveyorRunIn := #fbSortConv2101.xOutConveyorFullSpeed,
	                        xInConveyorRunOut := #fbExitConv2103.xOutConveyorFullSpeed,
	                        stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF2,
	                        arInOutStorageLines := "DB_Storage2.1.1".arLine,
	                        arInOutJamEntr := "DB_JamArea2101".stJam2101_2.arCarrier,
	                        stInOutJamEntr := "DB_JamArea2101".stJam2101_2.stData,
	                        arInOutJamExit := "DB_JamArea2103".stJam2103_1.arCarrier,
	                        stInOutJamExit := "DB_JamArea2103".stJam2103_1.stData,
	                        arInOutJamBypass := #arCarrierPlaceHolder,
	                        stInOutJamBypass := #stJamDataPlaceHolder,
	                        stInOutHMI := "DB_Interface_HMI".stTRO.TRO327,
	                        xOutSeparatorPin => "MB3000",
	                        // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro327"],
	                        stCognexInterfacePin := #arCognexInterface["cScannerBX3107"],
	                        stMFRStorageRemovalInterface:= "DB_HandshakeStorage".str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl2[1],
	                        stConveyorStations := "DB_ConveyorStations".stConveyorStations211);
	            END_REGION ;
	            
	            REGION CARR_GLOB_CORRECTION
	                "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO327.xOutCorrection, //Führe Korrektur aus
	                                          nInBarcodeScan := #TRO327.nBarcodeResult,
	                                          nInStation := 1,
	                                          arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                          InOutCarrierExpect := "DB_JamArea2101".stJam2101_2.arCarrier[1]);
	            END_REGION ;
	            
	            REGION Barcode Reader Out (BX3107)
	                "bx3107-TriggerEnable" := #arCognexInterface["cScannerBX3107"].xOutCamTriggerEnable;
	                "bx3107-Trigger" := #arCognexInterface["cScannerBX3107"].xOutCamTrigger;
	                "bx3107-ResultsAck" := #arCognexInterface["cScannerBX3107"].xOutCamResultsAck;
	            END_REGION
	            
	            REGION Separator Store Out
	                "MB3270" := #TRO327.arOutSeparatorStore[1];
	                "MB3271" := #TRO327.arOutSeparatorStore[2];
	                "MB3272" := #TRO327.arOutSeparatorStore[3];
	                "MB3273" := #TRO327.arOutSeparatorStore[4];
	                "MB3274" := #TRO327.arOutSeparatorStore[5];
	                "MB3275" := #TRO327.arOutSeparatorStore[6];
	                "MB3276" := #TRO327.arOutSeparatorStore[7];
	                "MB3277" := #TRO327.arOutSeparatorStore[8];
	                "MB3280" := #TRO327.arOutSeparatorStore[9];
	                "MB3281" := #TRO327.arOutSeparatorStore[10];
	                "MB3282" := #TRO327.arOutSeparatorStore[11];
	                "MB3283" := #TRO327.arOutSeparatorStore[12];
	                "MB3284" := #TRO327.arOutSeparatorStore[13];
	                "MB3285" := #TRO327.arOutSeparatorStore[14];
	                "MB3286" := #TRO327.arOutSeparatorStore[15];
	                "MB3287" := #TRO327.arOutSeparatorStore[16];
	                "MB3290" := #TRO327.arOutSeparatorStore[17];
	                "MB3291" := #TRO327.arOutSeparatorStore[18];
	                "MB3292" := #TRO327.arOutSeparatorStore[19];
	            END_REGION
	            
	            REGION Unloading Stations Out
	                "MB3030" := #TRO327.arOutSwitch[1];
	                "MB3031" := #TRO327.arOutSwitch[2];
	                "MB3032" := #TRO327.arOutSwitch[3];
	                "MB3033" := #TRO327.arOutSwitch[4];
	                "MB3034" := #TRO327.arOutSwitch[5];
	                "MB3035" := #TRO327.arOutSwitch[6];
	                "MB3036" := #TRO327.arOutSwitch[7];
	                "MB3037" := #TRO327.arOutSwitch[8];
	                "MB3040" := #TRO327.arOutSwitch[9];
	                "MB3041" := #TRO327.arOutSwitch[10];
	                "MB3042" := #TRO327.arOutSwitch[11];
	                "MB3043" := #TRO327.arOutSwitch[12];
	                "MB3044" := #TRO327.arOutSwitch[13];
	                "MB3045" := #TRO327.arOutSwitch[14];
	                "MB3046" := #TRO327.arOutSwitch[15];
	                "MB3047" := #TRO327.arOutSwitch[16];
	                "MB3050" := #TRO327.arOutSwitch[17];
	                "MB3051" := #TRO327.arOutSwitch[18];
	                "MB3052" := #TRO327.arOutSwitch[19];
	            END_REGION
	            
	            REGION Send Container Store Response Message (CSRespM)
	                FOR #nIdxUnloading := 1 TO 19 DO
	                    IF #TRO327.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                        "FC_Send_CSRespM"(sInPLCID:= 'PLCID003',
	                                          nInBarcode:= #TRO327.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                          nInLocation:= "cDest21100" + #nIdxUnloading,
	                                          nReasonCode:= '1',
	                                          FIFO:="DB_LGF_FIFO_CommWES_ASRS",
	                                          BUFFER:="DB_Buffer_CommunicationWES_ASRS".BUFFER,
	                                          nInOutSequenceNumber:="DB_CommunicationParameters".nSeqNumWESASRS);
	                    END_IF;
	                END_FOR;
	            END_REGION
	            
	    END_REGION
	    
	    REGION BLOCK 2.1.2 (TRO 330)
	        REGION Encoder Settings
	            #TRO330.stInEncoderParameter.nPosActDif := #fbEncoderGF3200.nOutPosActDif;
	            #TRO330.stInEncoderParameter.nPosPitchPart := #fbEncoderGF3200.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO330.stInSettings.nDestGeneral := "cDest21200";
	            #TRO330.stInSettings.nConvStations := "cHooksSorterMaxPin212"; //Konstante todo
	            #TRO330.stInSettings.nStationsMax := "cStationsMax212"; // Konstante todo
	            #TRO330.stInSettings.nStorageThreshold := "cNoPositionsBlock1";
	            #TRO330.stInSettings.nNoOfLines := 17;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO330.stInSensorReference := "DB_Inputs".Sensors["cInBG3061"];
	        END_REGION
	        
	        REGION Barcode Reader IN (BX3108)
	            #TRO330.stInBarcodeReader.Settings.nStation := 212; // todo Konstante
	            #TRO330.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO330.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO330.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX3108"].xInCamTriggerReady := "bx3108-TriggerReady";
	            #arCognexInterface["cScannerBX3108"].xInCamTriggerAck := "bx3108-TriggerAck";
	            #arCognexInterface["cScannerBX3108"].xInCamResultsAvailable := "bx3108-Results Available";
	            #arCognexInterface["cScannerBX3108"].xInCamGeneralFault := "bx3108-General Fault";
	            #arCognexInterface["cScannerBX3108"].hwInCamInspectionResults := "=A01+UC031-BX3108~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            
	            REGION Pin
	                #TRO330.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3060"];
	                #TRO330.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO330.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO330.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam1";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3330"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam2";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3331"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam3";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3332"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam4";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3333"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam5";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3334"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam6";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3335"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam7";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3336"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam8";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3337"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam9";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3340"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam10";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3341"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam11";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3342"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam12";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3343"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam13";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3344"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam14";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3345"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam15";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3346"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam16";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3347"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO330.arInSep[#nActNo].stSettings.nJamLength := "cStorage212ExitJam17";
	                #TRO330.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3350"];
	                #TRO330.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO330.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO330.xInQuitLocal := "SF0123" OR "SF0117";
	            
	            #TRO330.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3090"];
	            
	            #TRO330.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3091"];
	            
	            #TRO330.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3092"];
	            
	            #TRO330.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3093"];
	            
	            #TRO330.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3094"];
	            
	            #TRO330.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3095"];
	            
	            #TRO330.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3096"];
	            
	            #TRO330.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3097"];
	            
	            #TRO330.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3100"];
	            
	            #TRO330.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3101"];
	            
	            #TRO330.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3102"];
	            
	            #TRO330.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3103"];
	            
	            #TRO330.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3104"];
	            
	            #TRO330.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG3105"];
	            
	            #TRO330.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG3106"];
	            
	            #TRO330.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG3107"];
	            
	            #TRO330.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG3110"];
	        END_REGION ;
	        
	        REGION Aufruf: TRO330
	            
	            #TRO330.stInPriorityManager.xReleaseOk := True;
	            
	            #TRO330(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                    nInTestTarget := "IBN".nTestTarget212,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO330,
	                    xInConveyorRunIn := #fbSortConv2101.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv2103.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF2,
	                    arInOutStorageLines := "DB_Storage2.1.2".arLine,
	                    arInOutJamEntr := "DB_JamArea2101".stJam2101_1.arCarrier,
	                    stInOutJamEntr := "DB_JamArea2101".stJam2101_1.stData,
	                    arInOutJamExit := "DB_JamArea2103".stJam2103_2.arCarrier,
	                    stInOutJamExit := "DB_JamArea2103".stJam2103_2.stData,
	                    arInOutJamBypass := "DB_JamArea2101".stJam2101_2.arCarrier,
	                    stInOutJamBypass := "DB_JamArea2101".stJam2101_2.stData,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO330,
	                    stMFRStorageRemovalInterface:= "DB_HandshakeStorage".str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl2[2],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX3108"],
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro330"],
	                    xOutSeparatorPin => "MB3060",
	                    stConveyorStations := "DB_ConveyorStations".stConveyorStations212);
	        END_REGION ;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO330.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO330.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2101".stJam2101_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Barcode Reader Out (BX3108)                
	            "bx3108-TriggerEnable" := #arCognexInterface["cScannerBX3108"].xOutCamTriggerEnable;
	            "bx3108-Trigger" := #arCognexInterface["cScannerBX3108"].xOutCamTrigger;
	            "bx3108-ResultsAck" := #arCognexInterface["cScannerBX3108"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB3330" := #TRO330.arOutSeparatorStore[1];
	            "MB3331" := #TRO330.arOutSeparatorStore[2];
	            "MB3332" := #TRO330.arOutSeparatorStore[3];
	            "MB3333" := #TRO330.arOutSeparatorStore[4];
	            "MB3334" := #TRO330.arOutSeparatorStore[5];
	            "MB3335" := #TRO330.arOutSeparatorStore[6];
	            "MB3336" := #TRO330.arOutSeparatorStore[7];
	            "MB3337" := #TRO330.arOutSeparatorStore[8];
	            "MB3340" := #TRO330.arOutSeparatorStore[9];
	            "MB3341" := #TRO330.arOutSeparatorStore[10];
	            "MB3342" := #TRO330.arOutSeparatorStore[11];
	            "MB3343" := #TRO330.arOutSeparatorStore[12];
	            "MB3344" := #TRO330.arOutSeparatorStore[13];
	            "MB3345" := #TRO330.arOutSeparatorStore[14];
	            "MB3346" := #TRO330.arOutSeparatorStore[15];
	            "MB3347" := #TRO330.arOutSeparatorStore[16];
	            "MB3350" := #TRO330.arOutSeparatorStore[17];
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB3090" := #TRO330.arOutSwitch[1];
	            "MB3091" := #TRO330.arOutSwitch[2];
	            "MB3092" := #TRO330.arOutSwitch[3];
	            "MB3093" := #TRO330.arOutSwitch[4];
	            "MB3094" := #TRO330.arOutSwitch[5];
	            "MB3095" := #TRO330.arOutSwitch[6];
	            "MB3096" := #TRO330.arOutSwitch[7];
	            "MB3097" := #TRO330.arOutSwitch[8];
	            "MB3100" := #TRO330.arOutSwitch[9];
	            "MB3101" := #TRO330.arOutSwitch[10];
	            "MB3102" := #TRO330.arOutSwitch[11];
	            "MB3103" := #TRO330.arOutSwitch[12];
	            "MB3104" := #TRO330.arOutSwitch[13];
	            "MB3105" := #TRO330.arOutSwitch[14];
	            "MB3106" := #TRO330.arOutSwitch[15];
	            "MB3107" := #TRO330.arOutSwitch[16];
	            "MB3110" := #TRO330.arOutSwitch[17];
	            
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 17 DO
	                IF #TRO330.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO330.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest21200" + #nIdxUnloading,
	                                      nReasonCode := '1',
	                                      FIFO := "DB_LGF_FIFO_CommWES_ASRS",
	                                      BUFFER := "DB_Buffer_CommunicationWES_ASRS".BUFFER,
	                                      nInOutSequenceNumber:="DB_CommunicationParameters".nSeqNumWESASRS);
	                END_IF;
	            END_FOR;
	        END_REGION
	        
	    END_REGION
	    
	    REGION BLOCK 2.1.3 (TRO 333)
	        
	        REGION Encoder Settings
	            #TRO333.stInEncoderParameter.nPosActDif := #fbEncoderGF3201.nOutPosActDif;
	            #TRO333.stInEncoderParameter.nPosPitchPart := #fbEncoderGF3201.nPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO333.stInSettings.nDestGeneral := "cDest21300";
	            #TRO333.stInSettings.nConvStations := "cHooksSorterMaxPin213"; //Konstante todo
	            #TRO333.stInSettings.nStationsMax := "cStationsMax213"; // Konstante todo
	            #TRO333.stInSettings.nStorageThreshold := "cNoPositionsBlock1";
	            #TRO333.stInSettings.nNoOfLines := 21;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO333.stInSensorReference := "DB_Inputs".Sensors["cInBG3121"];
	        END_REGION
	        
	        REGION Barcode Reader In (BX3109)
	            #TRO333.stInBarcodeReader.Settings.nStation := 213; // todo Konstante
	            #TRO333.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO333.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO333.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX3109"].xInCamTriggerReady := "bx3109-TriggerReady";
	            #arCognexInterface["cScannerBX3109"].xInCamTriggerAck := "bx3109-TriggerAck";
	            #arCognexInterface["cScannerBX3109"].xInCamResultsAvailable := "bx3109-Results Available";
	            #arCognexInterface["cScannerBX3109"].xInCamGeneralFault := "bx3109-General Fault";
	            #arCognexInterface["cScannerBX3109"].hwInCamInspectionResults := "=A01+UC031-BX3109~Ergebnisse_–_64_Bytes_1";
	            
	        END_REGION
	        
	        REGION Separator Settings
	            
	            REGION Pin
	                #TRO333.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3120"];
	                #TRO333.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO333.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO333.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam1";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3390"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam2";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3391"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam3";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3392"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam4";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3393"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam5";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3394"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam6";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3395"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam7";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3396"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam8";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3397"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam9";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3400"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam10";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3401"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam11";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3402"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam12";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3403"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam13";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3404"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam14";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3405"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam15";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3406"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam16";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3407"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam17";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3410"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 18
	                #nActNo := 18;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam18";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3411"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 19
	                #nActNo := 19;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam19";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3412"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 20
	                #nActNo := 20;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam20";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3413"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 21
	                #nActNo := 21;
	                #TRO333.arInSep[#nActNo].stSettings.nJamLength := "cStorage213ExitJam21";
	                #TRO333.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3414"];
	                #TRO333.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO333.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            
	        END_REGION
	        
	        REGION Aufruf: TRO333
	            
	            #TRO333.stInPriorityManager.xReleaseOk := "cTodoTRUE";
	            
	            #TRO333(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                    nInTestTarget := "IBN".nTestTarget213,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO333,
	                    xInConveyorRunIn := #fbSortConv2102.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv2104.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF2,
	                    arInOutStorageLines := "DB_Storage2.1.3".arLine,
	                    arInOutJamEntr := "DB_JamArea2102".stJam2102_3.arCarrier,
	                    stInOutJamEntr := "DB_JamArea2102".stJam2102_3.stData,
	                    arInOutJamExit := "DB_JamArea2104".stJam2104_2.arCarrier,
	                    stInOutJamExit := "DB_JamArea2104".stJam2104_2.stData,
	                    arInOutJamBypass := "DB_JamArea2102".stJam2102_4.arCarrier,
	                    stInOutJamBypass := "DB_JamArea2102".stJam2102_4.stData,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO333,
	                    stMFRStorageRemovalInterface:= "DB_HandshakeStorage".str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl2[3],
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro333"],
	                    xOutSeparatorPin => "MB3120",
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX3109"],
	                    stConveyorStations := "DB_ConveyorStations".stConveyorStations213);
	        END_REGION
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO333.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO333.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2102".stJam2102_3.arCarrier[1]);
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO333.xInQuitLocal := "SF0125" OR "SF0117" OR "IBN".xQuit213;
	            
	            #TRO333.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3150"];
	            
	            #TRO333.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3151"];
	            
	            #TRO333.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3152"];
	            
	            #TRO333.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3153"];
	            
	            #TRO333.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3154"];
	            
	            #TRO333.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3155"];
	            
	            #TRO333.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3156"];
	            
	            #TRO333.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3157"];
	            
	            #TRO333.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3160"];
	            
	            #TRO333.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3161"];
	            
	            #TRO333.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3162"];
	            
	            #TRO333.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3163"];
	            
	            #TRO333.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3164"];
	            
	            #TRO333.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG3165"];
	            
	            #TRO333.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG3166"];
	            
	            #TRO333.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG3167"];
	            
	            #TRO333.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG3170"];
	            
	            #TRO333.arInJamSensor[18] := "DB_Inputs".Sensors["cInBG3171"];
	            
	            #TRO333.arInJamSensor[19] := "DB_Inputs".Sensors["cInBG3172"];
	            
	            #TRO333.arInJamSensor[20] := "DB_Inputs".Sensors["cInBG3173"];
	            
	            #TRO333.arInJamSensor[21] := "DB_Inputs".Sensors["cInBG3174"];
	        END_REGION ;
	        
	        REGION Barcode Reader Out (BX3109)                
	            "bx3109-TriggerEnable" := #arCognexInterface["cScannerBX3109"].xOutCamTriggerEnable;
	            "bx3109-Trigger" := #arCognexInterface["cScannerBX3109"].xOutCamTrigger;
	            "bx3109-ResultsAck" := #arCognexInterface["cScannerBX3109"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB3390" := #TRO333.arOutSeparatorStore[1];
	            "MB3391" := #TRO333.arOutSeparatorStore[2];
	            "MB3392" := #TRO333.arOutSeparatorStore[3];
	            "MB3393" := #TRO333.arOutSeparatorStore[4];
	            "MB3394" := #TRO333.arOutSeparatorStore[5];
	            "MB3395" := #TRO333.arOutSeparatorStore[6];
	            "MB3396" := #TRO333.arOutSeparatorStore[7];
	            "MB3397" := #TRO333.arOutSeparatorStore[8];
	            "MB3400" := #TRO333.arOutSeparatorStore[9];
	            "MB3401" := #TRO333.arOutSeparatorStore[10];
	            "MB3402" := #TRO333.arOutSeparatorStore[11];
	            "MB3403" := #TRO333.arOutSeparatorStore[12];
	            "MB3404" := #TRO333.arOutSeparatorStore[13];
	            "MB3405" := #TRO333.arOutSeparatorStore[14];
	            "MB3406" := #TRO333.arOutSeparatorStore[15];
	            "MB3407" := #TRO333.arOutSeparatorStore[16];
	            "MB3410" := #TRO333.arOutSeparatorStore[17];
	            "MB3411" := #TRO333.arOutSeparatorStore[18];
	            "MB3412" := #TRO333.arOutSeparatorStore[19];
	            "MB3413" := #TRO333.arOutSeparatorStore[20];
	            "MB3414" := #TRO333.arOutSeparatorStore[21];
	        END_REGION
	        
	        REGION Unlaoding Stations Out
	            "MB3150" := #TRO333.arOutSwitch[1];
	            "MB3151" := #TRO333.arOutSwitch[2];
	            "MB3152" := #TRO333.arOutSwitch[3];
	            "MB3153" := #TRO333.arOutSwitch[4];
	            "MB3154" := #TRO333.arOutSwitch[5];
	            "MB3155" := #TRO333.arOutSwitch[6];
	            "MB3156" := #TRO333.arOutSwitch[7];
	            "MB3157" := #TRO333.arOutSwitch[8];
	            "MB3160" := #TRO333.arOutSwitch[9];
	            "MB3161" := #TRO333.arOutSwitch[10];
	            "MB3162" := #TRO333.arOutSwitch[11];
	            "MB3163" := #TRO333.arOutSwitch[12];
	            "MB3164" := #TRO333.arOutSwitch[13];
	            "MB3165" := #TRO333.arOutSwitch[14];
	            "MB3166" := #TRO333.arOutSwitch[15];
	            "MB3167" := #TRO333.arOutSwitch[16];
	            "MB3170" := #TRO333.arOutSwitch[17];
	            "MB3171" := #TRO333.arOutSwitch[18];
	            "MB3172" := #TRO333.arOutSwitch[19];
	            "MB3173" := #TRO333.arOutSwitch[20];
	            "MB3174" := #TRO333.arOutSwitch[21];
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 21 DO
	                IF #TRO333.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO333.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest21300" + #nIdxUnloading,
	                                      nReasonCode := '1',
	                                      FIFO := "DB_LGF_FIFO_CommWES_ASRS",
	                                      BUFFER := "DB_Buffer_CommunicationWES_ASRS".BUFFER,
	                                      nInOutSequenceNumber:="DB_CommunicationParameters".nSeqNumWESASRS);
	                END_IF;
	            END_FOR;
	        END_REGION
	        
	    END_REGION
	    
	    REGION BLOCK 2.1.4 (TRO 336)
	        
	        REGION Encoder Settings
	            #TRO336.stInEncoderParameter.nPosActDif := #fbEncoderGF3201.nOutPosActDif;
	            #TRO336.stInEncoderParameter.nPosPitchPart := #fbEncoderGF3201.nPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO336.stInSettings.nDestGeneral := "cDest21400";
	            #TRO336.stInSettings.nConvStations := "cHooksSorterMaxPin214"; //Konstante todo
	            #TRO336.stInSettings.nStationsMax := "cStationsMax214"; // Konstante todo
	            #TRO336.stInSettings.nStorageThreshold := 106;//"cNoPositionsBlock1";
	            #TRO336.stInSettings.nNoOfLines := 13;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO336.stInSensorReference := "DB_Inputs".Sensors["cInBG3181"];
	        END_REGION
	        
	        REGION Barcode Reader In (BX3110)
	            #TRO336.stInBarcodeReader.Settings.nStation := 214; // todo Konstante
	            #TRO336.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO336.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO336.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX3110"].xInCamTriggerReady := "bx3110-TriggerReady";
	            #arCognexInterface["cScannerBX3110"].xInCamTriggerAck := "bx3110-TriggerAck";
	            #arCognexInterface["cScannerBX3110"].xInCamResultsAvailable := "bx3110-Results Available";
	            #arCognexInterface["cScannerBX3110"].xInCamGeneralFault := "bx3110-General Fault";
	            #arCognexInterface["cScannerBX3110"].hwInCamInspectionResults := "=A01+UC031-BX3110~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            
	            REGION Pin
	                #TRO336.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3180"];
	                #TRO336.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO336.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO336.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO336.arInSep[#nActNo].stSettings.nJamLength := "cStorage214ExitJam1";
	                #TRO336.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3450"];
	                #TRO336.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO336.arInSep[#nActNo].stSettings.nJamLength := "cStorage214ExitJam2";
	                #TRO336.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3451"];
	                #TRO336.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO336.arInSep[#nActNo].stSettings.nJamLength := "cStorage214ExitJam3";
	                #TRO336.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3452"];
	                #TRO336.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO336.arInSep[#nActNo].stSettings.nJamLength := "cStorage214ExitJam4";
	                #TRO336.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3453"];
	                #TRO336.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO336.arInSep[#nActNo].stSettings.nJamLength := "cStorage214ExitJam5";
	                #TRO336.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3454"];
	                #TRO336.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO336.arInSep[#nActNo].stSettings.nJamLength := "cStorage214ExitJam6";
	                #TRO336.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3455"];
	                #TRO336.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO336.arInSep[#nActNo].stSettings.nJamLength := "cStorage214ExitJam7";
	                #TRO336.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3456"];
	                #TRO336.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO336.arInSep[#nActNo].stSettings.nJamLength := "cStorage214ExitJam8";
	                #TRO336.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3457"];
	                #TRO336.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO336.arInSep[#nActNo].stSettings.nJamLength := "cStorage214ExitJam9";
	                #TRO336.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3460"];
	                #TRO336.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO336.arInSep[#nActNo].stSettings.nJamLength := "cStorage214ExitJam10";
	                #TRO336.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3461"];
	                #TRO336.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO336.arInSep[#nActNo].stSettings.nJamLength := "cStorage214ExitJam11";
	                #TRO336.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3462"];
	                #TRO336.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO336.arInSep[#nActNo].stSettings.nJamLength := "cStorage214ExitJam12";
	                #TRO336.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3463"];
	                #TRO336.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO336.arInSep[#nActNo].stSettings.nJamLength := "cStorage214ExitJam13";
	                #TRO336.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3464"];
	                #TRO336.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO336.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO336.xInQuitLocal := "SF0127" OR "SF0117";
	            
	            #TRO336.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3210"];
	            
	            #TRO336.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3211"];
	            
	            #TRO336.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3212"];
	            
	            #TRO336.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3213"];
	            
	            #TRO336.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3214"];
	            
	            #TRO336.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3215"];
	            
	            #TRO336.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3216"];
	            
	            #TRO336.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3217"];
	            
	            #TRO336.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3220"];
	            
	            #TRO336.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3221"];
	            
	            #TRO336.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3222"];
	            
	            #TRO336.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3223"];
	            
	            #TRO336.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3224"];
	        END_REGION
	        
	        REGION Aufruf: TRO336
	            #TRO336.stInPriorityManager.xReleaseOk := "cTodoTRUE";
	            
	            #TRO336(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                    nInTestTarget := "IBN".nTestTarget214,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO336,
	                    xInConveyorRunIn := #fbSortConv2102.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv2104.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF2,
	                    arInOutStorageLines := "DB_Storage2.1.4".arLine,
	                    xOutSeparatorPin => "MB3180",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro336"],
	                    arInOutJamEntr := "DB_JamArea2102".stJam2102_4.arCarrier,
	                    stInOutJamEntr := "DB_JamArea2102".stJam2102_4.stData,
	                    arInOutJamExit := "DB_JamArea2104".stJam2104_1.arCarrier,
	                    stInOutJamExit := "DB_JamArea2104".stJam2104_1.stData,
	                    arInOutJamBypass := "DB_JamArea2102".stJam2102_5.arCarrier,
	                    stInOutJamBypass := "DB_JamArea2102".stJam2102_5.stData,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO336,
	                    stMFRStorageRemovalInterface:= "DB_HandshakeStorage".str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl2[4],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX3110"],
	                    stConveyorStations := "DB_ConveyorStations".stConveyorStations214);
	        END_REGION
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO336.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO336.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2102".stJam2102_4.arCarrier[1]);
	        END_REGION
	        
	        REGION Barcode Reader Out (BX3110)                
	            "bx3110-TriggerEnable" := #arCognexInterface["cScannerBX3110"].xOutCamTriggerEnable;
	            "bx3110-Trigger" := #arCognexInterface["cScannerBX3110"].xOutCamTrigger;
	            "bx3110-ResultsAck" := #arCognexInterface["cScannerBX3110"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB3450" := #TRO336.arOutSeparatorStore[1];
	            "MB3451" := #TRO336.arOutSeparatorStore[2];
	            "MB3452" := #TRO336.arOutSeparatorStore[3];
	            "MB3453" := #TRO336.arOutSeparatorStore[4];
	            "MB3454" := #TRO336.arOutSeparatorStore[5];
	            "MB3455" := #TRO336.arOutSeparatorStore[6];
	            "MB3456" := #TRO336.arOutSeparatorStore[7];
	            "MB3457" := #TRO336.arOutSeparatorStore[8];
	            "MB3460" := #TRO336.arOutSeparatorStore[9];
	            "MB3461" := #TRO336.arOutSeparatorStore[10];
	            "MB3462" := #TRO336.arOutSeparatorStore[11];
	            "MB3463" := #TRO336.arOutSeparatorStore[12];
	            "MB3464" := #TRO336.arOutSeparatorStore[13];
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB3210" := #TRO336.arOutSwitch[1];
	            "MB3211" := #TRO336.arOutSwitch[2];
	            "MB3212" := #TRO336.arOutSwitch[3];
	            "MB3213" := #TRO336.arOutSwitch[4];
	            "MB3214" := #TRO336.arOutSwitch[5];
	            "MB3215" := #TRO336.arOutSwitch[6];
	            "MB3216" := #TRO336.arOutSwitch[7];
	            "MB3217" := #TRO336.arOutSwitch[8];
	            "MB3220" := #TRO336.arOutSwitch[9];
	            "MB3221" := #TRO336.arOutSwitch[10];
	            "MB3222" := #TRO336.arOutSwitch[11];
	            "MB3223" := #TRO336.arOutSwitch[12];
	            "MB3224" := #TRO336.arOutSwitch[13];
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 13 DO
	                IF #TRO336.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO336.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest21400" + #nIdxUnloading,
	                                      nReasonCode := '1',
	                                      FIFO := "DB_LGF_FIFO_CommWES_ASRS",
	                                      BUFFER := "DB_Buffer_CommunicationWES_ASRS".BUFFER,
	                                      nInOutSequenceNumber:="DB_CommunicationParameters".nSeqNumWESASRS);
	                END_IF;
	            END_FOR;
	        END_REGION
	    END_REGION
	END_REGION
	
	REGION SECTION 2.2    
	    REGION BLOCK 2.2.1 (TRO349)
	        REGION Encoder Settings
	            #TRO349.stInEncoderParameter.nPosActDif := #fbEncoderGF3202.nOutPosActDif;
	            #TRO349.stInEncoderParameter.nPosPitchPart := #fbEncoderGF3202.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO349.stInSettings.nDestGeneral := "cDest22100";
	            #TRO349.stInSettings.nConvStations := "cHooksSorterMaxPin221"; //Konstante todo
	            #TRO349.stInSettings.nStationsMax := "cStationsMax221"; // Konstante todo
	            #TRO349.stInSettings.nStorageThreshold := "cNoPositionsBlock2";
	            #TRO349.stInSettings.nNoOfLines := 13;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO349.stInSensorReference := "DB_Inputs".Sensors["cInBG3481"];
	        END_REGION
	        
	        REGION Barcode Reader (BX3122)
	            #TRO349.stInBarcodeReader.Settings.nStation := 221; // todo Konstante
	            #TRO349.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO349.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO349.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX3122"].xInCamTriggerReady := "bx3122-TriggerReady";
	            #arCognexInterface["cScannerBX3122"].xInCamTriggerAck := "bx3122-TriggerAck";
	            #arCognexInterface["cScannerBX3122"].xInCamResultsAvailable := "bx3122-Results Available";
	            #arCognexInterface["cScannerBX3122"].xInCamGeneralFault := "bx3122-General Fault";
	            #arCognexInterface["cScannerBX3122"].hwInCamInspectionResults := "=A01+UH03-BX3122~Ergebnisse_–_64_Bytes_1";
	            
	        END_REGION
	        
	        REGION Separator Settings
	            REGION Sep Pin 
	                #TRO349.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3480"];
	                #TRO349.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO349.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO349.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO349.arInSep[#nActNo].stSettings.nJamLength := "cStorage221ExitJam1";
	                #TRO349.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3750"];
	                #TRO349.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO349.arInSep[#nActNo].stSettings.nJamLength := "cStorage221ExitJam2";
	                #TRO349.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3751"];
	                #TRO349.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO349.arInSep[#nActNo].stSettings.nJamLength := "cStorage221ExitJam3";
	                #TRO349.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3752"];
	                #TRO349.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO349.arInSep[#nActNo].stSettings.nJamLength := "cStorage221ExitJam4";
	                #TRO349.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3753"];
	                #TRO349.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO349.arInSep[#nActNo].stSettings.nJamLength := "cStorage221ExitJam5";
	                #TRO349.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3754"];
	                #TRO349.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO349.arInSep[#nActNo].stSettings.nJamLength := "cStorage221ExitJam6";
	                #TRO349.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3755"];
	                #TRO349.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO349.arInSep[#nActNo].stSettings.nJamLength := "cStorage221ExitJam7";
	                #TRO349.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3756"];
	                #TRO349.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO349.arInSep[#nActNo].stSettings.nJamLength := "cStorage221ExitJam8";
	                #TRO349.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3757"];
	                #TRO349.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO349.arInSep[#nActNo].stSettings.nJamLength := "cStorage221ExitJam9";
	                #TRO349.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3760"];
	                #TRO349.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO349.arInSep[#nActNo].stSettings.nJamLength := "cStorage221ExitJam10";
	                #TRO349.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3761"];
	                #TRO349.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO349.arInSep[#nActNo].stSettings.nJamLength := "cStorage221ExitJam11";
	                #TRO349.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3762"];
	                #TRO349.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO349.arInSep[#nActNo].stSettings.nJamLength := "cStorage221ExitJam12";
	                #TRO349.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3763"];
	                #TRO349.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO349.arInSep[#nActNo].stSettings.nJamLength := "cStorage221ExitJam13";
	                #TRO349.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3764"];
	                #TRO349.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO349.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	        END_REGION
	        
	        REGION Unloading Station Settings
	            #TRO349.xInQuitLocal := "SF0051";
	            
	            #TRO349.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3510"];
	            
	            #TRO349.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3511"];
	            
	            #TRO349.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3512"];
	            
	            #TRO349.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3513"];
	            
	            #TRO349.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3514"];
	            
	            #TRO349.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3515"];
	            
	            #TRO349.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3516"];
	            
	            #TRO349.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3517"];
	            
	            #TRO349.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3520"];
	            
	            #TRO349.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3521"];
	            
	            #TRO349.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3522"];
	            
	            #TRO349.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3523"];
	            
	            #TRO349.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3524"];
	            
	        END_REGION
	        
	        REGION Aufruf: TRO349
	            
	            #TRO349.stInPriorityManager.xReleaseOk := TRUE;
	            
	            #TRO349(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                    nInTestTarget := "IBN".nTestTarget221,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO349,
	                    xInConveyorRunIn := #fbSortConv2201.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv2203.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                    arInOutStorageLines := "DB_Storage2.2.1".arLine,
	                    arInOutJamEntr := "DB_JamArea2201".stJam2201_2.arCarrier,
	                    stInOutJamEntr := "DB_JamArea2201".stJam2201_2.stData,
	                    arInOutJamExit := "DB_JamArea2203".stJam2203_1.arCarrier,
	                    stInOutJamExit := "DB_JamArea2203".stJam2203_1.stData,
	                    arInOutJamBypass := #arCarrierPlaceHolder,
	                    stInOutJamBypass := #stJamDataPlaceHolder,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO349,
	                    stMFRStorageRemovalInterface:= "DB_HandshakeStorage".str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl2[5],
	                    xOutSeparatorPin => "MB3480",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro327"],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX3122"],
	                    stConveyorStations := "DB_ConveyorStations".stConveyorStations221);
	        END_REGION ;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO349.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO349.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2201".stJam2201_2.arCarrier[1]);
	        END_REGION
	        
	        REGION Barcode Reader OUT
	            "bx3122-TriggerEnable" := #arCognexInterface["cScannerBX3122"].xOutCamTriggerEnable;
	            "bx3122-Trigger" := #arCognexInterface["cScannerBX3122"].xOutCamTrigger;
	            "bx3122-ResultsAck" := #arCognexInterface["cScannerBX3122"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store OUT
	            "MB3750" := #TRO349.arOutSeparatorStore[1];
	            "MB3751" := #TRO349.arOutSeparatorStore[2];
	            "MB3752" := #TRO349.arOutSeparatorStore[3];
	            "MB3753" := #TRO349.arOutSeparatorStore[4];
	            "MB3754" := #TRO349.arOutSeparatorStore[5];
	            "MB3755" := #TRO349.arOutSeparatorStore[6];
	            "MB3756" := #TRO349.arOutSeparatorStore[7];
	            "MB3757" := #TRO349.arOutSeparatorStore[8];
	            "MB3760" := #TRO349.arOutSeparatorStore[9];
	            "MB3761" := #TRO349.arOutSeparatorStore[10];
	            "MB3762" := #TRO349.arOutSeparatorStore[11];
	            "MB3763" := #TRO349.arOutSeparatorStore[12];
	            "MB3764" := #TRO349.arOutSeparatorStore[13];
	            
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB3510" := #TRO349.arOutSwitch[1];
	            "MB3511" := #TRO349.arOutSwitch[2];
	            "MB3512" := #TRO349.arOutSwitch[3];
	            "MB3513" := #TRO349.arOutSwitch[4];
	            "MB3514" := #TRO349.arOutSwitch[5];
	            "MB3515" := #TRO349.arOutSwitch[6];
	            "MB3516" := #TRO349.arOutSwitch[7];
	            "MB3517" := #TRO349.arOutSwitch[8];
	            "MB3520" := #TRO349.arOutSwitch[9];
	            "MB3521" := #TRO349.arOutSwitch[10];
	            "MB3522" := #TRO349.arOutSwitch[11];
	            "MB3523" := #TRO349.arOutSwitch[12];
	            "MB3524" := #TRO349.arOutSwitch[13];
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 13 DO
	                IF #TRO349.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO349.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest22100" + #nIdxUnloading,
	                                      nReasonCode := '1',
	                                      FIFO := "DB_LGF_FIFO_CommWES_ASRS",
	                                      BUFFER := "DB_Buffer_CommunicationWES_ASRS".BUFFER,
	                                      nInOutSequenceNumber:="DB_CommunicationParameters".nSeqNumWESASRS);
	                END_IF;
	            END_FOR;
	        END_REGION
	        
	    END_REGION
	    
	    REGION BLOCK 2.2.2 (TRO352)
	        REGION Encoder Settings
	            #TRO352.stInEncoderParameter.nPosActDif := #fbEncoderGF3202.nOutPosActDif;
	            #TRO352.stInEncoderParameter.nPosPitchPart := #fbEncoderGF3202.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO352.stInSettings.nDestGeneral := "cDest22200";
	            #TRO352.stInSettings.nConvStations := "cHooksSorterMaxPin222"; //Konstante todo
	            #TRO352.stInSettings.nStationsMax := "cStationsMax222"; // Konstante todo
	            #TRO352.stInSettings.nStorageThreshold := "cNoPositionsBlock2";
	            #TRO352.stInSettings.nNoOfLines := 17;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO352.stInSensorReference := "DB_Inputs".Sensors["cInBG3541"];
	        END_REGION
	        
	        REGION Barcode Reader (BX3123)
	            #TRO352.stInBarcodeReader.Settings.nStation := 222; // todo Konstante
	            #TRO352.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO352.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO352.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX3123"].xInCamTriggerReady := "bx3123-TriggerReady";
	            #arCognexInterface["cScannerBX3123"].xInCamTriggerAck := "bx3123-TriggerAck";
	            #arCognexInterface["cScannerBX3123"].xInCamResultsAvailable := "bx3123-Results Available";
	            #arCognexInterface["cScannerBX3123"].xInCamGeneralFault := "bx3123-General Fault";
	            #arCognexInterface["cScannerBX3123"].hwInCamInspectionResults := "=A01+UH03-BX3123~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings 
	            REGION Sep Pin
	                #TRO352.stInSeparatorPin.stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO352.stInSeparatorPin.stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO352.stInSeparatorPin.stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO352.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3540"];
	                #TRO352.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO352.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO352.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam1";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3810"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam2";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3811"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam3";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3812"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam4";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3813"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam5";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3814"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam6";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3815"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam7";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3816"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam8";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3817"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam9";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3820"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam10";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3821"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam11";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3822"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam12";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3823"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam13";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3824"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam14";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3825"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam15";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3826"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam16";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3827"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO352.arInSep[#nActNo].stSettings.nJamLength := "cStorage222ExitJam17";
	                #TRO352.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3830"];
	                #TRO352.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO352.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO352.xInQuitLocal := "SF0053";
	            
	            #TRO352.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3570"];
	            
	            #TRO352.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3571"];
	            
	            #TRO352.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3572"];
	            
	            #TRO352.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3573"];
	            
	            #TRO352.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3574"];
	            
	            #TRO352.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3575"];
	            
	            #TRO352.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3576"];
	            
	            #TRO352.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3577"];
	            
	            #TRO352.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3580"];
	            
	            #TRO352.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3581"];
	            
	            #TRO352.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3582"];
	            
	            #TRO352.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3583"];
	            
	            #TRO352.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3584"];
	            
	            #TRO352.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG3585"];
	            
	            #TRO352.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG3586"];
	            
	            #TRO352.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG3587"];
	            
	            #TRO352.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG3590"];
	        END_REGION
	        
	        REGION Aufruf: TRO352
	            
	            #TRO352.stInPriorityManager.xReleaseOk := TRUE;
	            
	            #TRO352(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                    nInTestTarget := "IBN".nTestTarget222,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO352,
	                    xInConveyorRunIn := #fbSortConv2201.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv2203.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                    arInOutStorageLines := "DB_Storage2.2.2".arLine,
	                    arInOutJamEntr := "DB_JamArea2201".stJam2201_1.arCarrier,
	                    stInOutJamEntr := "DB_JamArea2201".stJam2201_1.stData,
	                    arInOutJamExit := "DB_JamArea2203".stJam2203_2.arCarrier,
	                    stInOutJamExit := "DB_JamArea2203".stJam2203_2.stData,
	                    arInOutJamBypass := "DB_JamArea2201".stJam2201_2.arCarrier,
	                    stInOutJamBypass := "DB_JamArea2201".stJam2201_2.stData,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO352,
	                    stMFRStorageRemovalInterface:= "DB_HandshakeStorage".str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl2[6],
	                    xOutSeparatorPin => "MB3540",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro327"],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX3123"],
	                    stConveyorStations := "DB_ConveyorStations".stConveyorStations222);
	        END_REGION ;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO352.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO352.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2201".stJam2201_1.arCarrier[1]);
	        END_REGION
	        
	        REGION Barcode-Reader OUT
	            "bx3123-TriggerEnable" := #arCognexInterface["cScannerBX3123"].xOutCamTriggerEnable;
	            "bx3123-Trigger" := #arCognexInterface["cScannerBX3123"].xOutCamTrigger;
	            "bx3123-ResultsAck" := #arCognexInterface["cScannerBX3123"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB3810" := #TRO352.arOutSeparatorStore[1];
	            "MB3811" := #TRO352.arOutSeparatorStore[2];
	            "MB3812" := #TRO352.arOutSeparatorStore[3];
	            "MB3813" := #TRO352.arOutSeparatorStore[4];
	            "MB3814" := #TRO352.arOutSeparatorStore[5];
	            "MB3815" := #TRO352.arOutSeparatorStore[6];
	            "MB3816" := #TRO352.arOutSeparatorStore[7];
	            "MB3817" := #TRO352.arOutSeparatorStore[8];
	            "MB3820" := #TRO352.arOutSeparatorStore[9];
	            "MB3821" := #TRO352.arOutSeparatorStore[10];
	            "MB3822" := #TRO352.arOutSeparatorStore[11];
	            "MB3823" := #TRO352.arOutSeparatorStore[12];
	            "MB3824" := #TRO352.arOutSeparatorStore[13];
	            "MB3825" := #TRO352.arOutSeparatorStore[14];
	            "MB3826" := #TRO352.arOutSeparatorStore[15];
	            "MB3827" := #TRO352.arOutSeparatorStore[16];
	            "MB3830" := #TRO352.arOutSeparatorStore[17];
	            
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB3570" := #TRO352.arOutSwitch[1];
	            "MB3571" := #TRO352.arOutSwitch[2];
	            "MB3572" := #TRO352.arOutSwitch[3];
	            "MB3573" := #TRO352.arOutSwitch[4];
	            "MB3574" := #TRO352.arOutSwitch[5];
	            "MB3575" := #TRO352.arOutSwitch[6];
	            "MB3576" := #TRO352.arOutSwitch[7];
	            "MB3577" := #TRO352.arOutSwitch[8];
	            "MB3580" := #TRO352.arOutSwitch[9];
	            "MB3581" := #TRO352.arOutSwitch[10];
	            "MB3582" := #TRO352.arOutSwitch[11];
	            "MB3583" := #TRO352.arOutSwitch[12];
	            "MB3584" := #TRO352.arOutSwitch[13];
	            "MB3585" := #TRO352.arOutSwitch[14];
	            "MB3586" := #TRO352.arOutSwitch[15];
	            "MB3587" := #TRO352.arOutSwitch[16];
	            "MB3590" := #TRO352.arOutSwitch[17];
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 17 DO
	                IF #TRO352.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO352.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest22200" + #nIdxUnloading,
	                                      nReasonCode := '1',
	                                      FIFO := "DB_LGF_FIFO_CommWES_ASRS",
	                                      BUFFER := "DB_Buffer_CommunicationWES_ASRS".BUFFER,
	                                      nInOutSequenceNumber:="DB_CommunicationParameters".nSeqNumWESASRS);
	                END_IF;
	            END_FOR;
	        END_REGION
	        
	    END_REGION
	    
	    REGION BLOCK 2.2.3 (TRO355)
	        REGION Encoder Settings
	            #TRO355.stInEncoderParameter.nPosActDif := #fbEncoderGF3203.nOutPosActDif;
	            #TRO355.stInEncoderParameter.nPosPitchPart := #fbEncoderGF3203.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO355.stInSettings.nDestGeneral := "cDest22300";
	            #TRO355.stInSettings.nConvStations := "cHooksSorterMaxPin223"; //Konstante todo
	            #TRO355.stInSettings.nStationsMax := "cStationsMax223"; // Konstante todo
	            #TRO355.stInSettings.nStorageThreshold := "cNoPositionsBlock2";
	            #TRO355.stInSettings.nNoOfLines := 21;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO355.stInSensorReference := "DB_Inputs".Sensors["cInBG3601"];
	        END_REGION
	        
	        REGION Barcode Reader (BX3124)
	            #TRO355.stInBarcodeReader.Settings.nStation := 223; // todo Konstante
	            #TRO355.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO355.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO355.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX3124"].xInCamTriggerReady := "bx3124-TriggerReady";
	            #arCognexInterface["cScannerBX3124"].xInCamTriggerAck := "bx3124-TriggerAck";
	            #arCognexInterface["cScannerBX3124"].xInCamResultsAvailable := "bx3124-Results Available";
	            #arCognexInterface["cScannerBX3124"].xInCamGeneralFault := "bx3124-General Fault";
	            #arCognexInterface["cScannerBX3124"].hwInCamInspectionResults := "=A01+UH03-BX3124~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            REGION Sep Pin
	                #TRO355.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3600"];
	                #TRO355.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO355.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO355.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam1";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3870"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam2";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3871"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam3";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3872"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam4";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3873"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam5";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3874"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam6";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3875"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam7";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3876"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam8";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3877"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam9";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3880"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam10";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3881"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam11";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3882"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam12";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3883"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam13";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3884"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam14";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3885"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam15";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3886"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam16";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3887"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam17";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3890"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 18
	                #nActNo := 18;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam18";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3891"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 19
	                #nActNo := 19;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam19";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3892"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 20
	                #nActNo := 20;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam20";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3893"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 21
	                #nActNo := 21;
	                #TRO355.arInSep[#nActNo].stSettings.nJamLength := "cStorage223ExitJam21";
	                #TRO355.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3894"];
	                #TRO355.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO355.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO355.xInQuitLocal := "SF0055";
	            
	            #TRO355.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3630"];
	            
	            #TRO355.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3631"];
	            
	            #TRO355.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3632"];
	            
	            #TRO355.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3633"];
	            
	            #TRO355.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3634"];
	            
	            #TRO355.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3635"];
	            
	            #TRO355.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3636"];
	            
	            #TRO355.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3637"];
	            
	            #TRO355.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3640"];
	            
	            #TRO355.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3641"];
	            
	            #TRO355.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3642"];
	            
	            #TRO355.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3643"];
	            
	            #TRO355.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3644"];
	            
	            #TRO355.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG3645"];
	            
	            #TRO355.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG3646"];
	            
	            #TRO355.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG3647"];
	            
	            #TRO355.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG3650"];
	            
	            #TRO355.arInJamSensor[18] := "DB_Inputs".Sensors["cInBG3651"];
	            
	            #TRO355.arInJamSensor[19] := "DB_Inputs".Sensors["cInBG3652"];
	            
	            #TRO355.arInJamSensor[20] := "DB_Inputs".Sensors["cInBG3653"];
	            
	            #TRO355.arInJamSensor[21] := "DB_Inputs".Sensors["cInBG3654"];
	            
	        END_REGION
	        
	        REGION Aufruf: TRO355
	            
	            #TRO355.stInPriorityManager.xReleaseOk := TRUE;
	            
	            #TRO355(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                    nInTestTarget := "IBN".nTestTarget223,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO355,
	                    xInConveyorRunIn := #fbSortConv2202.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv2204.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                    arInOutStorageLines := "DB_Storage2.2.3".arLine,
	                    arInOutJamEntr := "DB_JamArea2202".stJam2202_3.arCarrier,
	                    stInOutJamEntr := "DB_JamArea2202".stJam2202_3.stData,
	                    arInOutJamExit := "DB_JamArea2204".stJam2204_2.arCarrier,
	                    stInOutJamExit := "DB_JamArea2204".stJam2204_2.stData,
	                    arInOutJamBypass := "DB_JamArea2202".stJam2202_4.arCarrier,
	                    stInOutJamBypass := "DB_JamArea2202".stJam2202_4.stData,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO355,
	                    stMFRStorageRemovalInterface:= "DB_HandshakeStorage".str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl2[7],
	                    xOutSeparatorPin => "MB3600",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro327"],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX3124"],
	                    stConveyorStations := "DB_ConveyorStations".stConveyorStations223);
	        END_REGION
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO355.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO355.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2202".stJam2202_3.arCarrier[1]);
	        END_REGION
	        
	        REGION Barcode Reader OUT (BX3124)                
	            "bx3124-TriggerEnable" := #arCognexInterface["cScannerBX3124"].xOutCamTriggerEnable;
	            "bx3124-Trigger" := #arCognexInterface["cScannerBX3124"].xOutCamTrigger;
	            "bx3124-ResultsAck" := #arCognexInterface["cScannerBX3124"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB3870" := #TRO355.arOutSeparatorStore[1];
	            "MB3871" := #TRO355.arOutSeparatorStore[2];
	            "MB3872" := #TRO355.arOutSeparatorStore[3];
	            "MB3873" := #TRO355.arOutSeparatorStore[4];
	            "MB3874" := #TRO355.arOutSeparatorStore[5];
	            "MB3875" := #TRO355.arOutSeparatorStore[6];
	            "MB3876" := #TRO355.arOutSeparatorStore[7];
	            "MB3877" := #TRO355.arOutSeparatorStore[8];
	            "MB3880" := #TRO355.arOutSeparatorStore[9];
	            "MB3881" := #TRO355.arOutSeparatorStore[10];
	            "MB3882" := #TRO355.arOutSeparatorStore[11];
	            "MB3883" := #TRO355.arOutSeparatorStore[12];
	            "MB3884" := #TRO355.arOutSeparatorStore[13];
	            "MB3885" := #TRO355.arOutSeparatorStore[14];
	            "MB3886" := #TRO355.arOutSeparatorStore[15];
	            "MB3887" := #TRO355.arOutSeparatorStore[16];
	            "MB3890" := #TRO355.arOutSeparatorStore[17];
	            "MB3891" := #TRO355.arOutSeparatorStore[18];
	            "MB3892" := #TRO355.arOutSeparatorStore[19];
	            "MB3893" := #TRO355.arOutSeparatorStore[20];
	            "MB3894" := #TRO355.arOutSeparatorStore[21];
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB3630" := #TRO355.arOutSwitch[1];
	            "MB3631" := #TRO355.arOutSwitch[2];
	            "MB3632" := #TRO355.arOutSwitch[3];
	            "MB3633" := #TRO355.arOutSwitch[4];
	            "MB3634" := #TRO355.arOutSwitch[5];
	            "MB3635" := #TRO355.arOutSwitch[6];
	            "MB3636" := #TRO355.arOutSwitch[7];
	            "MB3637" := #TRO355.arOutSwitch[8];
	            "MB3640" := #TRO355.arOutSwitch[9];
	            "MB3641" := #TRO355.arOutSwitch[10];
	            "MB3642" := #TRO355.arOutSwitch[11];
	            "MB3643" := #TRO355.arOutSwitch[12];
	            "MB3644" := #TRO355.arOutSwitch[13];
	            "MB3645" := #TRO355.arOutSwitch[14];
	            "MB3646" := #TRO355.arOutSwitch[15];
	            "MB3647" := #TRO355.arOutSwitch[16];
	            "MB3650" := #TRO355.arOutSwitch[17];
	            "MB3651" := #TRO355.arOutSwitch[18];
	            "MB3652" := #TRO355.arOutSwitch[19];
	            "MB3653" := #TRO355.arOutSwitch[20];
	            "MB3654" := #TRO355.arOutSwitch[21];
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 21 DO
	                IF #TRO355.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO355.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest22300" + #nIdxUnloading,
	                                      nReasonCode := '1',
	                                      FIFO := "DB_LGF_FIFO_CommWES_ASRS",
	                                      BUFFER := "DB_Buffer_CommunicationWES_ASRS".BUFFER,
	                                      nInOutSequenceNumber:="DB_CommunicationParameters".nSeqNumWESASRS);
	                END_IF;
	            END_FOR;
	        END_REGION
	        
	    END_REGION
	    
	    REGION BLOCK 2.2.4 (TRO358)
	        REGION Encoder Settings
	            #TRO358.stInEncoderParameter.nPosActDif := #fbEncoderGF3203.nOutPosActDif;
	            #TRO358.stInEncoderParameter.nPosPitchPart := #fbEncoderGF3203.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO358.stInSettings.nDestGeneral := "cDest22400";
	            #TRO358.stInSettings.nConvStations := "cHooksSorterMaxPin224"; //Konstante todo
	            #TRO358.stInSettings.nStationsMax := "cStationsMax224"; // Konstante todo
	            #TRO358.stInSettings.nStorageThreshold := "cNoPositionsBlock2";
	            #TRO358.stInSettings.nNoOfLines := 13;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO358.stInSensorReference := "DB_Inputs".Sensors["cInBG3661"];
	        END_REGION
	        
	        REGION Barcode Reader (BX3125)
	            #TRO358.stInBarcodeReader.Settings.nStation := 224; // todo Konstante
	            #TRO358.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO358.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO358.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX3125"].xInCamTriggerReady := "bx3125-TriggerReady";
	            #arCognexInterface["cScannerBX3125"].xInCamTriggerAck := "bx3125-TriggerAck";
	            #arCognexInterface["cScannerBX3125"].xInCamResultsAvailable := "bx3125-Results Available";
	            #arCognexInterface["cScannerBX3125"].xInCamGeneralFault := "bx3125-General Fault";
	            #arCognexInterface["cScannerBX3125"].hwInCamInspectionResults := "=A01+UH03-BX3125~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            REGION Sep Pin
	                #TRO358.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3660"];
	                #TRO358.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO358.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO358.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO358.arInSep[#nActNo].stSettings.nJamLength := "cStorage224ExitJam1";
	                #TRO358.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3930"];
	                #TRO358.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO358.arInSep[#nActNo].stSettings.nJamLength := "cStorage224ExitJam2";
	                #TRO358.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3931"];
	                #TRO358.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO358.arInSep[#nActNo].stSettings.nJamLength := "cStorage224ExitJam3";
	                #TRO358.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3932"];
	                #TRO358.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO358.arInSep[#nActNo].stSettings.nJamLength := "cStorage224ExitJam4";
	                #TRO358.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3933"];
	                #TRO358.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO358.arInSep[#nActNo].stSettings.nJamLength := "cStorage224ExitJam5";
	                #TRO358.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3934"];
	                #TRO358.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO358.arInSep[#nActNo].stSettings.nJamLength := "cStorage224ExitJam6";
	                #TRO358.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3935"];
	                #TRO358.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO358.arInSep[#nActNo].stSettings.nJamLength := "cStorage224ExitJam7";
	                #TRO358.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3936"];
	                #TRO358.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO358.arInSep[#nActNo].stSettings.nJamLength := "cStorage224ExitJam8";
	                #TRO358.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3937"];
	                #TRO358.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO358.arInSep[#nActNo].stSettings.nJamLength := "cStorage224ExitJam9";
	                #TRO358.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3940"];
	                #TRO358.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO358.arInSep[#nActNo].stSettings.nJamLength := "cStorage224ExitJam10";
	                #TRO358.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3941"];
	                #TRO358.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO358.arInSep[#nActNo].stSettings.nJamLength := "cStorage224ExitJam11";
	                #TRO358.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3942"];
	                #TRO358.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO358.arInSep[#nActNo].stSettings.nJamLength := "cStorage224ExitJam12";
	                #TRO358.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3943"];
	                #TRO358.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO358.arInSep[#nActNo].stSettings.nJamLength := "cStorage224ExitJam13";
	                #TRO358.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3944"];
	                #TRO358.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO358.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO358.xInQuitLocal := "SF0057";
	            
	            #TRO358.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3690"];
	            
	            #TRO358.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3691"];
	            
	            #TRO358.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3692"];
	            
	            #TRO358.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3693"];
	            
	            #TRO358.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3694"];
	            
	            #TRO358.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3695"];
	            
	            #TRO358.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3696"];
	            
	            #TRO358.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3697"];
	            
	            #TRO358.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3700"];
	            
	            #TRO358.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3701"];
	            
	            #TRO358.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3702"];
	            
	            #TRO358.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3703"];
	            
	            #TRO358.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3704"];
	            
	            
	        END_REGION
	        
	        REGION Aufruf: TRO358
	            
	            #TRO358.stInPriorityManager.xReleaseOk := TRUE;
	            
	            #TRO358(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                    nInTestTarget := "IBN".nTestTarget224,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO358,
	                    xInConveyorRunIn := #fbSortConv2202.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv2204.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                    arInOutStorageLines := "DB_Storage2.2.4".arLine,
	                    arInOutJamEntr := "DB_JamArea2202".stJam2202_4.arCarrier,
	                    stInOutJamEntr := "DB_JamArea2202".stJam2202_4.stData,
	                    arInOutJamExit := "DB_JamArea2204".stJam2204_1.arCarrier,
	                    stInOutJamExit := "DB_JamArea2204".stJam2204_1.stData,
	                    arInOutJamBypass := "DB_JamArea2202".stJam2202_5.arCarrier,
	                    stInOutJamBypass := "DB_JamArea2202".stJam2202_5.stData,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO358,
	                    stMFRStorageRemovalInterface:= "DB_HandshakeStorage".str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl2[8],
	                    xOutSeparatorPin => "MB3660",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro327"],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX3125"],
	                    stConveyorStations := "DB_ConveyorStations".stConveyorStations224);
	        END_REGION
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO358.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO358.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2202".stJam2202_4.arCarrier[1]);
	        END_REGION
	        
	        REGION Barcode Reader OUT (BX3125)
	            "bx3125-TriggerEnable" := #arCognexInterface["cScannerBX3125"].xOutCamTriggerEnable;
	            "bx3125-Trigger" := #arCognexInterface["cScannerBX3125"].xOutCamTrigger;
	            "bx3125-ResultsAck" := #arCognexInterface["cScannerBX3125"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB3930" := #TRO358.arOutSeparatorStore[1];
	            "MB3931" := #TRO358.arOutSeparatorStore[2];
	            "MB3932" := #TRO358.arOutSeparatorStore[3];
	            "MB3933" := #TRO358.arOutSeparatorStore[4];
	            "MB3934" := #TRO358.arOutSeparatorStore[5];
	            "MB3935" := #TRO358.arOutSeparatorStore[6];
	            "MB3936" := #TRO358.arOutSeparatorStore[7];
	            "MB3937" := #TRO358.arOutSeparatorStore[8];
	            "MB3940" := #TRO358.arOutSeparatorStore[9];
	            "MB3941" := #TRO358.arOutSeparatorStore[10];
	            "MB3942" := #TRO358.arOutSeparatorStore[11];
	            "MB3943" := #TRO358.arOutSeparatorStore[12];
	            "MB3944" := #TRO358.arOutSeparatorStore[13];
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB3690" := #TRO358.arOutSwitch[1];
	            "MB3691" := #TRO358.arOutSwitch[2];
	            "MB3692" := #TRO358.arOutSwitch[3];
	            "MB3693" := #TRO358.arOutSwitch[4];
	            "MB3694" := #TRO358.arOutSwitch[5];
	            "MB3695" := #TRO358.arOutSwitch[6];
	            "MB3696" := #TRO358.arOutSwitch[7];
	            "MB3697" := #TRO358.arOutSwitch[8];
	            "MB3700" := #TRO358.arOutSwitch[9];
	            "MB3701" := #TRO358.arOutSwitch[10];
	            "MB3702" := #TRO358.arOutSwitch[11];
	            "MB3703" := #TRO358.arOutSwitch[12];
	            "MB3704" := #TRO358.arOutSwitch[13];
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 13 DO
	                IF #TRO358.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO358.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest22400" + #nIdxUnloading,
	                                      nReasonCode := '1',
	                                      FIFO := "DB_LGF_FIFO_CommWES_ASRS",
	                                      BUFFER := "DB_Buffer_CommunicationWES_ASRS".BUFFER,
	                                      nInOutSequenceNumber:="DB_CommunicationParameters".nSeqNumWESASRS);
	                END_IF;
	            END_FOR;
	        END_REGION
	        
	    END_REGION
	END_REGION
	
	REGION SECTION 2.3
	    REGION BLOCK 2.3.1 (TRO 371)  
	        
	        REGION Encoder Settings
	            #TRO371.stInEncoderParameter.nPosActDif := #fbEncoderGF3204.nOutPosActDif;
	            #TRO371.stInEncoderParameter.nPosPitchPart := #fbEncoderGF3204.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO371.stInSettings.nDestGeneral := "cDest23100";
	            #TRO371.stInSettings.nConvStations := "cHooksSorterMaxPin231"; //Konstante todo
	            #TRO371.stInSettings.nStationsMax := "cStationsMax231"; // Konstante todo
	            #TRO371.stInSettings.nStorageThreshold := "cNoPositionsBlock3";
	            #TRO371.stInSettings.nNoOfLines := 19;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO371.stInSensorReference := "DB_Inputs".Sensors["cInBG4201"];
	        END_REGION
	        
	        REGION Barcode Reader In (BX3133)
	            #TRO371.stInBarcodeReader.Settings.nStation := 231; // todo Konstante
	            #TRO371.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO371.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO371.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX3133"].xInCamTriggerReady := "bx3133-TriggerReady";
	            #arCognexInterface["cScannerBX3133"].xInCamTriggerAck := "bx3133-TriggerAck";
	            #arCognexInterface["cScannerBX3133"].xInCamResultsAvailable := "bx3133-Results Available";
	            #arCognexInterface["cScannerBX3133"].xInCamGeneralFault := "bx3133-General Fault";
	            #arCognexInterface["cScannerBX3133"].hwInCamInspectionResults := "=A01+UC033-BX3133~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            REGION Sep Pin
	                #TRO371.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG4200"];
	                #TRO371.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO371.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO371.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := 4;//"cStorage231ExitJam1";
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3990"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam2";
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3991"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam3";
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3992"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam4";
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3993"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam5";
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3994"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam6";
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3995"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam7";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3996"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam8";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3997"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam9";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4000"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam10";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4001"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam11";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4002"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam12";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4003"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam13";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4004"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam14";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4005"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam15";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4006"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam16";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4007"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam17";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4010"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 18
	                #nActNo := 18;
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam18";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4011"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 19
	                #nActNo := 19;
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO371.arInSep[#nActNo].stSettings.nJamLength := "cStorage231ExitJam19";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO371.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO371.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4012"];
	                #TRO371.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO371.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO371.xInQuitLocal := "SF0241" OR "SF0237";
	            
	            #TRO371.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG4230"];
	            
	            #TRO371.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG4231"];
	            
	            #TRO371.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG4232"];
	            
	            #TRO371.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG4233"];
	            
	            #TRO371.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG4234"];
	            
	            #TRO371.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG4235"];
	            
	            #TRO371.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG4236"];
	            
	            #TRO371.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG4237"];
	            
	            #TRO371.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG4240"];
	            
	            #TRO371.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG4241"];
	            
	            #TRO371.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG4242"];
	            
	            #TRO371.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG4243"];
	            
	            #TRO371.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG4244"];
	            
	            #TRO371.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG4245"];
	            
	            #TRO371.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG4246"];
	            
	            #TRO371.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG4247"];
	            
	            #TRO371.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG4250"];
	            
	            #TRO371.arInJamSensor[18] := "DB_Inputs".Sensors["cInBG4251"];
	            
	            #TRO371.arInJamSensor[19] := "DB_Inputs".Sensors["cInBG4252"];
	            
	        END_REGION
	        
	        REGION Aufruf: TRO371
	            
	            #TRO371.stInPriorityManager.xReleaseOk := TRUE;
	            
	            #TRO371(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                    nInTestTarget := "IBN".nTestTarget231,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := TRUE,//"DB_TRO_Test".TRO371,
	                    xInConveyorRunIn := #fbSortConv2303.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv2301.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF4,
	                    arInOutStorageLines := "DB_Storage2.3.1".arLine,
	                    arInOutJamEntr := "DB_JamArea2303".stJam2303_2.arCarrier,
	                    stInOutJamEntr := "DB_JamArea2303".stJam2303_2.stData,
	                    arInOutJamExit := "DB_JamArea2301".stJam2301_1.arCarrier,
	                    stInOutJamExit := "DB_JamArea2301".stJam2301_1.stData,
	                    arInOutJamBypass := #arCarrierPlaceHolder,
	                    stInOutJamBypass := #stJamDataPlaceHolder,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO371,
	                    stMFRStorageRemovalInterface:= "DB_HandshakeStorage".str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl2[9],
	                    xOutSeparatorPin => "MB4200",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro371"],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX3133"],
	                    stConveyorStations := "DB_ConveyorStations".stConveyorStations231);
	        END_REGION ;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO371.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO371.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2303".stJam2303_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Barcode Reader Out (BX3133)
	            "bx3133-TriggerEnable" := #arCognexInterface["cScannerBX3133"].xOutCamTriggerEnable;
	            "bx3133-Trigger" := #arCognexInterface["cScannerBX3133"].xOutCamTrigger;
	            "bx3133-ResultsAck" := #arCognexInterface["cScannerBX3133"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB3990" := #TRO371.arOutSeparatorStore[1];
	            "MB3991" := #TRO371.arOutSeparatorStore[2];
	            "MB3992" := #TRO371.arOutSeparatorStore[3];
	            "MB3993" := #TRO371.arOutSeparatorStore[4];
	            "MB3994" := #TRO371.arOutSeparatorStore[5];
	            "MB3995" := #TRO371.arOutSeparatorStore[6];
	            "MB3996" := #TRO371.arOutSeparatorStore[7];
	            "MB3997" := #TRO371.arOutSeparatorStore[8];
	            "MB4000" := #TRO371.arOutSeparatorStore[9];
	            "MB4001" := #TRO371.arOutSeparatorStore[10];
	            "MB4002" := #TRO371.arOutSeparatorStore[11];
	            "MB4003" := #TRO371.arOutSeparatorStore[12];
	            "MB4004" := #TRO371.arOutSeparatorStore[13];
	            "MB4005" := #TRO371.arOutSeparatorStore[14];
	            "MB4006" := #TRO371.arOutSeparatorStore[15];
	            "MB4007" := #TRO371.arOutSeparatorStore[16];
	            "MB4010" := #TRO371.arOutSeparatorStore[17];
	            "MB4011" := #TRO371.arOutSeparatorStore[18];
	            "MB4012" := #TRO371.arOutSeparatorStore[19];
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB4230" := #TRO371.arOutSwitch[1];
	            "MB4231" := #TRO371.arOutSwitch[2];
	            "MB4232" := #TRO371.arOutSwitch[3];
	            "MB4233" := #TRO371.arOutSwitch[4];
	            "MB4234" := #TRO371.arOutSwitch[5];
	            "MB4235" := #TRO371.arOutSwitch[6];
	            "MB4236" := #TRO371.arOutSwitch[7];
	            "MB4237" := #TRO371.arOutSwitch[8];
	            "MB4240" := #TRO371.arOutSwitch[9];
	            "MB4241" := #TRO371.arOutSwitch[10];
	            "MB4242" := #TRO371.arOutSwitch[11];
	            "MB4243" := #TRO371.arOutSwitch[12];
	            "MB4244" := #TRO371.arOutSwitch[13];
	            "MB4245" := #TRO371.arOutSwitch[14];
	            "MB4246" := #TRO371.arOutSwitch[15];
	            "MB4247" := #TRO371.arOutSwitch[16];
	            "MB4250" := #TRO371.arOutSwitch[17];
	            "MB4251" := #TRO371.arOutSwitch[18];
	            "MB4252" := #TRO371.arOutSwitch[19];
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 19 DO
	                IF #TRO371.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO371.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest23100" + #nIdxUnloading,
	                                      nReasonCode := '1',
	                                      FIFO := "DB_LGF_FIFO_CommWES_ASRS",
	                                      BUFFER := "DB_Buffer_CommunicationWES_ASRS".BUFFER,
	                                      nInOutSequenceNumber:="DB_CommunicationParameters".nSeqNumWESASRS);
	                END_IF;
	            END_FOR;
	        END_REGION
	        
	    END_REGION
	    
	    REGION BLOCK 2.3.2 (TRO 374)
	        REGION Encoder Settings
	            #TRO374.stInEncoderParameter.nPosActDif := #fbEncoderGF3204.nOutPosActDif;
	            #TRO374.stInEncoderParameter.nPosPitchPart := #fbEncoderGF3204.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO374.stInSettings.nDestGeneral := "cDest23200";
	            #TRO374.stInSettings.nConvStations := "cHooksSorterMaxPin232"; //Konstante todo
	            #TRO374.stInSettings.nStationsMax := "cStationsMax232"; // Konstante todo
	            #TRO374.stInSettings.nStorageThreshold := "cNoPositionsBlock3";
	            #TRO374.stInSettings.nNoOfLines := 17;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO374.stInSensorReference := "DB_Inputs".Sensors["cInBG4261"];
	        END_REGION
	        
	        REGION Barcode Reader IN (BX3134)
	            #TRO374.stInBarcodeReader.Settings.nStation := 232; // todo Konstante
	            #TRO374.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO374.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO374.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX3134"].xInCamTriggerReady := "bx3134-TriggerReady";
	            #arCognexInterface["cScannerBX3134"].xInCamTriggerAck := "bx3134-TriggerAck";
	            #arCognexInterface["cScannerBX3134"].xInCamResultsAvailable := "bx3134-Results Available";
	            #arCognexInterface["cScannerBX3134"].xInCamGeneralFault := "bx3134-General Fault";
	            #arCognexInterface["cScannerBX3134"].hwInCamInspectionResults := "=A01+UC033-BX3134~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            
	            REGION Pin
	                #TRO374.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG4260"];
	                #TRO374.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO374.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO374.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam1";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4050"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam2";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4051"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam3";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4052"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam4";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4053"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam5";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4054"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam6";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4055"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam7";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4056"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam8";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4057"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam9";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4060"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam10";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4061"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam11";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4062"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam12";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4063"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam13";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4064"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam14";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4065"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam15";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4066"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam16";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4067"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO374.arInSep[#nActNo].stSettings.nJamLength := "cStorage232ExitJam17";
	                #TRO374.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4070"];
	                #TRO374.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO374.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO374.xInQuitLocal := "SF0243" OR "SF0237";
	            
	            #TRO374.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG4290"];
	            
	            #TRO374.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG4291"];
	            
	            #TRO374.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG4292"];
	            
	            #TRO374.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG4293"];
	            
	            #TRO374.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG4294"];
	            
	            #TRO374.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG4295"];
	            
	            #TRO374.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG4296"];
	            
	            #TRO374.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG4297"];
	            
	            #TRO374.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG4300"];
	            
	            #TRO374.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG4301"];
	            
	            #TRO374.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG4302"];
	            
	            #TRO374.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG4303"];
	            
	            #TRO374.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG4304"];
	            
	            #TRO374.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG4305"];
	            
	            #TRO374.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG4306"];
	            
	            #TRO374.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG4307"];
	            
	            #TRO374.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG4310"];
	        END_REGION ;
	        
	        REGION Aufruf: TRO374
	            
	            #TRO374.stInPriorityManager.xReleaseOk := True;
	            
	            #TRO374(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                    nInTestTarget := "IBN".nTestTarget232,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := TRUE, //"DB_TRO_Test".TRO374,
	                    xInConveyorRunIn := #fbSortConv2303.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv2301.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF4,
	                    arInOutStorageLines := "DB_Storage2.3.2".arLine,
	                    arInOutJamEntr := "DB_JamArea2303".stJam2303_1.arCarrier,
	                    stInOutJamEntr := "DB_JamArea2303".stJam2303_1.stData,
	                    arInOutJamExit := "DB_JamArea2301".stJam2301_2.arCarrier,
	                    stInOutJamExit := "DB_JamArea2301".stJam2301_2.stData,
	                    arInOutJamBypass := "DB_JamArea2303".stJam2303_2.arCarrier,
	                    stInOutJamBypass := "DB_JamArea2303".stJam2303_2.stData,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO374,
	                    stMFRStorageRemovalInterface:= "DB_HandshakeStorage".str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl2[10],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX3134"],
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTRO374"],
	                    xOutSeparatorPin => "MB4260",
	                    stConveyorStations := "DB_ConveyorStations".stConveyorStations232);
	        END_REGION ;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO374.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO374.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2303".stJam2303_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Barcode Reader Out (BX3134)                
	            "bx3134-TriggerEnable" := #arCognexInterface["cScannerBX3134"].xOutCamTriggerEnable;
	            "bx3134-Trigger" := #arCognexInterface["cScannerBX3134"].xOutCamTrigger;
	            "bx3134-ResultsAck" := #arCognexInterface["cScannerBX3134"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB4050" := #TRO374.arOutSeparatorStore[1];
	            "MB4051" := #TRO374.arOutSeparatorStore[2];
	            "MB4052" := #TRO374.arOutSeparatorStore[3];
	            "MB4053" := #TRO374.arOutSeparatorStore[4];
	            "MB4054" := #TRO374.arOutSeparatorStore[5];
	            "MB4055" := #TRO374.arOutSeparatorStore[6];
	            "MB4056" := #TRO374.arOutSeparatorStore[7];
	            "MB4057" := #TRO374.arOutSeparatorStore[8];
	            "MB4060" := #TRO374.arOutSeparatorStore[9];
	            "MB4061" := #TRO374.arOutSeparatorStore[10];
	            "MB4062" := #TRO374.arOutSeparatorStore[11];
	            "MB4063" := #TRO374.arOutSeparatorStore[12];
	            "MB4064" := #TRO374.arOutSeparatorStore[13];
	            "MB4065" := #TRO374.arOutSeparatorStore[14];
	            "MB4066" := #TRO374.arOutSeparatorStore[15];
	            "MB4067" := #TRO374.arOutSeparatorStore[16];
	            "MB4070" := #TRO374.arOutSeparatorStore[17];
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB4290" := #TRO374.arOutSwitch[1];
	            "MB4291" := #TRO374.arOutSwitch[2];
	            "MB4292" := #TRO374.arOutSwitch[3];
	            "MB4293" := #TRO374.arOutSwitch[4];
	            "MB4294" := #TRO374.arOutSwitch[5];
	            "MB4295" := #TRO374.arOutSwitch[6];
	            "MB4296" := #TRO374.arOutSwitch[7];
	            "MB4297" := #TRO374.arOutSwitch[8];
	            "MB4300" := #TRO374.arOutSwitch[9];
	            "MB4301" := #TRO374.arOutSwitch[10];
	            "MB4302" := #TRO374.arOutSwitch[11];
	            "MB4303" := #TRO374.arOutSwitch[12];
	            "MB4304" := #TRO374.arOutSwitch[13];
	            "MB4305" := #TRO374.arOutSwitch[14];
	            "MB4306" := #TRO374.arOutSwitch[15];
	            "MB4307" := #TRO374.arOutSwitch[16];
	            "MB4310" := #TRO374.arOutSwitch[17];
	            
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 17 DO
	                IF #TRO374.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO374.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest23200" + #nIdxUnloading,
	                                      nReasonCode := '1',
	                                      FIFO := "DB_LGF_FIFO_CommWES_ASRS",
	                                      BUFFER := "DB_Buffer_CommunicationWES_ASRS".BUFFER,
	                                      nInOutSequenceNumber:="DB_CommunicationParameters".nSeqNumWESASRS);
	                END_IF;
	            END_FOR;
	        END_REGION
	        
	    END_REGION
	    
	    REGION BLOCK 2.3.3 (TRO 377)
	        
	        REGION Encoder Settings
	            #TRO377.stInEncoderParameter.nPosActDif := #fbEncoderGF3205.nOutPosActDif;
	            #TRO377.stInEncoderParameter.nPosPitchPart := #fbEncoderGF3205.nPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO377.stInSettings.nDestGeneral := "cDest23300";
	            #TRO377.stInSettings.nConvStations := "cHooksSorterMaxPin233"; //Konstante todo
	            #TRO377.stInSettings.nStationsMax := "cStationsMax233"; // Konstante todo
	            #TRO377.stInSettings.nStorageThreshold := "cNoPositionsBlock3";
	            #TRO377.stInSettings.nNoOfLines := 21;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO377.stInSensorReference := "DB_Inputs".Sensors["cInBG4321"];
	        END_REGION
	        
	        REGION Barcode Reader In (BX3135)
	            #TRO377.stInBarcodeReader.Settings.nStation := 233; // todo Konstante
	            #TRO377.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO377.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO377.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX3135"].xInCamTriggerReady := "bx3135-TriggerReady";
	            #arCognexInterface["cScannerBX3135"].xInCamTriggerAck := "bx3135-TriggerAck";
	            #arCognexInterface["cScannerBX3135"].xInCamResultsAvailable := "bx3135-Results Available";
	            #arCognexInterface["cScannerBX3135"].xInCamGeneralFault := "bx3135-General Fault";
	            #arCognexInterface["cScannerBX3135"].hwInCamInspectionResults := "=A01+UC033-BX3135~Ergebnisse_–_64_Bytes_1";
	            
	        END_REGION
	        
	        REGION Separator Settings
	            
	            REGION Pin
	                #TRO377.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG4320"];
	                #TRO377.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO377.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO377.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam1";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4110"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam2";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4111"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam3";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4112"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam4";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4113"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam5";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4114"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam6";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4115"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam7";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4116"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam8";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4117"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam9";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4120"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam10";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4121"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam11";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4122"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam12";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4123"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam13";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4124"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam14";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4125"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam15";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4126"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam16";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4127"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam17";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4130"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 18
	                #nActNo := 18;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam18";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4131"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 19
	                #nActNo := 19;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam19";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4132"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 20
	                #nActNo := 20;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam20";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4133"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 21
	                #nActNo := 21;
	                #TRO377.arInSep[#nActNo].stSettings.nJamLength := "cStorage233ExitJam21";
	                #TRO377.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4134"];
	                #TRO377.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO377.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO377.xInQuitLocal := "SF0245" OR "SF0237" OR "IBN".xQuit213;
	            
	            #TRO377.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG4350"];
	            
	            #TRO377.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG4351"];
	            
	            #TRO377.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG4352"];
	            
	            #TRO377.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG4353"];
	            
	            #TRO377.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG4354"];
	            
	            #TRO377.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG4355"];
	            
	            #TRO377.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG4356"];
	            
	            #TRO377.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG4357"];
	            
	            #TRO377.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG4360"];
	            
	            #TRO377.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG4361"];
	            
	            #TRO377.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG4362"];
	            
	            #TRO377.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG4363"];
	            
	            #TRO377.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG4364"];
	            
	            #TRO377.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG4365"];
	            
	            #TRO377.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG4366"];
	            
	            #TRO377.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG4367"];
	            
	            #TRO377.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG4370"];
	            
	            #TRO377.arInJamSensor[18] := "DB_Inputs".Sensors["cInBG4371"];
	            
	            #TRO377.arInJamSensor[19] := "DB_Inputs".Sensors["cInBG4372"];
	            
	            #TRO377.arInJamSensor[20] := "DB_Inputs".Sensors["cInBG4373"];
	            
	            #TRO377.arInJamSensor[21] := "DB_Inputs".Sensors["cInBG4374"];
	        END_REGION ;
	        
	        REGION Aufruf: TRO377
	            
	            #TRO377.stInPriorityManager.xReleaseOk := "cTodoTRUE";
	            
	            #TRO377(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                    nInTestTarget := "IBN".nTestTarget233,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := TRUE,//"DB_TRO_Test".TRO377,
	                    xInConveyorRunIn := #fbSortConv2304.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv2302.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF4,
	                    arInOutStorageLines := "DB_Storage2.3.3".arLine,
	                    arInOutJamEntr := "DB_JamArea2304".stJam2304_3.arCarrier,
	                    stInOutJamEntr := "DB_JamArea2304".stJam2304_3.stData,
	                    arInOutJamExit := "DB_JamArea2302".stJam2302_2.arCarrier,
	                    stInOutJamExit := "DB_JamArea2302".stJam2302_2.stData,
	                    arInOutJamBypass := "DB_JamArea2304".stJam2304_4.arCarrier,
	                    stInOutJamBypass := "DB_JamArea2304".stJam2304_4.stData,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO377,
	                    stMFRStorageRemovalInterface:= "DB_HandshakeStorage".str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl2[11],
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTRO377"],
	                    xOutSeparatorPin => "MB4320",
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX3135"],
	                    stConveyorStations := "DB_ConveyorStations".stConveyorStations233);
	        END_REGION
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO377.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO377.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2304".stJam2304_3.arCarrier[1]);
	        END_REGION
	        
	        REGION Barcode Reader Out (BX3135)                
	            "bx3135-TriggerEnable" := #arCognexInterface["cScannerBX3135"].xOutCamTriggerEnable;
	            "bx3135-Trigger" := #arCognexInterface["cScannerBX3135"].xOutCamTrigger;
	            "bx3135-ResultsAck" := #arCognexInterface["cScannerBX3135"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB4110" := #TRO377.arOutSeparatorStore[1];
	            "MB4111" := #TRO377.arOutSeparatorStore[2];
	            "MB4112" := #TRO377.arOutSeparatorStore[3];
	            "MB4113" := #TRO377.arOutSeparatorStore[4];
	            "MB4114" := #TRO377.arOutSeparatorStore[5];
	            "MB4115" := #TRO377.arOutSeparatorStore[6];
	            "MB4116" := #TRO377.arOutSeparatorStore[7];
	            "MB4117" := #TRO377.arOutSeparatorStore[8];
	            "MB4120" := #TRO377.arOutSeparatorStore[9];
	            "MB4121" := #TRO377.arOutSeparatorStore[10];
	            "MB4122" := #TRO377.arOutSeparatorStore[11];
	            "MB4123" := #TRO377.arOutSeparatorStore[12];
	            "MB4124" := #TRO377.arOutSeparatorStore[13];
	            "MB4125" := #TRO377.arOutSeparatorStore[14];
	            "MB4126" := #TRO377.arOutSeparatorStore[15];
	            "MB4127" := #TRO377.arOutSeparatorStore[16];
	            "MB4130" := #TRO377.arOutSeparatorStore[17];
	            "MB4131" := #TRO377.arOutSeparatorStore[18];
	            "MB4132" := #TRO377.arOutSeparatorStore[19];
	            "MB4133" := #TRO377.arOutSeparatorStore[20];
	            "MB4134" := #TRO377.arOutSeparatorStore[21];
	        END_REGION
	        
	        REGION Unlaoding Stations Out
	            "MB4350" := #TRO377.arOutSwitch[1];
	            "MB4351" := #TRO377.arOutSwitch[2];
	            "MB4352" := #TRO377.arOutSwitch[3];
	            "MB4353" := #TRO377.arOutSwitch[4];
	            "MB4354" := #TRO377.arOutSwitch[5];
	            "MB4355" := #TRO377.arOutSwitch[6];
	            "MB4356" := #TRO377.arOutSwitch[7];
	            "MB4357" := #TRO377.arOutSwitch[8];
	            "MB4360" := #TRO377.arOutSwitch[9];
	            "MB4361" := #TRO377.arOutSwitch[10];
	            "MB4362" := #TRO377.arOutSwitch[11];
	            "MB4363" := #TRO377.arOutSwitch[12];
	            "MB4364" := #TRO377.arOutSwitch[13];
	            "MB4365" := #TRO377.arOutSwitch[14];
	            "MB4366" := #TRO377.arOutSwitch[15];
	            "MB4367" := #TRO377.arOutSwitch[16];
	            "MB4370" := #TRO377.arOutSwitch[17];
	            "MB4371" := #TRO377.arOutSwitch[18];
	            "MB4372" := #TRO377.arOutSwitch[19];
	            "MB4373" := #TRO377.arOutSwitch[20];
	            "MB4374" := #TRO377.arOutSwitch[21];
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 21 DO
	                IF #TRO377.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO377.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest23300" + #nIdxUnloading,
	                                      nReasonCode := '1',
	                                      FIFO := "DB_LGF_FIFO_CommWES_ASRS",
	                                      BUFFER := "DB_Buffer_CommunicationWES_ASRS".BUFFER,
	                                      nInOutSequenceNumber:="DB_CommunicationParameters".nSeqNumWESASRS);
	                END_IF;
	            END_FOR;
	        END_REGION
	        
	    END_REGION
	    
	    REGION BLOCK 2.3.4 (TRO 380)
	        
	        REGION Encoder Settings
	            #TRO380.stInEncoderParameter.nPosActDif := #fbEncoderGF3205.nOutPosActDif;
	            #TRO380.stInEncoderParameter.nPosPitchPart := #fbEncoderGF3205.nPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO380.stInSettings.nDestGeneral := "cDest23400";
	            #TRO380.stInSettings.nConvStations := "cHooksSorterMaxPin234"; //Konstante todo
	            #TRO380.stInSettings.nStationsMax := "cStationsMax234"; // Konstante todo
	            #TRO380.stInSettings.nStorageThreshold := "cNoPositionsBlock3";
	            #TRO380.stInSettings.nNoOfLines := 15;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO380.stInSensorReference := "DB_Inputs".Sensors["cInBG4381"];
	        END_REGION
	        
	        REGION Barcode Reader In (BX4381)
	            #TRO380.stInBarcodeReader.Settings.nStation := 234; // todo Konstante
	            #TRO380.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO380.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO380.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX3136"].xInCamTriggerReady := "bx3136-TriggerReady";
	            #arCognexInterface["cScannerBX3136"].xInCamTriggerAck := "bx3136-TriggerAck";
	            #arCognexInterface["cScannerBX3136"].xInCamResultsAvailable := "bx3136-Results Available";
	            #arCognexInterface["cScannerBX3136"].xInCamGeneralFault := "bx3136-General Fault";
	            #arCognexInterface["cScannerBX3136"].hwInCamInspectionResults := "=A01+UC033-BX3136~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            
	            REGION Pin
	                #TRO380.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG4380"];
	                #TRO380.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO380.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO380.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam1";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4170"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam2";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4171"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam3";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4172"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam4";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4173"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam5";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4174"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam6";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4175"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam7";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4176"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam8";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4177"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam9";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4180"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam10";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4181"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam11";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4182"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam12";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4183"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam13";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4184"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam14";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4185"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO380.arInSep[#nActNo].stSettings.nJamLength := "cStorage234ExitJam15";
	                #TRO380.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4186"];
	                #TRO380.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO380.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO380.xInQuitLocal := "SF0247" OR "SF0237";
	            
	            #TRO380.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG4410"];
	            
	            #TRO380.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG4411"];
	            
	            #TRO380.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG4412"];
	            
	            #TRO380.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG4413"];
	            
	            #TRO380.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG4414"];
	            
	            #TRO380.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG4415"];
	            
	            #TRO380.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG4416"];
	            
	            #TRO380.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG4417"];
	            
	            #TRO380.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG4420"];
	            
	            #TRO380.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG4421"];
	            
	            #TRO380.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG4422"];
	            
	            #TRO380.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG4423"];
	            
	            #TRO380.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG4424"];
	            
	            #TRO380.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG4425"];
	            
	            #TRO380.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG4426"];
	            
	        END_REGION
	        
	        REGION Aufruf: TRO380
	            #TRO380.stInPriorityManager.xReleaseOk := "cTodoTRUE";
	            
	            #TRO380(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                    nInTestTarget := "IBN".nTestTarget234,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := TRUE, //"DB_TRO_Test".TRO380,
	                    xInConveyorRunIn := #fbSortConv2304.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv2302.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF4,
	                    arInOutStorageLines := "DB_Storage2.3.4".arLine,
	                    xOutSeparatorPin => "MB4380",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTRO380"],
	                    arInOutJamEntr := "DB_JamArea2304".stJam2304_4.arCarrier,
	                    stInOutJamEntr := "DB_JamArea2304".stJam2304_4.stData,
	                    arInOutJamExit := "DB_JamArea2302".stJam2302_1.arCarrier,
	                    stInOutJamExit := "DB_JamArea2302".stJam2302_1.stData,
	                    arInOutJamBypass := #arCarrierPlaceHolder,
	                    stInOutJamBypass := #stJamDataPlaceHolder,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO380,
	                    stMFRStorageRemovalInterface:= "DB_HandshakeStorage".str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl2[12],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX3136"],
	                    stConveyorStations := "DB_ConveyorStations".stConveyorStations234);
	        END_REGION
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO380.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO380.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2304".stJam2304_4.arCarrier[1]);
	        END_REGION
	        
	        REGION Barcode Reader Out (BX3136)                
	            "bx3136-TriggerEnable" := #arCognexInterface["cScannerBX3136"].xOutCamTriggerEnable;
	            "bx3136-Trigger" := #arCognexInterface["cScannerBX3136"].xOutCamTrigger;
	            "bx3136-ResultsAck" := #arCognexInterface["cScannerBX3136"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB4170" := #TRO380.arOutSeparatorStore[1];
	            "MB4171" := #TRO380.arOutSeparatorStore[2];
	            "MB4172" := #TRO380.arOutSeparatorStore[3];
	            "MB4173" := #TRO380.arOutSeparatorStore[4];
	            "MB4174" := #TRO380.arOutSeparatorStore[5];
	            "MB4175" := #TRO380.arOutSeparatorStore[6];
	            "MB4176" := #TRO380.arOutSeparatorStore[7];
	            "MB4177" := #TRO380.arOutSeparatorStore[8];
	            "MB4180" := #TRO380.arOutSeparatorStore[9];
	            "MB4181" := #TRO380.arOutSeparatorStore[10];
	            "MB4182" := #TRO380.arOutSeparatorStore[11];
	            "MB4183" := #TRO380.arOutSeparatorStore[12];
	            "MB4184" := #TRO380.arOutSeparatorStore[13];
	            "MB4185" := #TRO380.arOutSeparatorStore[14];
	            "MB4186" := #TRO380.arOutSeparatorStore[15];
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB4410" := #TRO380.arOutSwitch[1];
	            "MB4411" := #TRO380.arOutSwitch[2];
	            "MB4412" := #TRO380.arOutSwitch[3];
	            "MB4413" := #TRO380.arOutSwitch[4];
	            "MB4414" := #TRO380.arOutSwitch[5];
	            "MB4415" := #TRO380.arOutSwitch[6];
	            "MB4416" := #TRO380.arOutSwitch[7];
	            "MB4417" := #TRO380.arOutSwitch[8];
	            "MB4420" := #TRO380.arOutSwitch[9];
	            "MB4421" := #TRO380.arOutSwitch[10];
	            "MB4422" := #TRO380.arOutSwitch[11];
	            "MB4423" := #TRO380.arOutSwitch[12];
	            "MB4424" := #TRO380.arOutSwitch[13];
	            "MB4425" := #TRO380.arOutSwitch[14];
	            "MB4426" := #TRO380.arOutSwitch[15];
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 15 DO
	                IF #TRO380.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO380.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest23400" + #nIdxUnloading,
	                                      nReasonCode := '1',
	                                      FIFO := "DB_LGF_FIFO_CommWES_ASRS",
	                                      BUFFER := "DB_Buffer_CommunicationWES_ASRS".BUFFER,
	                                      nInOutSequenceNumber:="DB_CommunicationParameters".nSeqNumWESASRS);
	                END_IF;
	            END_FOR;
	        END_REGION
	        
	    END_REGION
	END_REGION
	
	REGION TROs
	    
	    REGION TRO 300 (Vario)
	        
	        #TRO300.stInSeparator1.Settings.nSeparatorNo := "cSep300.1";
	        #TRO300.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO300.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO300.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO300.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO300.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO300.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO300.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO300.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4624"];
	        
	        #TRO300.stInSeparator1.Settings.tSenFree := T#2000ms;
	        #TRO300.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO300.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4623"]; //Pusher Dog in Pos
	        #TRO300.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4625"];
	        #TRO300.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4621"]; // Conveyor full
	        #TRO300.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4622"]; // Jam detector
	        
	        #TRO300.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO300.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO300.stInVario.Settings.tConvEmpty := T#75000ms;
	        #TRO300.stInVario.Settings.nCountCarrier := 1;
	        #TRO300.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO300.stInVario.Settings.tCarrierInPosDelay := t#1200ms;
	        
	        #TRO300.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO300.stInSettings.xIsBorner := TRUE;
	        #TRO300(nInMainTroNo := "cMainTro300",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1 AND "fbPreMain_DB".fbMonFPG_Open.xOutOk AND "fbPreMain_DB".fbMonFPG_Fault.xOutOk,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0090",
	                xInRelease := "DB_TRO_Test".TRO300,
	                arInOutJamEntr := "DB_JamArea4102".stJam4102_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea4102".stJam4102_1.stData,
	                arInOutJamFinger := "DB_JamArea4101".stJam4101_1.arCarrier,
	                stInOutJamFinger := "DB_JamArea4101".stJam4101_1.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO300,
	                xOutStopper => "MB4624",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro300"],
	                xOutVarioMotor => "MA0090");
	        
	   //     "MA0090" := FALSE; //BST zu
	        
	        
	    END_REGION
	    
	    REGION TRO 301(1Sep)
	        #TRO301.stInSeparator1.Settings.nSeparatorNo := "cSep301.1";
	        #TRO301.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO301.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO301.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO301.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO301.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO301.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4620"];
	        
	        #TRO301.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO301(nInMainTroNo := "cMainTro301",
	                xInSftyOk := "cTodoTRUE",
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                //  xInCarouselRun := #arInCarouselRun["cExitConv4102"],
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea4102".stJam4102_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea4102".stJam4102_2.stData,
	                arInOutJamExit2 := "DB_JamArea4101".stJam4101_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea4101".stJam4101_1.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO301,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro301"],
	                xOutStopper1 => "MB4620");
	        #arCarrierPlaceHolder[1] := #stEmptyCarrier;
	        
	    END_REGION
	    
	    REGION TRO 302 (Vario)
	        
	        #TRO302.stInSeparator1.Settings.nSeparatorNo := "cSep302.1";
	        #TRO302.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO302.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO302.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO302.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO302.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO302.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO302.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO302.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4566"];
	        
	        #TRO302.stInSeparator1.Settings.tSenFree := T#2000ms;
	        #TRO302.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO302.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4567"]; //Pusher Dog in Pos
	        #TRO302.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4570"];
	        #TRO302.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4565"]; // Conveyor full
	        #TRO302.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4564"]; // Jam detector
	        
	        #TRO302.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO302.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO302.stInVario.Settings.tConvEmpty := T#10000ms;
	        #TRO302.stInVario.Settings.nCountCarrier := 1;
	        #TRO302.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO302.stInVario.Settings.tCarrierInPosDelay := t#1200ms;
	        
	        #TRO302.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO302(nInMainTroNo := "cMainTro302",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0074",
	                xInRelease := "DB_TRO_Test".TRO302,
	                arInOutJamEntr := "DB_JamArea4101".stJam4101_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea4101".stJam4101_1.stData,
	                arInOutJamFinger := "DB_JamArea4101".stJam4101_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea4101".stJam4101_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO302,
	                xOutStopper => "MB4566",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro302"],
	                xOutVarioMotor => "MA0074");
	        
	    END_REGION
	    
	    REGION TRO 303 (Vario)
	        
	        #TRO303.stInSeparator1.Settings.nSeparatorNo := "cSep303.1";
	        #TRO303.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO303.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO303.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO303.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO303.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO303.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO303.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO303.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4633"];
	        
	        #TRO303.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO303.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO303.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4634"]; //Pusher Dog in Pos
	        #TRO303.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4635"];
	        #TRO303.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4632"]; // Conveyor full
	        #TRO303.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4631"]; // Jam detector
	        
	        #TRO303.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO303.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO303.stInVario.Settings.tConvEmpty := T#75000ms;
	        #TRO303.stInVario.Settings.nCountCarrier := 1;
	        #TRO303.stInVario.Settings.tWaitForStop := T#3s;
	        #TRO303.stInVario.Settings.tRasterHigh := T#8000ms;
	        #TRO303.stInVario.Settings.tRasterLow := T#8000ms;
	        
	        #TRO303.stInVario.Settings.tCarrierInPosDelay := T#1200ms;
	        
	        #TRO303.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO303.stInSettings.xIsBorner := TRUE;
	        #TRO303(nInMainTroNo := "cMainTro303",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1 AND "fbPreMain_DB".fbMonFPG_Open.xOutOk AND "fbPreMain_DB".fbMonFPG_Fault.xOutOk,
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "DB_Interface_HMI".stTRO.TRO303.UDT_Ctrl.xErrorQuit,
	                xInMotorProtection := "FC0091",
	                xInRelease := "DB_TRO_Test".TRO303,
	                arInOutJamEntr := "DB_JamArea4202".stJam4202_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea4202".stJam4202_1.stData,
	                arInOutJamFinger := "DB_JamArea4201".stJam4201_1.arCarrier,
	                stInOutJamFinger := "DB_JamArea4201".stJam4201_1.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO303,
	                xOutStopper => "MB4633",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro303"],
	                xOutVarioMotor => "MA0091");
	        
	    //    "MA0091" := FALSE; //BST zu
	        
	    END_REGION
	    
	    REGION TRO 304(1Sep)
	        
	        #TRO304.stInSeparator1.Settings.nSeparatorNo := "cSep304.1";
	        #TRO304.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO304.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO304.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO304.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO304.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO304.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4630"];
	        
	        #TRO304.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO304(nInMainTroNo := "cMainTro304",
	                xInSftyOk := "cTodoTRUE",
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInCarouselRun := #fbExitConv2104.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea4202".stJam4202_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea4202".stJam4202_2.stData,
	                arInOutJamExit2 := "DB_JamArea4201".stJam4201_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea4201".stJam4201_1.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO304,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro304"],
	                xOutStopper1 => "MB4630");
	        #arCarrierPlaceHolder[1] := #stEmptyCarrier;
	        
	    END_REGION
	    
	    REGION TRO 305 (Vario)
	        
	        #TRO305.stInSeparator1.Settings.nSeparatorNo := "cSep305.1";
	        #TRO305.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO305.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO305.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO305.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO305.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO305.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO305.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO305.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4572"];
	        
	        #TRO305.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO305.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO305.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4573"]; //Pusher Dog in Pos
	        #TRO305.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4571"];
	        #TRO305.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4574"]; // Conveyor full
	        #TRO305.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4563"]; // Jam detector
	        
	        #TRO305.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO305.stInVario.Settings.tWaitForJog := T#200ms;
	        #TRO305.stInVario.Settings.tConvEmpty := T#10000ms;
	        #TRO305.stInVario.Settings.nCountCarrier := 1;
	        #TRO305.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO305.stInVario.Settings.tCarrierInPosDelay := T#1200ms;
	        
	        #TRO305.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO305(nInMainTroNo := "cMainTro305",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0075",
	                xInRelease := "DB_TRO_Test".TRO305,
	                arInOutJamEntr := "DB_JamArea4201".stJam4201_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea4201".stJam4201_1.stData,
	                arInOutJamFinger := "DB_JamArea4201".stJam4201_2.arCarrier,//Todo
	                stInOutJamFinger := "DB_JamArea4201".stJam4201_2.stData, //Todo
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO305,
	                xOutStopper => "MB4572",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro305"],
	                xOutVarioMotor => "MA0075");
	        
	    END_REGION
	    
	    REGION TRO 306 (Vario)
	        
	        #TRO306.stInSeparator1.Settings.nSeparatorNo := "cSep306.1";
	        #TRO306.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO306.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO306.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO306.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO306.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO306.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO306.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO306.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4640"];
	        
	        #TRO306.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO306.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO306.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4642"]; //Pusher Dog in Pos
	        #TRO306.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4641"]; // MT in Pos
	        #TRO306.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4644"]; // Conveyor full
	        #TRO306.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4643"]; // Jam detector
	        
	        #TRO306.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO306.stInVario.Settings.tWaitForJog := T#50ms;
	        #TRO306.stInVario.Settings.tConvEmpty := T#90s;
	        #TRO306.stInVario.Settings.nCountCarrier := 1;
	        #TRO306.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO306.stInVario.Settings.tCarrierInPosDelay := t#1200ms;
	        #TRO306.stInVario.Settings.tCarrierInPosEdgeDelay := t#100ms;
	        #TRO306.stInVario.Settings.tTimeOutCarrierInPos := t#10s;
	        
	        #TRO306.stInVario.Settings.xJamSenDelayActive := TRUE; // Sehr langes Gefälle nach Vario, Staureaktion muss nicht "schnell" sein
	        #TRO306.stInVario.Settings.tJamSenDelay := T#2s; //Zeit wie lange Stausensor belegt sein muss, damit Vario sofort anhält
	        #TRO306.stInVario.Settings.tRasterHigh := T#2500ms;
	        #TRO306.stInVario.Settings.tRasterLow := T#2500ms;
	        #TRO306.stInVario.Settings.xLongSlope := TRUE;
	        
	        #TRO306.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO306.stInSettings.xIsBorner := TRUE;
	        
	        #stJamDataHandoverJam4301.Config.nCapacitySet := 1; 
	        
	        #TRO306(nInMainTroNo := "cMainTro306",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1 AND "fbPreMain_DB".fbMonFPG_Open.xOutOk AND "fbPreMain_DB".fbMonFPG_Fault.xOutOk,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0092",
	                xInRelease := "DB_TRO_Test".TRO306,
	                arInOutJamEntr := "DB_JamArea4301".stJam4301_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea4301".stJam4301_1.stData,
	                arInOutJamFinger := #arCarrierHandoverJam4301,
	                stInOutJamFinger := #stJamDataHandoverJam4301,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO306,
	                xOutStopper => "IO_Device_UH03_TO_UH01".xJAM_3,////"MB4640",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro306"],
	                xOutVarioMotor => "MA0092");
	        
	        REGION UH02 <-> UH03
	            // #rTrig_TRO271_TRO306(CLK:="IO_Device_UH02_FROM_UH01".bCARRIER_CONTROL.%X3);
	            
	            // //Carrier kommt von UH02
	            // //Ready an UH02 melden
	            // "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL.%X3 := "DB_JamArea4301".stJam4301_1.stData.Status.nCount <= 2;// 0 AND (NOT "DB_Inputs".Sensors["cInBG4640"].xDbncdSensor);
	            
	            // IF #rTrig_TRO271_TRO306.Q THEN //Release von UH02 zu UH03, nur Flanke
	            //     "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL.%X4 := TRUE; //Busy von UH03 zu UH02
	            // END_IF;
	            
	            // IF "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL.%X4 AND #TRO306.nState = 2600 AND #TRO306.fbSeparator1.xOutTrolleyReleasedEdge  THEN
	            //     "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL.%X4 := FALSE; //Carrier verarbeitet, Busy zurücksetzen
	            // END_IF;
	            
	        END_REGION
	        
	        
	    END_REGION
	    
	    REGION TRO 307 (Vario)
	        
	        #TRO307.stInSeparator1.Settings.nSeparatorNo := "cSep307.1";
	        #TRO307.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO307.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO307.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO307.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO307.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO307.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO307.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO307.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4650"]; // IO-Device Eingang
	        
	        #TRO307.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO307.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO307.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4652"]; //Pusher Dog in Pos
	        #TRO307.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4651"]; // MT in Pos
	        #TRO307.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4654"]; // Conveyor full
	        #TRO307.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4653"]; // Jam detector
	        
	        #TRO307.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO307.stInVario.Settings.tWaitForJog := T#200ms;
	        #TRO307.stInVario.Settings.tConvEmpty := T#90s;
	        #TRO307.stInVario.Settings.nCountCarrier := 1;
	        #TRO307.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO307.stInVario.Settings.xJamSenDelayActive := TRUE; // Sehr langes Gefälle nach Vario, Staureaktion muss nicht "schnell" sein
	        #TRO307.stInVario.Settings.tJamSenDelay := T#3s; //Zeit wie lange Stausensor belegt sein muss, damit Vario sofort anhält
	        
	        #TRO307.stInVario.Settings.tCarrierInPosDelay := t#1200ms;
	        #TRO307.stInVario.Settings.tCarrierInPosEdgeDelay := t#100ms;
	        #TRO307.stInVario.Settings.tTimeOutCarrierInPos := t#10s;
	        
	        #TRO307.stInVario.Settings.xLongSlope := TRUE;
	        
	        #stJamDataHandoverJam4401.Config.nCapacitySet := 1; //
	        
	        #TRO307.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        #TRO307.stInSettings.xIsBorner := TRUE;
	        
	        #TRO307(nInMainTroNo := "cMainTro307",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1 AND "fbPreMain_DB".fbMonFPG_Open.xOutOk AND "fbPreMain_DB".fbMonFPG_Fault.xOutOk,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0093",
	                xInRelease := "DB_TRO_Test".TRO307,
	                arInOutJamEntr := "DB_JamArea4401".stJam4401_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea4401".stJam4401_1.stData,
	                arInOutJamFinger := #arCarrierHandoverJam4401,
	                stInOutJamFinger := #stJamDataHandoverJam4401,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO307,
	                xOutStopper => "IO_Device_UH03_TO_UH01".xJAM_2,//"MB4650", //
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro307"],
	                xOutVarioMotor => "MA0093");
	        
	        REGION UH02 <-> UH03
	            // #rTrig_TRO273_TRO307(CLK := "IO_Device_UH02_FROM_UH01".bCARRIER_CONTROL.%X4);
	            
	            // //Carrier kommt von UH02
	            // //Ready an UH02 melden
	            // "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL.%X5 := "DB_JamArea4401".stJam4401_1.stData.Status.nCount < 2; //=  0 AND (NOT "DB_Inputs".Sensors["cInBG4650"].xDbncdSensor);
	            
	            // IF #rTrig_TRO273_TRO307.Q THEN //Release von UH02 zu UH03
	            //     "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL.%X6 := TRUE; //Busy von UH03 zu UH02
	            // END_IF;
	            
	            // IF "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL.%X6 AND "DB_JamArea4401".stJam4401_1.stData.Status.nCount > 0 THEN
	            //     "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL.%X6 := FALSE; //Carrier verarbeitet, Busy zurücksetzen
	            // END_IF;
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 308 (Vario)
	        
	        #TRO308.stInSeparator1.Settings.nSeparatorNo := "cSep308.1";
	        #TRO308.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO308.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO308.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO308.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO308.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO308.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO308.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO308.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4450"];
	        
	        #TRO308.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO308.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO308.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4451"]; //Pusher Dog in Pos
	        #TRO308.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4452"];
	        #TRO308.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4442"]; // Conveyor full
	        #TRO308.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4441"]; // Jam detector
	        
	        #TRO308.stInVario.Settings.tCarrierInPosDelay := t#1200ms;
	        #TRO308.stInVario.Settings.tCarrierInPosEdgeDelay := t#100ms;
	        
	        #TRO308.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO308.stInVario.Settings.tWaitForJog := T#200ms;
	        #TRO308.stInVario.Settings.tConvEmpty := T#60000ms;
	        #TRO308.stInVario.Settings.nCountCarrier := 1;
	        #TRO308.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO308.stInVario.Settings.xJamSenDelayActive := TRUE; // Sehr langes Gefälle nach Vario, Staureaktion muss nicht "schnell" sein
	        #TRO308.stInVario.Settings.tJamSenDelay := T#750ms; //T#1s  Zeit wie lange Stausensor belegt sein muss, damit Vario sofort anhält
	        
	        #TRO308.stInVario.Settings.xLongSlope := TRUE;
	        
	        #TRO308.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO308.stInSettings.xIsBorner := TRUE;
	        
	        #TRO308(nInMainTroNo := "cMainTro308",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0073",
	                xInRelease := "DB_TRO_Test".TRO308,
	                arInOutJamEntr := "DB_JamArea2111".stJam2111_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2111".stJam2111_1.stData,
	                arInOutJamFinger := "DB_JamArea2111".stJam2111_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2111".stJam2111_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO308,
	                xOutStopper => "MB4450",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro308"],
	                xOutVarioMotor => "MA0073");
	        
	    END_REGION
	    
	    REGION TRO 309 (1Sep)
	        
	        #TRO309.stInSeparator1.Settings.nSeparatorNo := "cSep309.1";
	        #TRO309.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO309.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO309.stInSeparator1.Settings.tTrailingTime := t#500ms;
	        #TRO309.stInSeparator1.Settings.tHandlingTime := t#200ms;
	        #TRO309.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO309.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO309.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO309.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4440"];
	        #TRO309.stInSenJam2 := "DB_Inputs".Sensors["cInBG4443"];
	        
	        #TRO309.stInSeparator1.Settings.tSenFree := T#1000ms;
	        #TRO309.stInSeparator1.Settings.tSenWait := T#4000ms;
	        
	        #TRO309.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO309(nInMainTroNo := "cMainTro309",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO309,
	                xInCarouselRun := #fbCarousel2110.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2111".stJam2111_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2111".stJam2111_2.stData,
	                arInOutJamExit2 := "DB_JamArea2110".stJam2110_5.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2110".stJam2110_5.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro309"],
	                xOutStopper1 => "MB4440",
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO309);
	        
	    END_REGION
	    
	    REGION TRO 386 (1Sep) - kam später dazu
	        
	        #TRO386.stInSeparator1.Settings.nSeparatorNo := "cSep386.1";
	        #TRO386.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO386.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO386.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO386.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO386.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO386.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO386.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO386.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4576"];
	        
	        #TRO386.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO386.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO386.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO386(nInMainTroNo := "cMainTro386",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO386,
	                xInCarouselRun := #fbCarousel2110.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2110".stJam2110_5.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea2110".stJam2110_5.stData,
	                arInOutJamExit2 := "DB_JamArea2110".stJam2110_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2110".stJam2110_1.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro386"],
	                xOutStopper1 => "MB4576",
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO386);
	        
	    END_REGION
	    
	    REGION TRO 310 (1Sep)+Scanner (BX3102)        
	        #TRO310.stInSeparator1.Settings.nSeparatorNo := "cSep310.1";
	        #TRO310.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO310.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO310.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO310.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO310.stInSeparator1.Settings.xPluggedJam := TRUE;
	        
	        #TRO310.stInSeparator1.Settings.xPluggedPart := TRUE;
	     //   #TRO310.stInSettings.bSepType.%X0 := TRUE;
	        #TRO310.stInSettings.bSepType.%X2 := TRUE;
	        #TRO310.stInSettings.tPartSenHigh := T#500ms;
	        #TRO310.stInSettings.tInSenHigh := T#500ms;
	        
	        #TRO310.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO310.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4560"];
	        #TRO310.stInSenJam2 := "DB_Inputs".Sensors["cInBG4577"]; // würde nur bis BG4577 stauen (BG4561, BG4576)
	        #TRO310.stInSeparator1.stSenPart := "DB_Inputs".Sensors["cInBG4561"];
	        
	        #TRO310.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO310.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3102"].xInCamTriggerReady := "bx3102-TriggerReady";
	        #arCognexInterface["cScannerBX3102"].xInCamTriggerAck := "bx3102-TriggerAck";
	        #arCognexInterface["cScannerBX3102"].xInCamResultsAvailable := "bx3102-Results Available";
	        #arCognexInterface["cScannerBX3102"].xInCamGeneralFault := "bx3102-General Fault";
	        #arCognexInterface["cScannerBX3102"].hwInCamInspectionResults := "=A01+UH03-BX3102~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO310(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO310.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO310.TroOut,
	                nInMainTroNo := "cMainTro310",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO310, //AND NOT "DB_HandshakeStorage".str_StorageManagement.udt_HandshakeMESStorage.str_Ctrl.xNewDataAvaible,
	                xInCarouselRun := #fbCarousel2110.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3102"],
	                arInOutJamEntr1 := "DB_JamArea2110".stJam2110_1.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2110".stJam2110_1.stData,
	                arInOutJamExit2 := "DB_JamArea2110".stJam2110_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2110".stJam2110_2.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO310,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro310"],
	                xOutStopper1 => "MB4560");
	        
	        "bx3102-TriggerEnable" := #arCognexInterface["cScannerBX3102"].xOutCamTriggerEnable;
	        "bx3102-Trigger" := #arCognexInterface["cScannerBX3102"].xOutCamTrigger;
	        "bx3102-ResultsAck" := #arCognexInterface["cScannerBX3102"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO310.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO310.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2110".stJam2110_1.arCarrier[1]);
	        END_REGION
	        
	        REGION Clear MES Buffer IBN
	            IF "IBN".xDeleteMESBufferStorageManagement THEN
	                FOR #nIdx := 0 TO 100 DO
	                    "DB_Prozessdaten".stStorageManagement.CarrierBuffer[#nIdx] := "IBN".stEmptyTeleGOHDReqM;
	                END_FOR;
	            END_IF;
	            "IBN".xDeleteMESBufferStorageManagement := FALSE;
	        END_REGION
	        
	        REGION Provisorium - Zielvorgabe
	          //  IF #TRO310.xOutNewScan THEN
	            IF #TRO310.nState = 1500 AND #TRO310.fbSeparator1.xOutTrolleyReleasedEdge AND "DB_JamArea2110".stJam2110_1.arCarrier[1].bStatus.%X0 AND "DB_JamArea2110".stJam2110_1.arCarrier[1].bStatus.%X1 THEN
	                "DB_HandshakeStorage".str_StorageManagement.str_TelegramMES.udtIn_DataMES.stPayload.nBarcode := #TRO310.nOutScanResult;
	                "DB_HandshakeStorage".str_StorageManagement.str_TelegramMES.udtIn_DataMES.stPayload.arActions[0] := 'lang';
	                "DB_HandshakeStorage".str_StorageManagement.str_TelegramMES.udtIn_DataMES.stPayload.arActions[1] := 'lang';
	               
	                "DB_HandshakeStorage".str_StorageManagement.udt_HandshakeMESStorage.str_Ctrl.xNewDataAvaible := TRUE;
	            END_IF;
	            
	            IF "DB_HandshakeStorage".str_StorageManagement.udt_HandshakeMESStorage.str_Status.xNewDataSaved
	            THEN
	                "DB_HandshakeStorage".str_StorageManagement.udt_HandshakeMESStorage.str_Ctrl.xNewDataAvaible := FALSE;
	            END_IF;
	                
	            END_REGION;
	        
	
	        
	    END_REGION
	    
	    REGION TRO 311 (1Sep)+Scanner(BX3101)
	        #TRO311.stInSeparator1.Settings.nSeparatorNo := "cSep311.1";
	        #TRO311.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO311.stInSeparator1.Settings.tTrailingTime := T#400ms;
	        #TRO311.stInSeparator1.Settings.tHandlingTime := t#200ms;
	        #TRO311.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO311.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO311.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO311.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO311.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4562"];
	        #TRO311.stInSenJam2 := "DB_Inputs".Sensors["cInBG4577"]; //würde nur diesen Stausensor betrachten
	        
	        #TRO311.stInSeparator1.Settings.tSenFree := t#2s;
	        #TRO311.stInSeparator1.Settings.tSenWait := t#4s;
	        
	        #TRO311.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO311.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3101"].xInCamTriggerReady := "bx3101-TriggerReady";
	        #arCognexInterface["cScannerBX3101"].xInCamTriggerAck := "bx3101-TriggerAck";
	        #arCognexInterface["cScannerBX3101"].xInCamResultsAvailable := "bx3101-Results Available";
	        #arCognexInterface["cScannerBX3101"].xInCamGeneralFault := "bx3101-General Fault";
	        #arCognexInterface["cScannerBX3101"].hwInCamInspectionResults := "=A01+UH03-BX3101~Ergebnisse_–_64_Bytes_1";
	        
	        "DB_JamArea4101".stJam4101_2.arCarrier[1].bStatus.%X1 := TRUE;
	
	        #TRO311(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO311.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO311.TroOut,
	                nInMainTroNo := "cMainTro311",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO311,
	                xInCarouselRun := #fbCarousel2110.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3101"],
	                arInOutJamEntr1 := "DB_JamArea4101".stJam4101_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea4101".stJam4101_2.stData,
	                arInOutJamExit2 := "DB_JamArea2110".stJam2110_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2110".stJam2110_2.stData,
	                xOutStopper1 => "MB4562",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro311"],
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO311);
	        
	        "bx3101-TriggerEnable" := #arCognexInterface["cScannerBX3101"].xOutCamTriggerEnable;
	        "bx3101-Trigger" := #arCognexInterface["cScannerBX3101"].xOutCamTrigger;
	        "bx3101-ResultsAck" := #arCognexInterface["cScannerBX3101"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO311.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO311.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea4101".stJam4101_2.arCarrier[1]);
	        END_REGION
	        
	        REGION Provisorium - Zielvorgabe
	         //   IF #TRO311.xOutNewScan THEN
	                
	                REGION DecisionRequest to Fortna WCS
	                    // Wenn SSCC Read abgeschlossen, dann Telegram mit spezifizierten Daten generieren und in TCP Sende-FIFO schieben
	                    
	                    IF #TRO311.xOutNewScan THEN
	                        "FC_Send_GOHDReqM"(sInPLCID := "cPLCID",
	                                           xInSSCCReq := FALSE,
	                                           xInLengthReq := FALSE,
	                                           xInDockDoorReq := FALSE,
	                                           xInLaneStatusReq := FALSE,
	                                           nInBarcode := "DB_JamArea4101".stJam4101_2.arCarrier[1].nBarcode,
	                                           sInSSCC := '',//#TRO110.fbBarcodeReaderSSCC.sOutBarcode,//DELETE(IN := LINT_TO_STRING(#TRO110.nOutScanResultSSCC), L := 1, P := 1),
	                                           sInDecisionPoint := 'GOH.Rec.02',//"cDP_DOCK_02",
	                                           sInDockDoor := '',
	                                           sInLengthInfo := '',
	                                           arInLaneStatus := #tmpPlaceHolderLaneStatus,
	                                           nInLaneCnt := 0,
	                                           FIFO := "DB_LGF_FIFO_CommWCSBL",
	                                           BUFFER := "DB_Buffer_CommunicationWCSBL".BUFFER,
	                                           nInOutSequenceNumber := "DB_CommunicationParameters".nSeqNumWCSBL);
	                    END_IF;
	                    
	                END_REGION
	           (*     "DB_HandshakeStorage".str_StorageManagement.str_TelegramMES.udtIn_DataMES.stPayload.nBarcode := #TRO311.nOutScanResult;
	                "DB_HandshakeStorage".str_StorageManagement.str_TelegramMES.udtIn_DataMES.stPayload.arActions[0] := 'lang';
	                "DB_HandshakeStorage".str_StorageManagement.str_TelegramMES.udtIn_DataMES.stPayload.arActions[1] := 'lang';
	                
	                "DB_HandshakeStorage".str_StorageManagement.udt_HandshakeMESStorage.str_Ctrl.xNewDataAvaible := TRUE;
	            END_IF;
	            
	            IF "DB_HandshakeStorage".str_StorageManagement.udt_HandshakeMESStorage.str_Status.xNewDataSaved
	            THEN
	                "DB_HandshakeStorage".str_StorageManagement.udt_HandshakeMESStorage.str_Ctrl.xNewDataAvaible := FALSE;
	            END_IF; *)
	            
	        END_REGION ;
	        
	    END_REGION
	    
	    REGION TRO 312 (1Sep)+Scanner(BX3100)
	        
	        #TRO312.stInSeparator1.Settings.nSeparatorNo := "cSep312.1";
	        #TRO312.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO312.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO312.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO312.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO312.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO312.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO312.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO312.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4575"];
	        #TRO312.stInSenJam2 := "DB_Inputs".Sensors["cInBG4577"];
	        
	        #TRO312.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO312.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3100"].xInCamTriggerReady := "bx3100-TriggerReady";
	        #arCognexInterface["cScannerBX3100"].xInCamTriggerAck := "bx3100-TriggerAck";
	        #arCognexInterface["cScannerBX3100"].xInCamResultsAvailable := "bx3100-Results Available";
	        #arCognexInterface["cScannerBX3100"].xInCamGeneralFault := "bx3100-General Fault";
	        #arCognexInterface["cScannerBX3100"].hwInCamInspectionResults := "=A01+UH03-BX3100~Ergebnisse_–_64_Bytes_1";
	        
	        "DB_JamArea4201".stJam4201_2.arCarrier[1].bStatus.%X1 := FALSE;
	        
	        #TRO312.stInSeparator1.Settings.tSenFree := t#2s;
	        #TRO312.stInSeparator1.Settings.tSenWait := t#4s;
	        
	        #TRO312(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO312.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO312.TroOut,
	                nInMainTroNo := "cMainTro312",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO312,
	                xInCarouselRun := #fbCarousel2110.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3100"],
	                arInOutJamEntr1 := "DB_JamArea4201".stJam4201_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea4201".stJam4201_2.stData,
	                arInOutJamExit2 := "DB_JamArea2110".stJam2110_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2110".stJam2110_2.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro312"],
	                xOutStopper1 => "MB4575",
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO312);
	        
	        "bx3100-TriggerEnable" := #arCognexInterface["cScannerBX3100"].xOutCamTriggerEnable;
	        "bx3100-Trigger" := #arCognexInterface["cScannerBX3100"].xOutCamTrigger;
	        "bx3100-ResultsAck" := #arCognexInterface["cScannerBX3100"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO312.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO312.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea4201".stJam4201_2.arCarrier[1]);
	        END_REGION
	        
	    END_REGION
	    
	    REGION Priority Manager TRO 310/311/312
	        //TODO!!!
	 (*       #stPrioTro413.TroOut.nTroId := "cMainTro413";
	        #stPrioTro413.TroOut.xTransportReq := #TRO413.fbSeparator1.stOutMainTro.xBtPresent;
	        #stPrioTro413.TroOut.stJamExit := "DB_JamArea4003".stJam4003_6.stData;
	        
	        #stPrioTro415.TroOut.nTroId := "cMainTro415";
	        #stPrioTro415.TroOut.xTransportReq := #TRO415.fbSeparator1.stOutMainTro.xBtPresent;
	        #stPrioTro415.TroOut.stJamExit := "DB_JamArea4003".stJam4003_6.stData;
	        
	        #stPrioParam_TRO413_TRO415.nPrioMode := 1;
	        #fbPrioManager_TRO413_TRO415(xInQuit := "cTodoFalse",
	                                     xInClearJam := FALSE,
	                                     tIn_ReleaseTime := T#10s,
	                                     udtIn_Source1Req := #stPrioTro413.TroOut,
	                                     udtIn_Source2Req := #stPrioTro415.TroOut,
	                                     udt_PrioParameter := #stPrioParam_TRO413_TRO415); *)
	        
	    END_REGION
	    
	    
	    REGION TRO 313 (1Sep1Switch)+Scanner(BX3103)
	        
	        #TRO313.stInSeparator1.Settings.nSeparatorNo := "cSep313.1";
	        #TRO313.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Long";
	        #TRO313.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO313.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO313.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO313.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO313.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO313.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4503"];
	        #TRO313.stInSenJam2 := "DB_Inputs".Sensors["cInBG4507"];
	        #TRO313.stInSenJam3 := "DB_Inputs".Sensors["cInBG4504"];
	        
	        #TRO313.stInSwitch1.Settings.nSwitchNo := "cSwi313.1";
	        #TRO313.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO313.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO313.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO313.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO313.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO313.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3103"].xInCamTriggerReady := "bx3103-TriggerReady";
	        #arCognexInterface["cScannerBX3103"].xInCamTriggerAck := "bx3103-TriggerAck";
	        #arCognexInterface["cScannerBX3103"].xInCamResultsAvailable := "bx3103-Results Available";
	        #arCognexInterface["cScannerBX3103"].xInCamGeneralFault := "bx3103-General Fault";
	        #arCognexInterface["cScannerBX3103"].hwInCamInspectionResults := "=A01+UH03-BX3103~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO313.stInSettings.xCar2NecLeft := TRUE;
	        #TRO313.stInSettings.xCar2NecRight := TRUE;
	        #TRO313.stInSettings.xPrioDir1 := FALSE;
	        #TRO313.stInSettings.xPrioDir2 := FALSE;
	        
	        #TRO313(nInMainTroNo := "cMainTro313",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO313,
	                xInCarouselRun1 := #fbCarousel2110.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbCarousel2112.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO313,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3103"],
	                arInOutJamEntr1 := "DB_JamArea2110".stJam2110_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2110".stJam2110_2.stData,
	                arInOutJamExit2 := "DB_JamArea2112".stJam2112_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2112".stJam2112_1.stData,
	                arInOutJamExit3 := "DB_JamArea2110".stJam2110_3.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2110".stJam2110_3.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro313"],
	                xOutStopper1 => "MB4503",
	                xOutSw1ExTo3 => "MB4505");
	        
	        "bx3103-TriggerEnable" := #arCognexInterface["cScannerBX3103"].xOutCamTriggerEnable;
	        "bx3103-Trigger" := #arCognexInterface["cScannerBX3103"].xOutCamTrigger;
	        "bx3103-ResultsAck" := #arCognexInterface["cScannerBX3103"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO313.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO313.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2110".stJam2110_2.arCarrier[1]);
	        END_REGION
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi313.1",
	                           nOutDirection => #TRO313.nInDirection,
	                           InOutCarrier := "DB_JamArea2110".stJam2110_2.arCarrier[1]);
	            
	        END_REGION
	        
	        REGION Send DUM to Fortna WCS
	            IF #TRO313.xOutBookedDir1 AND "FB_CommunicationWCSBL_DB".fbTeleHandler.xOutConnectionActive THEN
	                "FC_Send_GOHDUM"(sInPLCID := "cPLCID",
	                                 nInBarcode := #TRO313.stOutLastCarrier.nBarcode,
	                                 sInDecisionPoint := "cDP_REC_02",
	                                 sInActionTaken := '1',
	                                 nReasonCode := 1,
	                                 FIFO := "DB_LGF_FIFO_CommWCSBL",
	                                 BUFFER := "DB_Buffer_CommunicationWCSBL".BUFFER,
	                                 nInOutSequenceNumber := "DB_CommunicationParameters".nSeqNumWCSBL);
	            END_IF;
	            
	            IF #TRO313.xOutBookedDir2 AND "FB_CommunicationWCSBL_DB".fbTeleHandler.xOutConnectionActive THEN
	                "FC_Send_GOHDUM"(sInPLCID := "cPLCID",
	                                 nInBarcode := #TRO313.stOutLastCarrier.nBarcode,
	                                 sInDecisionPoint := "cDP_REC_02",
	                                 sInActionTaken := '1',
	                                 nReasonCode := 1,
	                                 FIFO := "DB_LGF_FIFO_CommWCSBL",
	                                 BUFFER := "DB_Buffer_CommunicationWCSBL".BUFFER,
	                                 nInOutSequenceNumber := "DB_CommunicationParameters".nSeqNumWCSBL);
	            END_IF;
	            
	        END_REGION
	        
	        
	    END_REGION
	    
	    REGION TRO 314 (1Sep1Switch)+Scanner(BX3104)
	        
	        #TRO314.stInSeparator1.Settings.nSeparatorNo := "cSep314.1";
	        #TRO314.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO314.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO314.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO314.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO314.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO314.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO314.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4500"];
	        #TRO314.stInSenJam2 := "DB_Inputs".Sensors["cInBG3674"];
	        #TRO314.stInSenJam3 := "DB_Inputs".Sensors["cInBG3673"];
	        
	        #TRO314.stInSwitch1.Settings.nSwitchNo := "cSwi314.1";
	        #TRO314.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO314.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO314.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO314.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO314.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO314.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3104"].xInCamTriggerReady := "bx3104-TriggerReady";
	        #arCognexInterface["cScannerBX3104"].xInCamTriggerAck := "bx3104-TriggerAck";
	        #arCognexInterface["cScannerBX3104"].xInCamResultsAvailable := "bx3104-Results Available";
	        #arCognexInterface["cScannerBX3104"].xInCamGeneralFault := "bx3104-General Fault";
	        #arCognexInterface["cScannerBX3104"].hwInCamInspectionResults := "=A01+UH03-BX3104~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO314.stInSettings.xCar2NecLeft := TRUE;
	        #TRO314.stInSettings.xCar2NecRight := TRUE;
	        
	        #TRO314.stInPriorityManagerDir1.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        #TRO314.stInPriorityManagerDir2.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO314(nInMainTroNo := "cMainTro314",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO314,
	                xInCarouselRun1 := #fbCarousel2110.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbSortConv2202.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO314,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3104"],
	                arInOutJamEntr1 := "DB_JamArea2110".stJam2110_3.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea2110".stJam2110_3.stData,
	                arInOutJamExit2 := "DB_JamArea2202".stJam2202_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2202".stJam2202_1.stData,
	                arInOutJamExit3 := "DB_JamArea2110".stJam2110_4.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2110".stJam2110_4.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro314"],
	                xOutStopper1 => "MB4500",
	                xOutSw1ExTo3 => "MB3673");
	        
	        "bx3104-TriggerEnable" := #arCognexInterface["cScannerBX3104"].xOutCamTriggerEnable;
	        "bx3104-Trigger" := #arCognexInterface["cScannerBX3104"].xOutCamTrigger;
	        "bx3104-ResultsAck" := #arCognexInterface["cScannerBX3104"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO314.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO314.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2110".stJam2110_3.arCarrier[1]);
	        END_REGION
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi314.1",
	                           nOutDirection => #TRO314.nInDirection,
	                           InOutCarrier := "DB_JamArea2110".stJam2110_3.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 315 (1Sep)
	        #TRO315.stInSeparator1.Settings.nSeparatorNo := "cSep315.1";
	        #TRO315.stInSeparator1.Settings.tDelayToNextItem := T#30s;
	        #TRO315.stInSeparator1.Settings.xPluggedConfirm := FALSE;
	        #TRO315.stInSeparator1.Settings.xPluggedNullBT := FALSE;
	        #TRO315.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO315.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO315.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO315.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4444"];
	        #TRO315.stInSenJam2 := "DB_Inputs".Sensors["cInBG3194"];
	        
	        #TRO315.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO315(nInMainTroNo := "cMainTro315",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO315,//"cTodoFalse",
	                xInCarouselRun := #fbCarousel2110.xOutConveyorFullSpeed AND #fbSortConv2102.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2110".stJam2110_4.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea2110".stJam2110_4.stData,
	                arInOutJamExit2 := "DB_JamArea2102".stJam2102_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2102".stJam2102_1.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO315,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro315"],
	                xOutStopper1 => "MB4444");
	        
	    END_REGION
	    
	    REGION TRO 316 (1Sep)
	        
	        #TRO316.stInSeparator1.Settings.nSeparatorNo := "cSep316.1";
	        #TRO316.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Long";
	        #TRO316.stInSeparator1.Settings.xPluggedConfirm := FALSE;
	        #TRO316.stInSeparator1.Settings.xPluggedNullBT := FALSE;
	        #TRO316.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO316.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO316.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO316.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4395"];
	        #TRO316.stInSenJam2 := "DB_Inputs".Sensors["cInBG4392"];
	        
	        #TRO316.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO316(nInMainTroNo := "cMainTro316",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO316,//"cTodoFalse",
	                xInCarouselRun := #fbCarousel2112.xOutConveyorFullSpeed AND #fbSortConv2304.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2112".stJam2112_1.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea2112".stJam2112_1.stData,
	                arInOutJamExit2 := "DB_JamArea2304".stJam2304_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2304".stJam2304_1.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO316,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro316"],
	                xOutStopper1 => "MB4395");
	    END_REGION
	    
	    REGION TRO 317 (1Sep1Switch)+Scanner(BX3105)
	        #TRO317.stInSeparator1.Settings.nSeparatorNo := "cSep317.1";
	        #TRO317.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO317.stInSeparator1.Settings.xPluggedConfirm := FALSE;
	        #TRO317.stInSeparator1.Settings.xPluggedNullBT := FALSE;
	        #TRO317.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO317.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO317.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO317.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3134"];
	        #TRO317.stInSenJam2 := "DB_Inputs".Sensors["cInBG3136"];
	        #TRO317.stInSenJam3 := "DB_Inputs".Sensors["cInBG3135"];
	        
	        #TRO317.stInSwitch1.Settings.nSwitchNo := "cSwi317.1";
	        #TRO317.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO317.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO317.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO317.stInSwitch1.Settings.nTo1Destinations := 4; //Info nötig für HMI
	        
	        #TRO317.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO317.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3105"].xInCamTriggerReady := "bx3105-TriggerReady";
	        #arCognexInterface["cScannerBX3105"].xInCamTriggerAck := "bx3105-TriggerAck";
	        #arCognexInterface["cScannerBX3105"].xInCamResultsAvailable := "bx3105-Results Available";
	        #arCognexInterface["cScannerBX3105"].xInCamGeneralFault := "bx3105-General Fault";
	        #arCognexInterface["cScannerBX3105"].hwInCamInspectionResults := "=A01+UC031-BX3105~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO317.stInPriorityManagerDir1.xReleaseOk := TRUE;
	        #TRO317.stInPriorityManagerDir2.xReleaseOk := TRUE;
	        
	        #stJamDataHandoverJam1109.Config.nCapacitySet := 1; //
	        
	        #TRO317(nInMainTroNo := "cMainTro317",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO317 AND ("IO_Device_UH03_TO_UH01".stCarrierL2toL1[1].nBarcode = 0), //zwecks Übergabe warten bis UH02 Daten abgeholt hat,
	                xInCarouselRun1 := #fbSortConv2102.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbSortConv2102.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO317,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3105"],
	                arInOutJamEntr1 := "DB_JamArea2102".stJam2102_1.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2102".stJam2102_1.stData,
	                arInOutJamExit2 := "DB_JamArea2102".stJam2102_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2102".stJam2102_2.stData,
	                arInOutJamExit3 := "IO_Device_UH03_TO_UH01".stCarrierL2toL1, //#arCarrierHandoverJam1109,
	                stInOutJamExit3 := #stJamDataHandoverJam1109,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro317"],
	                xOutStopper1 => "MB3134",
	                xOutSw1ExTo4 => "MB3135");
	        
	        "bx3105-TriggerEnable" := #arCognexInterface["cScannerBX3105"].xOutCamTriggerEnable;
	        "bx3105-Trigger" := #arCognexInterface["cScannerBX3105"].xOutCamTrigger;
	        "bx3105-ResultsAck" := #arCognexInterface["cScannerBX3105"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO317.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO317.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2102".stJam2102_1.arCarrier[1]);
	        END_REGION
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi317.1",
	                           nOutDirection => #TRO317.nInDirection,
	                           InOutCarrier := "DB_JamArea2102".stJam2102_1.arCarrier[1]);
	            
	        END_REGION
	        
	        REGION Übergabe Level 1
	            //todo: sicherstellen das UH02 ready ist, ansonsten sollte UH03 warten... 
	            "FB_I-Device_SendCarrier_J1109"(xInTrigger := (#TRO317.nState = 2500) AND #TRO317.stActRequest.nDirection = 2 AND  #TRO317.fbSeparator1.xOutTrolleyReleasedEdge, //Trigger
	                                            xInAck := "IO_Device_UH02_FROM_UH01".bCARRIER_CONTROL_1.%X0, //von Empfänger
	                                            stInOutData := "IO_Device_UH03_TO_UH01".stCarrierL2toL1[1], //Daten
	                                            xOutReq := "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL_1.%X0); //an Empfänger
	        END_REGION
	        
	        
	    END_REGION
	    
	    REGION TRO 318 (1Sep1Switch) + Scanner(BX3106)
	        
	        // IF (#TRO318.nState = "1Se1SwStep_CheckReqFinished") AND "IBN".nTestBlockSelection = 21300 THEN
	        //     "IBN".nTestBlockSelection := 21200;
	        // ELSIF (#TRO318.nState = "1Se1SwStep_CheckReqFinished") AND "IBN".nTestBlockSelection = 21200 THEN
	        //     "IBN".nTestBlockSelection := 21300;
	        // END_IF;
	        
	        //   "DB_JamArea2102".stJam2102_2.arCarrier[1].nDestination := 21400;//"IBN".nTestBlockSelection;
	        
	        #TRO318.stInSeparator1.Settings.nSeparatorNo := "cSep318.1";
	        #TRO318.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO318.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO318.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO318.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO318.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO318.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO318.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3137"];
	        #TRO318.stInSenJam2 := "DB_Inputs".Sensors["cInBG3123"];
	        #TRO318.stInSenJam3 := "DB_Inputs".Sensors["cInBG3063"];
	        
	        #TRO318.stInSwitch1.Settings.nSwitchNo := "cSwi318.1";
	        #TRO318.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO318.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO318.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO318.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO318.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO318.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3106"].xInCamTriggerReady := "bx3106-TriggerReady";
	        #arCognexInterface["cScannerBX3106"].xInCamTriggerAck := "bx3106-TriggerAck";
	        #arCognexInterface["cScannerBX3106"].xInCamResultsAvailable := "bx3106-Results Available";
	        #arCognexInterface["cScannerBX3106"].xInCamGeneralFault := "bx3106-General Fault";
	        #arCognexInterface["cScannerBX3106"].hwInCamInspectionResults := "=A01+UC031-BX3106~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO318.stInSettings.xCar2NecRight := TRUE;
	        #TRO318.stInSettings.xCar2NecLeft := TRUE;
	        #TRO318.stInSettings.xPrioDir1 := TRUE;
	        #TRO318.stInSettings.xPrioDir2 := TRUE;
	        
	        #TRO318(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO318_3.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO318_3.TroOut,
	                stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO318_4.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO318_4.TroOut,
	                nInMainTroNo := "cMainTro318",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO318,
	                xInCarouselRun1 := #fbSortConv2102.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbSortConv2101.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO318,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3106"],
	                arInOutJamEntr1 := "DB_JamArea2102".stJam2102_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea2102".stJam2102_2.stData,
	                arInOutJamExit2 := "DB_JamArea2102".stJam2102_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2102".stJam2102_3.stData,
	                arInOutJamExit3 := "DB_JamArea2101".stJam2101_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2101".stJam2101_1.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro318"],
	                xOutStopper1 => "MB3137",
	                xOutSw1ExTo3 => "MB3061");
	        
	        "bx3106-TriggerEnable" := #arCognexInterface["cScannerBX3106"].xOutCamTriggerEnable;
	        "bx3106-Trigger" := #arCognexInterface["cScannerBX3106"].xOutCamTrigger;
	        "bx3106-ResultsAck" := #arCognexInterface["cScannerBX3106"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO318.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO318.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2102".stJam2102_2.arCarrier[1]);
	        END_REGION
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi318.1",
	                           nOutDirection => #TRO318.nInDirection,
	                           InOutCarrier := "DB_JamArea2102".stJam2102_2.arCarrier[1]);
	            
	        END_REGION
	        
	    //    "DB_JamArea2102".stJam2102_2.arCarrier[1].nDestination := 21100;
	        
	    END_REGION ;
	    
	    REGION TRO 319 (1Sep1Switch) + Scanner (BX3111)        
	        #TRO319.stInSeparator1.Settings.nSeparatorNo := "cSep319.1";
	        #TRO319.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO319.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO319.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO319.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO319.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO319.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO319.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3240"];
	        #TRO319.stInSenJam2 := "DB_Inputs".Sensors["cInBG3241"];
	        
	        #TRO319.stInSwitch1.Settings.nSwitchNo := "cSwi319.1";
	        #TRO319.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO319.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO319.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO319.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO319.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO319.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3111"].xInCamTriggerReady := "bx3111-TriggerReady";
	        #arCognexInterface["cScannerBX3111"].xInCamTriggerAck := "bx3111-TriggerAck";
	        #arCognexInterface["cScannerBX3111"].xInCamResultsAvailable := "bx3111-Results Available";
	        #arCognexInterface["cScannerBX3111"].xInCamGeneralFault := "bx3111-General Fault";
	        #arCognexInterface["cScannerBX3111"].hwInCamInspectionResults := "=A01+UH03-BX3111~Ergebnisse_–_64_Bytes_1";
	        
	      //  "DB_JamArea2103".stJam2103_1.arCarrier[1].nDestination := "cDestF2HLoaded";
	    
	        #TRO319.stInSettings.xCar2NecLeft := FALSE;
	        #TRO319.stInSettings.xCar2NecRight := FALSE;
	        #TRO319.stInSettings.xPrioDir1 := FALSE;
	        #TRO319.stInSettings.xPrioDir2 := TRUE;
	        
	        #TRO319(stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO319.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO319.TroOut,
	                nInMainTroNo := "cMainTro319",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO319,
	                xInCarouselRun1 := #fbExitConv2103.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv2103.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO319,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3111"],
	                arInOutJamEntr1 := "DB_JamArea2103".stJam2103_1.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2103".stJam2103_1.stData,
	                arInOutJamExit2 := "DB_JamArea2105".stJam2105_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2105".stJam2105_1.stData,
	                arInOutJamExit3 := "DB_JamArea2103".stJam2103_2.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2103".stJam2103_2.stData,
	                xOutStopper1 => "MB3240",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro319"],
	                xOutSw1ExTo3 => "MB3241");
	        
	        "bx3111-TriggerEnable" := #arCognexInterface["cScannerBX3111"].xOutCamTriggerEnable;
	        "bx3111-Trigger" := #arCognexInterface["cScannerBX3111"].xOutCamTrigger;
	        "bx3111-ResultsAck" := #arCognexInterface["cScannerBX3111"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO319.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO319.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2103".stJam2103_1.arCarrier[1]);
	        END_REGION
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi319.1",
	                           nOutDirection => #TRO319.nInDirection,
	                           InOutCarrier := "DB_JamArea2103".stJam2103_1.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 320 (1Sep1Switch) + Scanner(BX3112)
	        #TRO320.stInSeparator1.Settings.nSeparatorNo := "cSep320.1";
	        #TRO320.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO320.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO320.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO320.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO320.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO320.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO320.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3300"];
	        #TRO320.stInSenJam2 := "DB_Inputs".Sensors["cInBG3301"];
	        
	        #TRO320.stInSwitch1.Settings.nSwitchNo := "cSwi320.1";
	        #TRO320.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO320.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO320.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO320.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO320.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO320.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3112"].xInCamTriggerReady := "bx3112-TriggerReady";
	        #arCognexInterface["cScannerBX3112"].xInCamTriggerAck := "bx3112-TriggerAck";
	        #arCognexInterface["cScannerBX3112"].xInCamResultsAvailable := "bx3112-Results Available";
	        #arCognexInterface["cScannerBX3112"].xInCamGeneralFault := "bx3112-General Fault";
	        #arCognexInterface["cScannerBX3112"].hwInCamInspectionResults := "=A01+UH03-BX3112~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO320.stInSettings.xCar2NecLeft := FALSE;
	        #TRO320.stInSettings.xCar2NecRight := TRUE;
	        #TRO320.stInSettings.xPrioDir1 := FALSE;
	        #TRO320.stInSettings.xPrioDir2 := TRUE;
	        
	        //"DB_JamArea2103".stJam2103_2.arCarrier[1].nDestination := "cDestF2HLoaded";
	        
	        #TRO320(stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO320.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO320.TroOut,
	                nInMainTroNo := "cMainTro320",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO320,
	                xInCarouselRun1 := #fbExitConv2103.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv2104.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO320,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3112"],
	                arInOutJamEntr1 := "DB_JamArea2103".stJam2103_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2103".stJam2103_2.stData,
	                arInOutJamExit2 := "DB_JamArea2106".stJam2106_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2106".stJam2106_1.stData,
	                arInOutJamExit3 := "DB_JamArea2104".stJam2104_3.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2104".stJam2104_3.stData,
	                xOutStopper1 => "MB3300",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro320"],
	                xOutSw1ExTo3 => "MB3301");
	        
	        "bx3112-TriggerEnable" := #arCognexInterface["cScannerBX3112"].xOutCamTriggerEnable;
	        "bx3112-Trigger" := #arCognexInterface["cScannerBX3112"].xOutCamTrigger;
	        "bx3112-ResultsAck" := #arCognexInterface["cScannerBX3112"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO320.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO320.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2103".stJam2103_2.arCarrier[1]);
	        END_REGION
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi320.1",
	                           nOutDirection => #TRO320.nInDirection,
	                           InOutCarrier := "DB_JamArea2103".stJam2103_2.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 321 (1Sep1Switch) + Scanner(BX3114)
	        #TRO321.stInSeparator1.Settings.nSeparatorNo := "cSep321.1";
	        #TRO321.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO321.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO321.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO321.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO321.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO321.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO321.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3420"];
	        #TRO321.stInSenJam3 := "DB_Inputs".Sensors["cInBG3421"];
	        
	        #TRO321.stInSwitch1.Settings.nSwitchNo := "cSwi321.1";
	        #TRO321.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO321.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO321.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO321.stInSwitch1.Settings.nTo1Destinations := 4; //Info nötig für HMI
	        
	        #TRO321.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO321.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3114"].xInCamTriggerReady := "bx3114-TriggerReady";
	        #arCognexInterface["cScannerBX3114"].xInCamTriggerAck := "bx3114-TriggerAck";
	        #arCognexInterface["cScannerBX3114"].xInCamResultsAvailable := "bx3114-Results Available";
	        #arCognexInterface["cScannerBX3114"].xInCamGeneralFault := "bx3114-General Fault";
	        #arCognexInterface["cScannerBX3114"].hwInCamInspectionResults := "=A01+UH03-BX3114~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO321.stInSettings.xCar2NecLeft := FALSE;
	        #TRO321.stInSettings.xCar2NecRight := FALSE;
	        #TRO321.stInSettings.xPrioDir1 := TRUE;
	        #TRO321.stInSettings.xPrioDir2 := FALSE;
	        
	        #TRO321(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO321.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO321.TroOut,
	                nInMainTroNo := "cMainTro321",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO321,
	                xInCarouselRun1 := #fbExitConv2104.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv2104.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO321,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3114"],
	                arInOutJamEntr1 := "DB_JamArea2104".stJam2104_1.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2104".stJam2104_1.stData,
	                arInOutJamExit2 := "DB_JamArea2104".stJam2104_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2104".stJam2104_2.stData,
	                arInOutJamExit3 := "DB_JamArea2108".stJam2108_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2108".stJam2108_1.stData,
	                xOutStopper1 => "MB3420",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro321"],
	                xOutSw1ExTo4 => "MB3421");
	        
	        "bx3114-TriggerEnable" := #arCognexInterface["cScannerBX3114"].xOutCamTriggerEnable;
	        "bx3114-Trigger" := #arCognexInterface["cScannerBX3114"].xOutCamTrigger;
	        "bx3114-ResultsAck" := #arCognexInterface["cScannerBX3114"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO321.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO321.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2104".stJam2104_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi321.1",
	                           nOutDirection => #TRO321.nInDirection,
	                           InOutCarrier := "DB_JamArea2104".stJam2104_1.arCarrier[1]);
	            
	        END_REGION
	    END_REGION
	    
	    REGION TRO 322 (1Sep1Switch)+Scanner(BX3113)
	        #TRO322.stInSeparator1.Settings.nSeparatorNo := "cSep322.1";
	        #TRO322.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO322.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO322.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO322.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO322.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO322.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO322.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3360"];
	        #TRO322.stInSenJam3 := "DB_Inputs".Sensors["cInBG3361"];
	        
	        #TRO322.stInSwitch1.Settings.nSwitchNo := "cSwi322.1";
	        #TRO322.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO322.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO322.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO322.stInSwitch1.Settings.nTo1Destinations := 4; //Info nötig für HMI
	        
	        #TRO322.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO322.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3113"].xInCamTriggerReady := "bx3113-TriggerReady";
	        #arCognexInterface["cScannerBX3113"].xInCamTriggerAck := "bx3113-TriggerAck";
	        #arCognexInterface["cScannerBX3113"].xInCamResultsAvailable := "bx3113-Results Available";
	        #arCognexInterface["cScannerBX3113"].xInCamGeneralFault := "bx3113-General Fault";
	        #arCognexInterface["cScannerBX3113"].hwInCamInspectionResults := "=A01+UH03-BX3113~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO322.stInSettings.xCar2NecLeft := TRUE;
	        #TRO322.stInSettings.xCar2NecRight := FALSE;
	        #TRO322.stInSettings.xPrioDir1 := TRUE;
	        #TRO322.stInSettings.xPrioDir2 := FALSE;
	        
	      //  "DB_JamArea2104".stJam2104_2.arCarrier[1].nDestination := "cDestF2HLoaded";
	
	        #TRO322(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO322.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO322.TroOut,
	                nInMainTroNo := "cMainTro322",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO322,
	                xInCarouselRun1 := #fbExitConv2104.xOutConveyorFullSpeed (* AND #fbExitConv2103.xOutConveyorFullSpeed *),
	                xInCarouselRun2 := #fbExitConv2103.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO322,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3113"],//Todo
	                arInOutJamEntr1 := "DB_JamArea2104".stJam2104_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2104".stJam2104_2.stData,
	                arInOutJamExit2 := "DB_JamArea2104".stJam2104_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2104".stJam2104_3.stData,
	                arInOutJamExit3 := "DB_JamArea2107".stJam2107_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2107".stJam2107_1.stData,
	                xOutStopper1 => "MB3360",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro322"],
	                xOutSw1ExTo4 => "MB3361");
	        
	        "bx3113-TriggerEnable" := #arCognexInterface["cScannerBX3113"].xOutCamTriggerEnable;
	        "bx3113-Trigger" := #arCognexInterface["cScannerBX3113"].xOutCamTrigger;
	        "bx3113-ResultsAck" := #arCognexInterface["cScannerBX3113"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO322.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO322.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2104".stJam2104_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi322.1",
	                           nOutDirection => #TRO322.nInDirection,
	                           InOutCarrier := "DB_JamArea2104".stJam2104_2.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 323 (1Sep)       
	        #TRO323.stInSeparator1.Settings.nSeparatorNo := "cSep323.1";
	        #TRO323.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO323.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO323.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO323.stInSeparator1.Settings.tHandlingTime := t#100ms;
	        #TRO323.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO323.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO323.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO323.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3425"];
	        #TRO323.stInSenJam2 := "DB_Inputs".Sensors["cInBG3426"];
	        
	        //#TRO323.stInPriorityManager.xReleaseOk := "cTodoTRUE";//"cTodoFalse"; // Brauchen Prio zwischen TRO323 und TRO325
	        
	        #TRO323(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO323.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO323.TroOut,
	                nInMainTroNo := "cMainTro323",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO323,//"cTodoFalse",
	                xInCarouselRun := #fbExitConv2104.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2104".stJam2104_3.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2104".stJam2104_3.stData,
	                arInOutJamExit2 := "DB_JamArea2104".stJam2104_4.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2104".stJam2104_4.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO323,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro323"],
	                xOutStopper1 => "MB3425");
	    END_REGION
	    
	    REGION TRO 324 (Vario)
	        
	        #TRO324.stInSeparator1.Settings.nSeparatorNo := "cSep324.1";
	        #TRO324.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO324.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO324.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO324.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO324.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO324.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO324.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO324.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3440"];
	        
	        #TRO324.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO324.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO324.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO324.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO324.stInVario.Settings.tConvEmpty := T#25000ms;
	        #TRO324.stInVario.Settings.nCountCarrier := 1;
	        #TRO324.stInVario.Settings.tWaitForStop := t#3s;
	        
	        #TRO324.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3442"]; //Pusher Dog in Pos
	        #TRO324.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3433"]; // Conveyor full
	        #TRO324.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3434"]; // Jam detector
	        #TRO324.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3441"]; // MT in Pos
	        
	        #TRO324.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	       // #TRO324.stInSettings.xIsBorner := TRUE;
	        #TRO324(nInMainTroNo := "cMainTro324",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0070", 
	                xInRelease := "DB_TRO_Test".TRO324,
	                arInOutJamEntr := "DB_JamArea2109".stJam2109_1.arCarrier,//JAMS TO DO
	                stInOutJamEntr := "DB_JamArea2109".stJam2109_1.stData,
	                arInOutJamFinger := "DB_JamArea2109".stJam2109_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2109".stJam2109_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO324,
	                xOutStopper => "MB3440",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro324"],
	                xOutVarioMotor => "MA0070");
	        
	        REGION Übernahme von Level 1
	            "FB_I-Device_Receive_J2109"(xInReq := "IO_Device_UH02_FROM_UH01".bCARRIER_CONTROL_1.%X3,
	                                        stInData := "IO_Device_UH02_FROM_UH01".stCARRIER_INFO[1],
	                                        xInOutAck := "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL_1.%X3);
	            
	            
	            IF "FB_I-Device_Receive_J2109".xOutNewData THEN //1 Zyklus vom Baustein
	                //Daten von UH03 in UH02 Jam schieben
	                "FC_TSHR_AddAtEnd"(stInTrolley := "FB_I-Device_Receive_J2109".stOutData,
	                                   nOutCounter => #tmpTSHRCounter,
	                                   xOutResult => #tmpTSHRResult,
	                                   arTSHR := "DB_JamArea2109".stJam2109_1.arCarrier);
	            END_IF;
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 325 (1Sep)
	        #TRO325.stInSeparator1.Settings.nSeparatorNo := "cSep325.1";
	        #TRO325.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO325.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO325.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO325.stInSeparator1.Settings.tHandlingTime := t#200ms;
	        #TRO325.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO325.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO325.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO325.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3432"];
	        #TRO325.stInSenJam2 := "DB_Inputs".Sensors["cInBG3435"];
	        
	        #TRO325.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO325.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO325(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO325.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO325.TroOut,
	                nInMainTroNo := "cMainTro325",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO325,
	                xInCarouselRun := #fbExitConv2104.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2109".stJam2109_2.arCarrier,
	                stInOutJamEntr1:="DB_JamArea2109".stJam2109_2.stData,
	                arInOutJamExit2 := "DB_JamArea2104".stJam2104_4.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2104".stJam2104_4.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO325,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro325"],
	                xOutStopper1 => "MB3432");
	    END_REGION
	    
	    REGION TRO 326 (1Sep)
	        #TRO326.stInSeparator1.Settings.nSeparatorNo := "cSep326.1";
	        #TRO326.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO326.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO326.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO326.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO326.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO326.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO326.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO326.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3431"];
	        #TRO326.stInSenJam2 := "DB_Inputs".Sensors["cInBG3437"];
	        
	        #TRO326.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #stJamDataHandoverJam1401.Config.nCapacitySet := 1;
	        
	        #TRO326(nInMainTroNo := "cMainTro326",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO326 AND ("IO_Device_UH03_TO_UH01".stCARRIER_INFO[1].nBarcode = 0), //zwecks Übergabe warten bis UH02 Daten abgeholt hat
	                xInCarouselRun := #fbExitConv2104.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2104".stJam2104_4.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea2104".stJam2104_4.stData,
	                arInOutJamExit2 := "IO_Device_UH03_TO_UH01".stCARRIER_INFO,
	                stInOutJamExit2 := #stJamDataHandoverJam1401,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO326,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro326"],
	                xOutStopper1 => "MB3431");
	        
	        REGION Übergabe Level 1
	            //todo: sicherstellen das UH02 ready ist, ansonsten sollte UH03 warten... 
	            "FB_I-Device_SendCarrier_J1401"(xInTrigger := (#TRO326.nState = 2500) AND #TRO326.fbSeparator1.xOutTrolleyReleasedEdge, //Trigger
	                                            xInAck := "IO_Device_UH02_FROM_UH01".bCARRIER_CONTROL.%X0, //von Empfänger
	                                            stInOutData := "IO_Device_UH03_TO_UH01".stCARRIER_INFO[1], //Daten
	                                            xOutReq := "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL.%X0); //an Empfänger
	        END_REGION
	
	        
	    END_REGION
	    
	    REGION TRO 328 (Vario)
	        
	        #TRO328.stInSeparator1.Settings.nSeparatorNo := "cSep328.1";
	        #TRO328.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO328.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO328.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO328.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO328.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO328.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO328.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO328.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3244"];
	        
	        #TRO328.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO328.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO328.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO328.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO328.stInVario.Settings.tConvEmpty := T#30000ms;
	        #TRO328.stInVario.Settings.nCountCarrier := 1;
	     //   #TRO328.stInVario.Settings.tWaitForStop := T#3s; //NUR FÜR TESTMODUS, Im Normalbetrieb auskommentieren!
	        
	        #TRO328.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3243"]; //Pusher Dog in Pos
	        #TRO328.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3006"]; // Conveyor full
	        #TRO328.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3005"]; // Jam detector
	        #TRO328.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3247"]; // MT in Pos
	        
	        #TRO328.stInPriorityManager.xReleaseOk := TRUE;  // braucht keine Vorfahrtsregelung
	        
	        #TRO328(nInMainTroNo := "cMainTro328",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1 AND "SF0120" AND "SF0040",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0041" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0142",
	                xInRelease := "DB_TRO_Test".TRO328,
	                arInOutJamEntr := "DB_JamArea2105".stJam2105_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2105".stJam2105_1.stData,
	                arInOutJamFinger := "DB_JamArea2105".stJam2105_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2105".stJam2105_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO328,
	                xOutStopper => "MB3244",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro328"],
	                xOutVarioMotor => "MA0142");
	        
	    END_REGION
	    
	    REGION TRO 329 (1Sep)
	        
	        #TRO329.stInSeparator1.Settings.nSeparatorNo := "cSep329.1";
	        #TRO329.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO329.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO329.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO329.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO329.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO329.stInSeparator1.Settings.xPluggedConfirm := FALSE;
	        #TRO329.stInSeparator1.Settings.xPluggedNullBT := FALSE;
	        #TRO329.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO329.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO329.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO329.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3004"];
	        #TRO329.stInSenJam2 := "DB_Inputs".Sensors["cInBG3003"];
	        
	        #TRO329(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO329.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO329.TroOut,
	                nInMainTroNo := "cMainTro329",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO329,
	                xInCarouselRun := #fbSortConv2101.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2105".stJam2105_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2105".stJam2105_2.stData,
	                arInOutJamExit2 := "DB_JamArea2101".stJam2101_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2101".stJam2101_2.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO329,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro329"],
	                xOutStopper1 => "MB3004");
	    END_REGION
	    
	    REGION TRO 331 (Vario)
	        
	        #TRO331.stInSeparator1.Settings.nSeparatorNo := "cSep331.1";
	        #TRO331.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO331.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO331.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO331.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO331.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO331.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO331.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO331.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3304"];
	        
	        #TRO331.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO331.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO331.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3303"]; //Pusher Dog in Pos
	        #TRO331.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3066"]; // Conveyor full
	        #TRO331.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3065"]; // Jam detector
	        #TRO331.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3307"]; // MT in Pos
	        
	        #TRO331.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO331.stInVario.Settings.tWaitForJog := T#50ms;//T#400ms;
	        #TRO331.stInVario.Settings.tConvEmpty := T#30000ms;
	        #TRO331.stInVario.Settings.nCountCarrier := 1;
	        //#TRO331.stInVario.Settings.tWaitForStop := T#3s; //NUR FÜR TESTMODUS, Im Normalbetrieb auskommentieren!
	        
	        #TRO331.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO331(nInMainTroNo := "cMainTro331",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1 AND "SF0122" AND "SF0052",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0053" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0143",
	                xInRelease := "DB_TRO_Test".TRO331,
	                arInOutJamEntr := "DB_JamArea2106".stJam2106_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2106".stJam2106_1.stData,
	                arInOutJamFinger := "DB_JamArea2106".stJam2106_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2106".stJam2106_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO331,
	                xOutStopper => "MB3304",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro331"],
	                xOutVarioMotor => "MA0143");
	        
	    END_REGION
	    
	    REGION TRO 332 (1Sep)
	        #TRO332.stInSeparator1.Settings.nSeparatorNo := "cSep332.1";
	        #TRO332.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO332.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO332.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO332.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO332.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO332.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO332.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO332.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO332.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3064"];
	        #TRO332.stInSenJam2 := "DB_Inputs".Sensors["cInBG3063"];
	        
	        #TRO332.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO332.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO332(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO332.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO332.TroOut,
	                nInMainTroNo := "cMainTro332",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO332,
	                xInCarouselRun := #fbSortConv2101.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2106".stJam2106_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea2106".stJam2106_2.stData,
	                arInOutJamExit2 := "DB_JamArea2101".stJam2101_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2101".stJam2101_1.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO332,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro332"],
	                xOutStopper1 => "MB3064");
	    END_REGION
	    
	    REGION TRO 334 (Vario)
	        
	        #TRO334.stInSeparator1.Settings.nSeparatorNo := "cSep334.1";
	        #TRO334.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO334.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO334.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO334.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO334.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO334.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO334.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO334.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3364"];
	        
	        #TRO334.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO334.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO334.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3363"]; //Pusher Dog in Pos
	        #TRO334.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3126"]; // Conveyor full
	        #TRO334.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3125"]; // Jam detector
	        #TRO334.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3367"]; // MT in Pos
	        
	        #TRO334.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO334.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO334.stInVario.Settings.tConvEmpty := T#30000ms;
	        #TRO334.stInVario.Settings.nCountCarrier := 1;
	       // #TRO334.stInVario.Settings.tWaitForStop := T#3s; //NUR FÜR TESTMODUS, Im Normalbetrieb auskommentieren!
	        
	        #TRO334.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO334(nInMainTroNo := "cMainTro334",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1 AND "SF0124" AND "SF0044",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0045" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0144",
	                xInRelease := "DB_TRO_Test".TRO334,
	                arInOutJamEntr := "DB_JamArea2107".stJam2107_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2107".stJam2107_1.stData,
	                arInOutJamFinger := "DB_JamArea2107".stJam2107_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2107".stJam2107_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO334,
	                xOutStopper => "MB3364",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro334"],
	                xOutVarioMotor => "MA0144");
	        
	    END_REGION
	    
	    REGION TRO 335 (1Sep)
	        #TRO335.stInSeparator1.Settings.nSeparatorNo := "cSep335.1";
	        #TRO335.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO335.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO335.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO335.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO335.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO335.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO335.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO335.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO335.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3124"];
	        #TRO335.stInSenJam2 := "DB_Inputs".Sensors["cInBG3123"];
	        
	        #TRO335.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO335.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO335(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO335.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO335.TroOut,
	                nInMainTroNo := "cMainTro335",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO335,
	                xInCarouselRun := #fbSortConv2102.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2107".stJam2107_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2107".stJam2107_2.stData,
	                arInOutJamExit2 := "DB_JamArea2102".stJam2102_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2102".stJam2102_3.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO335,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro335"],
	                xOutStopper1 => "MB3124");
	        
	    END_REGION
	    
	    REGION TRO 337 (Vario)
	        
	        #TRO337.stInSeparator1.Settings.nSeparatorNo := "cSep337.1";
	        #TRO337.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO337.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO337.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO337.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO337.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO337.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO337.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO337.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3424"];
	        
	        #TRO337.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO337.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO337.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3423"]; //Pusher Dog in Pos
	        #TRO337.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3186"]; // Conveyor full
	        #TRO337.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3185"]; // Jam detector
	        #TRO337.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3427"]; // MT in Pos
	        
	        #TRO337.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO337.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO337.stInVario.Settings.tConvEmpty := T#30000ms;
	        #TRO337.stInVario.Settings.nCountCarrier := 1;
	       // #TRO337.stInVario.Settings.tWaitForStop := T#3s; //NUR FÜR TESTMODUS, Im Normalbetrieb auskommentieren!
	        
	        #TRO337.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO337(nInMainTroNo := "cMainTro337",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1 AND "SF0126" AND "SF0046",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0047" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0145",
	                xInRelease := "DB_TRO_Test".TRO337,
	                arInOutJamEntr := "DB_JamArea2108".stJam2108_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2108".stJam2108_1.stData,
	                arInOutJamFinger := "DB_JamArea2108".stJam2108_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2108".stJam2108_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO337,
	                xOutStopper => "MB3424",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro337"],
	                xOutVarioMotor => "MA0145");
	        
	    END_REGION
	    
	    REGION TRO 338 (1Sep)
	        #TRO338.stInSeparator1.Settings.nSeparatorNo := "cSep338.1";
	        #TRO338.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO338.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO338.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO338.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO338.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO338.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO338.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO338.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO338.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3184"];
	        #TRO338.stInSenJam2 := "DB_Inputs".Sensors["cInBG3183"];
	        
	        #TRO338.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO338.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO338(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO338.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO338.TroOut,
	                nInMainTroNo := "cMainTro338",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO338,
	                xInCarouselRun := #fbSortConv2102.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2108".stJam2108_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2108".stJam2108_2.stData,
	                arInOutJamExit2 := "DB_JamArea2102".stJam2102_4.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2102".stJam2102_4.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO338,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro338"],
	                xOutStopper1 => "MB3184");
	    END_REGION
	    
	    // BLOCK 1 ENDE...
	    
	    REGION TRO 339 (1Sep1Switch)+Scanner(BX3120)
	        #TRO339.stInSeparator1.Settings.nSeparatorNo := "cSep339.1";
	        #TRO339.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO339.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO339.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO339.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO339.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO339.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO339.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3614"];
	        #TRO339.stInSenJam2 := "DB_Inputs".Sensors["cInBG3616"];
	        #TRO339.stInSenJam3 := "DB_Inputs".Sensors["cInBG3615"];
	        
	        #TRO339.stInSwitch1.Settings.nSwitchNo := "cSwi339.1";
	        #TRO339.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO339.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO339.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO339.stInSwitch1.Settings.nTo1Destinations := 4; //Info nötig für HMI
	        
	        #TRO339.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO339.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3120"].xInCamTriggerReady := "bx3120-TriggerReady";
	        #arCognexInterface["cScannerBX3120"].xInCamTriggerAck := "bx3120-TriggerAck";
	        #arCognexInterface["cScannerBX3120"].xInCamResultsAvailable := "bx3120-Results Available";
	        #arCognexInterface["cScannerBX3120"].xInCamGeneralFault := "bx3120-General Fault";
	        #arCognexInterface["cScannerBX3120"].hwInCamInspectionResults := "=A01+UH03-BX3120~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO339.stInPriorityManagerDir1.xReleaseOk := TRUE;
	        #TRO339.stInPriorityManagerDir2.xReleaseOk := TRUE;
	        
	        #stJamDataHandoverJam1209.Config.nCapacitySet := 1; //
	        
	        #TRO339(nInMainTroNo := "cMainTro339",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO339 AND ("IO_Device_UH03_TO_UH01".stCarrierL2toL1_2[1].nBarcode = 0), //zwecks Übergabe warten bis UH02 Daten abgeholt hat,
	                xInCarouselRun1 := #fbSortConv2202.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbSortConv2202.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO339,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3120"],
	                arInOutJamEntr1 := "DB_JamArea2202".stJam2202_1.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea2202".stJam2202_1.stData,
	                arInOutJamExit2 := "DB_JamArea2202".stJam2202_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2202".stJam2202_2.stData,
	                stInOutJamExit3 := #stJamDataHandoverJam1209,
	                arInOutJamExit3 := "IO_Device_UH03_TO_UH01".stCarrierL2toL1_2,//#arCarrierHandoverJam1209,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro339"],
	                xOutStopper1 => "MB3614",
	                xOutSw1ExTo4 => "MB3615");
	        
	        "bx3120-TriggerEnable" := #arCognexInterface["cScannerBX3120"].xOutCamTriggerEnable;
	        "bx3120-Trigger" := #arCognexInterface["cScannerBX3120"].xOutCamTrigger;
	        "bx3120-ResultsAck" := #arCognexInterface["cScannerBX3120"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO339.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO339.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2202".stJam2202_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi339.1",
	                           nOutDirection => #TRO339.nInDirection,
	                           InOutCarrier := "DB_JamArea2202".stJam2202_1.arCarrier[1]);
	            
	        END_REGION
	        
	        REGION Übergabe Level 1
	            //todo: sicherstellen das UH02 ready ist, ansonsten sollte UH03 warten... 
	            "FB_I-Device_SendCarrier_J1209"(xInTrigger := (#TRO339.nState = 2500) AND #TRO339.stActRequest.nDirection = 2 AND #TRO339.fbSeparator1.xOutTrolleyReleasedEdge, //Trigger
	                                            xInAck := "IO_Device_UH02_FROM_UH01".bCARRIER_CONTROL_1.%X1, //von Empfänger
	                                            stInOutData := "IO_Device_UH03_TO_UH01".stCarrierL2toL1_2[1], //Daten
	                                            xOutReq := "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL_1.%X1); //an Empfänger
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 340 (1Sep1Switch)+Scanner(BX3121)
	        #TRO340.stInSeparator1.Settings.nSeparatorNo := "cSep340.1";
	        #TRO340.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO340.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO340.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO340.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO340.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO340.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO340.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3617"];
	        #TRO340.stInSenJam2 := "DB_Inputs".Sensors["cInBG3603"];
	        #TRO340.stInSenJam3 := "DB_Inputs".Sensors["cInBG3543"];
	        
	        #TRO340.stInSwitch1.Settings.nSwitchNo := "cSwi340.1";
	        #TRO340.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO340.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO340.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO340.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	
	        #TRO340.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO340.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3121"].xInCamTriggerReady := "bx3121-TriggerReady";
	        #arCognexInterface["cScannerBX3121"].xInCamTriggerAck := "bx3121-TriggerAck";
	        #arCognexInterface["cScannerBX3121"].xInCamResultsAvailable := "bx3121-Results Available";
	        #arCognexInterface["cScannerBX3121"].xInCamGeneralFault := "bx3121-General Fault";
	        #arCognexInterface["cScannerBX3121"].hwInCamInspectionResults := "=A01+UH03-BX3121~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO340.stInSettings.xCar2NecRight := TRUE;
	        #TRO340.stInSettings.xCar2NecLeft := TRUE;
	        #TRO340.stInSettings.xPrioDir1 := TRUE;
	        #TRO340.stInSettings.xPrioDir2 := TRUE;
	        
	        #TRO340(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO340_3.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO340_3.TroOut,
	                stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO340_4.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO340_4.TroOut,
	                nInMainTroNo := "cMainTro340",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO340,
	                xInCarouselRun1 := #fbSortConv2202.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbSortConv2201.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO340,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3121"],
	                arInOutJamEntr1 := "DB_JamArea2202".stJam2202_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2202".stJam2202_2.stData,
	                arInOutJamExit2 := "DB_JamArea2202".stJam2202_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2202".stJam2202_3.stData,
	                arInOutJamExit3 := "DB_JamArea2201".stJam2201_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2201".stJam2201_1.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro340"],
	                xOutStopper1 => "MB3617",
	                xOutSw1ExTo3 => "MB3541");
	        
	        "bx3121-TriggerEnable" := #arCognexInterface["cScannerBX3121"].xOutCamTriggerEnable;
	        "bx3121-Trigger" := #arCognexInterface["cScannerBX3121"].xOutCamTrigger;
	        "bx3121-ResultsAck" := #arCognexInterface["cScannerBX3121"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO340.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO340.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2202".stJam2202_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi340.1",
	                           nOutDirection => #TRO340.nInDirection,
	                           InOutCarrier := "DB_JamArea2202".stJam2202_2.arCarrier[1]);
	            
	        END_REGION
	        
	        
	    END_REGION
	    
	    REGION TRO 341 (1Sep1Switch)+Scanner(BX3126)
	        #TRO341.stInSeparator1.Settings.nSeparatorNo := "cSep341.1";
	        #TRO341.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO341.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO341.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO341.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO341.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO341.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO341.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3720"];
	        #TRO341.stInSenJam2 := "DB_Inputs".Sensors["cInBG3721"];
	        
	        #TRO341.stInSwitch1.Settings.nSwitchNo := "cSwi341.1";
	        #TRO341.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO341.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO341.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO341.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	
	        #TRO341.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO341.stInBarcodeReader.Settings.tTimeout := T#15s;
	        
	        #arCognexInterface["cScannerBX3126"].xInCamTriggerReady := "bx3126-TriggerReady";
	        #arCognexInterface["cScannerBX3126"].xInCamTriggerAck := "bx3126-TriggerAck";
	        #arCognexInterface["cScannerBX3126"].xInCamResultsAvailable := "bx3126-Results Available";
	        #arCognexInterface["cScannerBX3126"].xInCamGeneralFault := "bx3126-General Fault";
	        #arCognexInterface["cScannerBX3126"].hwInCamInspectionResults := "=A01+UC032-BX3126~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO341.stInSettings.xCar2NecLeft := FALSE;
	        #TRO341.stInSettings.xCar2NecRight := FALSE;
	        #TRO341.stInSettings.xPrioDir1 := FALSE;
	        #TRO341.stInSettings.xPrioDir2 := TRUE;
	        
	       // "DB_JamArea2203".stJam2203_1.arCarrier[1].nDestination := "cDestF2HLoaded"; 
	        
	        #TRO341(stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO341.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO341.TroOut,
	                nInMainTroNo := "cMainTro341",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO341,
	                xInCarouselRun1 := #fbExitConv2203.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv2203.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO341,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3126"],
	                arInOutJamEntr1 := "DB_JamArea2203".stJam2203_1.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2203".stJam2203_1.stData,
	                arInOutJamExit2 := "DB_JamArea2205".stJam2205_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2205".stJam2205_1.stData,
	                arInOutJamExit3 := "DB_JamArea2203".stJam2203_2.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2203".stJam2203_2.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro341"],
	                xOutStopper1 => "MB3720",
	                xOutSw1ExTo3 => "MB3721");
	        
	        "bx3126-TriggerEnable" := #arCognexInterface["cScannerBX3126"].xOutCamTriggerEnable;
	        "bx3126-Trigger" := #arCognexInterface["cScannerBX3126"].xOutCamTrigger;
	        "bx3126-ResultsAck" := #arCognexInterface["cScannerBX3126"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO341.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO341.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2203".stJam2203_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi341.1",
	                           nOutDirection => #TRO341.nInDirection,
	                           InOutCarrier := "DB_JamArea2203".stJam2203_1.arCarrier[1]);
	            
	        END_REGION
	        
	        
	    END_REGION
	    
	    REGION TRO 342 (1Sep1Switch)+Scanner(BX3127)
	        #TRO342.stInSeparator1.Settings.nSeparatorNo := "cSep342.1";
	        #TRO342.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO342.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO342.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO342.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO342.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO342.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO342.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3780"];
	        #TRO342.stInSenJam2 := "DB_Inputs".Sensors["cInBG3781"];
	        #TRO342.stInSenJam3 := "DB_Inputs".Sensors["cInBG3845"];
	        
	        #TRO342.stInSwitch1.Settings.nSwitchNo := "cSwi342.1";
	        #TRO342.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO342.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO342.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO342.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	
	        #TRO342.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO342.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3127"].xInCamTriggerReady := "bx3127-TriggerReady";
	        #arCognexInterface["cScannerBX3127"].xInCamTriggerAck := "bx3127-TriggerAck";
	        #arCognexInterface["cScannerBX3127"].xInCamResultsAvailable := "bx3127-Results Available";
	        #arCognexInterface["cScannerBX3127"].xInCamGeneralFault := "bx3127-General Fault";
	        #arCognexInterface["cScannerBX3127"].hwInCamInspectionResults := "=A01+UC032-BX3127~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO342.stInSettings.xCar2NecRight := TRUE;
	        #TRO342.stInSettings.xCar2NecLeft := FALSE;
	        #TRO342.stInSettings.xPrioDir1 := FALSE;
	        #TRO342.stInSettings.xPrioDir2 := TRUE;
	        
	     //   "DB_JamArea2203".stJam2203_2.arCarrier[1].nDestination := "cDestF2HLoaded";
	        
	        #TRO342(stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO342.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO342.TroOut,
	                nInMainTroNo := "cMainTro342",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO342,
	                xInCarouselRun1 := #fbExitConv2203.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv2204.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO342,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3127"],
	                arInOutJamEntr1 := "DB_JamArea2203".stJam2203_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2203".stJam2203_2.stData,
	                arInOutJamExit2 := "DB_JamArea2206".stJam2206_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2206".stJam2206_1.stData,
	                arInOutJamExit3 := "DB_JamArea2204".stJam2204_3.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2204".stJam2204_3.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro342"],
	                xOutStopper1 => "MB3780",
	                xOutSw1ExTo3 => "MB3781");
	        
	        "bx3127-TriggerEnable" := #arCognexInterface["cScannerBX3127"].xOutCamTriggerEnable;
	        "bx3127-Trigger" := #arCognexInterface["cScannerBX3127"].xOutCamTrigger;
	        "bx3127-ResultsAck" := #arCognexInterface["cScannerBX3127"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO342.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO342.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2203".stJam2203_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi342.1",
	                           nOutDirection => #TRO342.nInDirection,
	                           InOutCarrier := "DB_JamArea2203".stJam2203_2.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 343 (1Sep1Switch)+Scanner(BX3129)
	        #TRO343.stInSeparator1.Settings.nSeparatorNo := "cSep343.1";
	        #TRO343.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO343.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO343.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO343.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO343.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO343.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO343.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3900"];
	        #TRO343.stInSenJam3 := "DB_Inputs".Sensors["cInBG3901"];
	        
	        #TRO343.stInSwitch1.Settings.nSwitchNo := "cSwi343.1";
	        #TRO343.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO343.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO343.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO343.stInSwitch1.Settings.nTo1Destinations := 4; //Info nötig für HMI
	        
	        #TRO343.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO343.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3129"].xInCamTriggerReady := "bx3129-TriggerReady";
	        #arCognexInterface["cScannerBX3129"].xInCamTriggerAck := "bx3129-TriggerAck";
	        #arCognexInterface["cScannerBX3129"].xInCamResultsAvailable := "bx3129-Results Available";
	        #arCognexInterface["cScannerBX3129"].xInCamGeneralFault := "bx3129-General Fault";
	        #arCognexInterface["cScannerBX3129"].hwInCamInspectionResults := "=A01+UC032-BX3129~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO343.stInSettings.xCar2NecLeft := FALSE;
	        #TRO343.stInSettings.xCar2NecRight := FALSE;
	        #TRO343.stInSettings.xPrioDir2 := FALSE;
	        #TRO343.stInSettings.xPrioDir1 := TRUE;
	        
	       // "DB_JamArea2204".stJam2204_1.arCarrier[1].nDestination := "cDestF2HLoaded";
	        
	        #TRO343(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO343.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO343.TroOut,
	                nInMainTroNo := "cMainTro343",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO343,
	                xInCarouselRun1 := #fbExitConv2204.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv2204.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO343,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3129"],
	                arInOutJamEntr1 := "DB_JamArea2204".stJam2204_1.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2204".stJam2204_1.stData,
	                arInOutJamExit2 := "DB_JamArea2204".stJam2204_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2204".stJam2204_2.stData,
	                arInOutJamExit3 := "DB_JamArea2208".stJam2208_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2208".stJam2208_1.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro343"],
	                xOutStopper1 => "MB3900",
	                xOutSw1ExTo4 => "MB3901");
	        
	        "bx3129-TriggerEnable" := #arCognexInterface["cScannerBX3129"].xOutCamTriggerEnable;
	        "bx3129-Trigger" := #arCognexInterface["cScannerBX3129"].xOutCamTrigger;
	        "bx3129-ResultsAck" := #arCognexInterface["cScannerBX3129"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO343.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO343.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2204".stJam2204_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi343.1",
	                           nOutDirection => #TRO343.nInDirection,
	                           InOutCarrier := "DB_JamArea2204".stJam2204_1.arCarrier[1]);
	            
	        END_REGION
	        
	        
	    END_REGION
	    
	    REGION TRO 344 (1Sep1Switch)+Scanner(BX3128)
	        #TRO344.stInSeparator1.Settings.nSeparatorNo := "cSep344.1";
	        #TRO344.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO344.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO344.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO344.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO344.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO344.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO344.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3840"];
	        #TRO344.stInSenJam2 := "DB_Inputs".Sensors["cInBG3845"];
	        #TRO344.stInSenJam3 := "DB_Inputs".Sensors["cInBG3841"];
	        
	        #TRO344.stInSwitch1.Settings.nSwitchNo := "cSwi344.1";
	        #TRO344.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO344.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO344.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO344.stInSwitch1.Settings.nTo1Destinations := 4; //Info nötig für HMI
	        
	        #TRO344.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO344.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3128"].xInCamTriggerReady := "bx3128-TriggerReady";
	        #arCognexInterface["cScannerBX3128"].xInCamTriggerAck := "bx3128-TriggerAck";
	        #arCognexInterface["cScannerBX3128"].xInCamResultsAvailable := "bx3128-Results Available";
	        #arCognexInterface["cScannerBX3128"].xInCamGeneralFault := "bx3128-General Fault";
	        #arCognexInterface["cScannerBX3128"].hwInCamInspectionResults := "=A01+UC032-BX3128~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO344.stInSettings.xCar2NecLeft := TRUE;
	        #TRO344.stInSettings.xCar2NecRight := FALSE;
	        #TRO344.stInSettings.xPrioDir2 := FALSE;
	        #TRO344.stInSettings.xPrioDir1 := TRUE;
	        
	      //  "DB_JamArea2204".stJam2204_2.arCarrier[1].nDestination := "cDestF2HLoaded";
	        
	        #TRO344(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO344.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO344.TroOut,
	                nInMainTroNo := "cMainTro344",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO344,
	                xInCarouselRun1 := #fbExitConv2204.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv2203.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO344,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3128"],
	                arInOutJamEntr1 := "DB_JamArea2204".stJam2204_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2204".stJam2204_2.stData,
	                arInOutJamExit2 := "DB_JamArea2204".stJam2204_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2204".stJam2204_3.stData,
	                arInOutJamExit3 := "DB_JamArea2207".stJam2207_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2207".stJam2207_1.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro344"],
	                xOutStopper1 => "MB3840",
	                xOutSw1ExTo4 => "MB3841");
	        
	        "bx3128-TriggerEnable" := #arCognexInterface["cScannerBX3128"].xOutCamTriggerEnable;
	        "bx3128-Trigger" := #arCognexInterface["cScannerBX3128"].xOutCamTrigger;
	        "bx3128-ResultsAck" := #arCognexInterface["cScannerBX3128"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO344.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO344.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2204".stJam2204_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi344.1",
	                           nOutDirection => #TRO344.nInDirection,
	                           InOutCarrier := "DB_JamArea2204".stJam2204_2.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 345 (1Sep)
	        #TRO345.stInSeparator1.Settings.nSeparatorNo := "cSep345.1";
	        #TRO345.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO345.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO345.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO345.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO345.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO345.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO345.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO345.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3905"];
	        #TRO345.stInSenJam2 := "DB_Inputs".Sensors["cInBG3906"];
	        
	        #TRO345(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO345.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO345.TroOut,
	                nInMainTroNo := "cMainTro345",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO345,
	                xInCarouselRun := #fbExitConv2204.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2204".stJam2204_3.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2204".stJam2204_3.stData,
	                arInOutJamExit2 := "DB_JamArea2204".stJam2204_4.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2204".stJam2204_4.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO345,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro345"],
	                xOutStopper1 => "MB3905");
	        
	    END_REGION
	    
	    REGION TRO 346 (Vario)
	        
	        #TRO346.stInSeparator1.Settings.nSeparatorNo := "cSep346.1";
	        #TRO346.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO346.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO346.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO346.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO346.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO346.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO346.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO346.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3920"];
	        
	        #TRO346.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO346.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO346.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3922"]; //Finger in Pos
	        #TRO346.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3921"]; //MT in Pos
	        #TRO346.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3913"]; // Conveyor full
	        #TRO346.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3915"]; // Jam detector
	        
	        #TRO346.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO346.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO346.stInVario.Settings.tConvEmpty := T#30000ms;
	        #TRO346.stInVario.Settings.nCountCarrier := 1;
	        #TRO346.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO346.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	      //  #TRO346.stInSettings.xIsBorner := TRUE;
	        #TRO346(nInMainTroNo := "cMainTro346",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO346,
	                xInAutomatic := #t_Automatik_OF3,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0205",
	                arInOutJamEntr := "DB_JamArea2209".stJam2209_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2209".stJam2209_1.stData,
	                arInOutJamFinger := "DB_JamArea2209".stJam2209_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2209".stJam2209_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO346,
	                xOutStopper => "MB3920",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro346"],
	                xOutVarioMotor => "MA0205");
	        
	        REGION Übernahme von Level 1
	            "FB_I-Device_Receive_J2209"(xInReq := "IO_Device_UH02_FROM_UH01".bCARRIER_CONTROL_1.%X4,
	                                        stInData := "IO_Device_UH02_FROM_UH01".stCARRIER_INFO_1[1],
	                                        xInOutAck := "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL_1.%X4);
	            
	            
	            IF "FB_I-Device_Receive_J2209".xOutNewData THEN //1 Zyklus vom Baustein
	                //Daten von UH03 in UH02 Jam schieben
	                "FC_TSHR_AddAtEnd"(stInTrolley := "FB_I-Device_Receive_J2209".stOutData,
	                                   nOutCounter => #tmpTSHRCounter,
	                                   xOutResult => #tmpTSHRResult,
	                                   arTSHR := "DB_JamArea2209".stJam2209_1.arCarrier);
	            END_IF;
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 347 (1Sep)        
	        #TRO347.stInSeparator1.Settings.nSeparatorNo := "cSep347.1";
	        #TRO347.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO347.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO347.stInSeparator1.Settings.tHandlingTime := t#200ms;
	        #TRO347.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO347.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO347.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO347.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO347.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3912"];
	        #TRO347.stInSenJam2 := "DB_Inputs".Sensors["cInBG3915"];
	        
	        #TRO347.stInPriorityManager.xReleaseOk := TRUE;
	        
	        #TRO347.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO347.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO347(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO347.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO347.TroOut,
	                nInMainTroNo := "cMainTro347",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO347,
	                xInCarouselRun := #fbExitConv2204.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2209".stJam2209_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2209".stJam2209_2.stData,
	                arInOutJamExit2 := "DB_JamArea2204".stJam2204_4.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2204".stJam2204_4.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO347,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro347"],
	                xOutStopper1 => "MB3912");
	        
	    END_REGION
	    
	    REGION TRO 348 (1Sep)
	        
	        #TRO348.stInSeparator1.Settings.nSeparatorNo := "cSep348.1";
	        #TRO348.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO348.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO348.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO348.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO348.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO348.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO348.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO348.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3910"];
	        #TRO348.stInSenJam2 := "DB_Inputs".Sensors["cInBG3911"];
	        
	        #TRO348.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #stJamDataHandoverJam1501.Config.nCapacitySet := 1;
	        
	        #TRO348(nInMainTroNo := "cMainTro348",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO348 AND ("IO_Device_UH03_TO_UH01".stCARRIER_INFO_1[1].nBarcode = 0), //zwecks Übergabe warten bis UH02 Daten abgeholt hat,
	                xInCarouselRun := #fbExitConv2204.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3130"],
	                arInOutJamEntr1 := "DB_JamArea2204".stJam2204_4.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2204".stJam2204_4.stData,
	                arInOutJamExit2 := "IO_Device_UH03_TO_UH01".stCARRIER_INFO_1,
	                stInOutJamExit2 := #stJamDataHandoverJam1501,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO348,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro348"],
	                xOutStopper1 => "MB3910");
	        
	        REGION Übergabe Level 1
	            //todo: sicherstellen das UH02 ready ist, ansonsten sollte UH03 warten... 
	            "FB_I-Device_SendCarrier_J1501"(xInTrigger := (#TRO348.nState = 2500) AND #TRO348.fbSeparator1.xOutTrolleyReleasedEdge, //Trigger
	                                            xInAck := "IO_Device_UH02_FROM_UH01".bCARRIER_CONTROL.%X1, //von Empfänger
	                                            stInOutData := "IO_Device_UH03_TO_UH01".stCARRIER_INFO_1[1], //Daten
	                                            xOutReq := "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL.%X1); //an Empfänger
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 350 (Vario)
	        
	        #TRO350.stInSeparator1.Settings.nSeparatorNo := "cSep350.1";
	        #TRO350.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO350.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO350.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO350.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO350.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO350.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO350.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO350.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3724"];
	        
	        #TRO350.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO350.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO350.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3723"]; // Finger in Pos
	        #TRO350.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3727"]; //Mt in Pos
	        #TRO350.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3486"]; // Conveyor full
	        #TRO350.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3485"]; // Jam detector
	        
	        #TRO350.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO350.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO350.stInVario.Settings.tConvEmpty := T#35000ms;
	        #TRO350.stInVario.Settings.nCountCarrier := 1;
	        #TRO350.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO350.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO350(nInMainTroNo := "cMainTro350",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO350,
	                xInAutomatic := #t_Automatik_OF3 AND "SF0050" AND "SF0180",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0181" OR"SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0064",
	                arInOutJamEntr := "DB_JamArea2205".stJam2205_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2205".stJam2205_1.stData,
	                arInOutJamFinger := "DB_JamArea2205".stJam2205_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2205".stJam2205_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO350,
	                xOutStopper => "MB3724",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro350"],
	                xOutVarioMotor => "MA0064");
	        
	    END_REGION
	    
	    REGION TRO 351 (1Sep)
	        #TRO351.stInSeparator1.Settings.nSeparatorNo := "cSep351.1";
	        #TRO351.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO351.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO351.stInSeparator1.Settings.tHandlingTime := t#400ms;
	        #TRO351.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO351.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO351.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO351.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO351.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO351.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3484"];
	        #TRO351.stInSenJam2 := "DB_Inputs".Sensors["cInBG3483"];
	        
	        #TRO351.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO351.stInSeparator1.Settings.tSenWait := T#2500ms;
	       
	        #TRO351(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO351.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO351.TroOut,
	                nInMainTroNo := "cMainTro351",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO351,
	                xInCarouselRun := #fbSortConv2201.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2205".stJam2205_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2205".stJam2205_2.stData,
	                arInOutJamExit2 := "DB_JamArea2201".stJam2201_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2201".stJam2201_2.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO351,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro351"],
	                xOutStopper1 => "MB3484");
	        
	    END_REGION
	    
	    REGION TRO 353 (Vario)
	       
	        #TRO353.stInSeparator1.Settings.nSeparatorNo := "cSep353.1";
	        #TRO353.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO353.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO353.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO353.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO353.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO353.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO353.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO353.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3784"];
	        
	        #TRO353.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO353.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO353.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3783"]; //Finger in Pos
	        #TRO353.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3787"];
	        #TRO353.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3546"]; // Conveyor full
	        #TRO353.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3545"]; // Jam detector
	        
	        #TRO353.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO353.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO353.stInVario.Settings.tConvEmpty := T#35000ms;
	        #TRO353.stInVario.Settings.nCountCarrier := 1;
	        #TRO353.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO353.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO353(nInMainTroNo := "cMainTro353",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO353,
	                xInAutomatic := #t_Automatik_OF3 AND "SF0052" AND "SF0182",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0183" OR"SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0065",
	                arInOutJamEntr := "DB_JamArea2206".stJam2206_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2206".stJam2206_1.stData,
	                arInOutJamFinger := "DB_JamArea2206".stJam2206_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2206".stJam2206_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO353,
	                xOutStopper => "MB3784",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro353"],
	                xOutVarioMotor => "MA0065");
	        
	    END_REGION
	    
	    REGION TRO 354 (1Sep)
	        #TRO354.stInSeparator1.Settings.nSeparatorNo := "cSep354.1";
	        #TRO354.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO354.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO354.stInSeparator1.Settings.tHandlingTime := t#400ms;
	        #TRO354.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO354.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO354.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO354.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO354.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO354.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3544"];
	        #TRO354.stInSenJam2 := "DB_Inputs".Sensors["cInBG3543"];
	        
	        #TRO354.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO354.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO354(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO354.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO354.TroOut,
	                nInMainTroNo := "cMainTro354",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO354,
	                xInCarouselRun := #fbSortConv2201.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2206".stJam2206_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2206".stJam2206_2.stData,
	                arInOutJamExit2 := "DB_JamArea2201".stJam2201_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2201".stJam2201_1.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO354,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro354"],
	                xOutStopper1 => "MB3544");
	        
	    END_REGION
	    
	    REGION TRO 356 (Vario)
	        
	        #TRO356.stInSeparator1.Settings.nSeparatorNo := "cSep356.1";
	        #TRO356.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO356.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO356.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO356.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO356.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO356.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO356.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO356.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3844"];
	        
	        #TRO356.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO356.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO356.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3843"]; // Finger in Pos
	        #TRO356.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3847"]; // MT in Pos
	        #TRO356.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3606"]; // Conveyor full
	        #TRO356.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3605"]; // Jam detector
	        
	        #TRO356.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO356.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO356.stInVario.Settings.tConvEmpty := T#35000ms;
	        #TRO356.stInVario.Settings.nCountCarrier := 1;
	        #TRO356.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO356.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	
	        #TRO356(nInMainTroNo := "cMainTro356",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO356,
	                xInAutomatic := #t_Automatik_OF3 AND "SF0054" AND "SF0184",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0185" OR"SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0066",
	                arInOutJamEntr := "DB_JamArea2207".stJam2207_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2207".stJam2207_1.stData,
	                arInOutJamFinger := "DB_JamArea2207".stJam2207_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2207".stJam2207_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO356,
	                xOutStopper => "MB3844",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro356"],
	                xOutVarioMotor => "MA0066");
	        
	    END_REGION
	    
	    REGION TRO 357 (1Sep)
	        #TRO357.stInSeparator1.Settings.nSeparatorNo := "cSep357.1";
	        #TRO357.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO357.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO357.stInSeparator1.Settings.tHandlingTime := t#400ms;
	        #TRO357.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO357.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO357.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO357.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO357.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO357.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3604"];
	        #TRO357.stInSenJam2 := "DB_Inputs".Sensors["cInBG3603"];
	        
	        #TRO357.stInSeparator1.Settings.tSenFree := T#3500ms;
	        #TRO357.stInSeparator1.Settings.tSenWait := T#5000ms;
	        
	        #TRO357(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO357.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO357.TroOut,
	                nInMainTroNo := "cMainTro357",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO357,
	                xInCancel := "cTodoFalse",
	                xInCarouselRun := #fbSortConv2202.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2207".stJam2207_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2207".stJam2207_2.stData,
	                arInOutJamExit2 := "DB_JamArea2202".stJam2202_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2202".stJam2202_3.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO357,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro357"],
	                xOutStopper1 => "MB3604");
	        
	    END_REGION
	    
	    REGION TRO 359 (Vario)
	        
	        #TRO359.stInSeparator1.Settings.nSeparatorNo := "cSep359.1";
	        #TRO359.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO359.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO359.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO359.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO359.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO359.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO359.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO359.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3904"];
	        
	        #TRO359.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO359.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO359.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3903"]; // Finger in Pos
	        #TRO359.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3907"]; // MT in Pos
	        #TRO359.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3666"]; // Conveyor full
	        #TRO359.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3665"]; // Jam detector
	        
	        #TRO359.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO359.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO359.stInVario.Settings.tConvEmpty := T#35000ms;
	        #TRO359.stInVario.Settings.nCountCarrier := 1;
	        #TRO359.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO359.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO359(nInMainTroNo := "cMainTro359",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO359,
	                xInAutomatic := #t_Automatik_OF3 AND "SF0056" AND "SF0186",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0187" OR"SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0067",
	                arInOutJamEntr := "DB_JamArea2208".stJam2208_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2208".stJam2208_1.stData,
	                arInOutJamFinger := "DB_JamArea2208".stJam2208_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2208".stJam2208_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO359,
	                xOutStopper => "MB3904",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro359"],
	                xOutVarioMotor => "MA0067");
	        
	    END_REGION
	    
	    REGION TRO 360 (1Sep)
	        #TRO360.stInSeparator1.Settings.nSeparatorNo := "cSep360.1";
	        #TRO360.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO360.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO360.stInSeparator1.Settings.tHandlingTime := t#400ms;
	        #TRO360.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO360.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO360.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO360.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO360.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO360.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3664"];
	        #TRO360.stInSenJam2 := "DB_Inputs".Sensors["cInBG3663"];
	        
	        
	        #TRO360.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO360.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO360(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO360.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO360.TroOut,
	                nInMainTroNo := "cMainTro360",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO360,
	                xInCancel := "cTodoFalse",
	                xInCarouselRun := #fbSortConv2202.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2208".stJam2208_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea2208".stJam2208_2.stData,
	                arInOutJamExit2 := "DB_JamArea2202".stJam2202_4.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2202".stJam2202_4.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO360,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro360"],
	                xOutStopper1 => "MB3664");
	    END_REGION
	    
	    //Block 2 ENDE
	    REGION TRO 361 (1Sep1Switch)+Scanner(BX3131)
	        #TRO361.stInSeparator1.Settings.nSeparatorNo := "cSep361.1";
	        #TRO361.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO361.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO361.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO361.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO361.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4334"];
	        #TRO361.stInSenJam2 := "DB_Inputs".Sensors["cInBG4335"];
	        #TRO361.stInSenJam3 := "DB_Inputs".Sensors["cInBG4336"];
	        
	        #TRO361.stInSwitch1.Settings.nSwitchNo := "cSwi361.1";
	        #TRO361.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO361.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO361.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO361.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO361.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO361.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3131"].xInCamTriggerReady := "bx3131-TriggerReady";
	        #arCognexInterface["cScannerBX3131"].xInCamTriggerAck := "bx3131-TriggerAck";
	        #arCognexInterface["cScannerBX3131"].xInCamResultsAvailable := "bx3131-Results Available";
	        #arCognexInterface["cScannerBX3131"].xInCamGeneralFault := "bx3131-General Fault";
	        #arCognexInterface["cScannerBX3131"].hwInCamInspectionResults := "=A01+UC033-BX3131~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO361.stInPriorityManagerDir1.xReleaseOk := TRUE;
	        #TRO361.stInPriorityManagerDir2.xReleaseOk := TRUE;
	        
	        #stJamDataHandoverJam1309.Config.nCapacitySet := 1; //
	        
	        #TRO361(nInMainTroNo := "cMainTro361",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO361 AND ("IO_Device_UH03_TO_UH01".stCarrierL2toL1_3[1].nBarcode = 0), //zwecks Übergabe warten bis UH02 Daten abgeholt hat,
	                xInCarouselRun1 := #fbSortConv2304.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbSortConv2304.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO361,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3131"],
	                arInOutJamEntr1 := "DB_JamArea2304".stJam2304_1.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2304".stJam2304_1.stData,
	                arInOutJamExit2 := "IO_Device_UH03_TO_UH01".stCarrierL2toL1_3, //#arCarrierHandoverJam1309, // Übergabe
	                stInOutJamExit2 := #stJamDataHandoverJam1309,
	                arInOutJamExit3 := "DB_JamArea2304".stJam2304_2.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2304".stJam2304_2.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro361"],
	                xOutStopper1 => "MB4334",
	                xOutSw1ExTo3 => "MB4335");
	        
	        "bx3131-TriggerEnable" := #arCognexInterface["cScannerBX3131"].xOutCamTriggerEnable;
	        "bx3131-Trigger" := #arCognexInterface["cScannerBX3131"].xOutCamTrigger;
	        "bx3131-ResultsAck" := #arCognexInterface["cScannerBX3131"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO361.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO361.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2304".stJam2304_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi361.1",
	                           nOutDirection => #TRO361.nInDirection,
	                           InOutCarrier := "DB_JamArea2304".stJam2304_1.arCarrier[1]);
	            
	        END_REGION
	        
	        REGION Übergabe Level 1
	            //todo: sicherstellen das UH02 ready ist, ansonsten sollte UH03 warten... 
	            "FB_I-Device_SendCarrier_J1309"(xInTrigger := (#TRO361.nState = 2500) AND #TRO361.stActRequest.nDirection = 1 AND #TRO361.fbSeparator1.xOutTrolleyReleasedEdge, //Trigger
	                                            xInAck := "IO_Device_UH02_FROM_UH01".bCARRIER_CONTROL_1.%X2, //von Empfänger
	                                            stInOutData := "IO_Device_UH03_TO_UH01".stCarrierL2toL1_3[1], //Daten
	                                            xOutReq := "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL_1.%X2); //an Empfänger
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 362 (1Sep1Switch)+Scanner(BX3132)
	        #TRO362.stInSeparator1.Settings.nSeparatorNo := "cSep362.1";
	        #TRO362.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO362.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO362.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO362.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO362.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4337"];
	        #TRO362.stInSenJam2 := "DB_Inputs".Sensors["cInBG4263"];
	        #TRO362.stInSenJam3 := "DB_Inputs".Sensors["cInBG4323"];
	        
	        #TRO362.stInSwitch1.Settings.nSwitchNo := "cSwi362.1";
	        #TRO362.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO362.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO362.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO362.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO362.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO362.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3132"].xInCamTriggerReady := "bx3132-TriggerReady";
	        #arCognexInterface["cScannerBX3132"].xInCamTriggerAck := "bx3132-TriggerAck";
	        #arCognexInterface["cScannerBX3132"].xInCamResultsAvailable := "bx3132-Results Available";
	        #arCognexInterface["cScannerBX3132"].xInCamGeneralFault := "bx3132-General Fault";
	        #arCognexInterface["cScannerBX3132"].hwInCamInspectionResults := "=A01+UC033-BX3132~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO362.stInSettings.xCar2NecRight := TRUE;
	        #TRO362.stInSettings.xCar2NecLeft := TRUE;
	        #TRO362.stInSettings.xPrioDir1 := TRUE;
	        #TRO362.stInSettings.xPrioDir2 := TRUE;
	        
	        #TRO362(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO362_3.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO362_3.TroOut,
	                stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO362_4.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO362_4.TroOut,
	                nInMainTroNo := "cMainTro362",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO362,
	                xInCarouselRun1 := #fbSortConv2303.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbSortConv2304.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO362,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3132"],
	                arInOutJamEntr1 := "DB_JamArea2304".stJam2304_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2304".stJam2304_2.stData,
	                arInOutJamExit2 := "DB_JamArea2303".stJam2303_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2303".stJam2303_1.stData,
	                arInOutJamExit3 := "DB_JamArea2304".stJam2304_3.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2304".stJam2304_3.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro362"],
	                xOutStopper1 => "MB4337",
	                xOutSw1ExTo3 => "MB4261");
	        
	        "bx3132-TriggerEnable" := #arCognexInterface["cScannerBX3132"].xOutCamTriggerEnable;
	        "bx3132-Trigger" := #arCognexInterface["cScannerBX3132"].xOutCamTrigger;
	        "bx3132-ResultsAck" := #arCognexInterface["cScannerBX3132"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO362.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO362.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2304".stJam2304_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi362.1",
	                           nOutDirection => #TRO362.nInDirection,
	                           InOutCarrier := "DB_JamArea2304".stJam2304_2.arCarrier[1]);
	            
	        END_REGION
	        
	        
	    END_REGION
	    
	    REGION TRO 363 (1Sep1Switch)+Scanner(BX3137)
	        #TRO363.stInSeparator1.Settings.nSeparatorNo := "cSep363.1";
	        #TRO363.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO363.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO363.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO363.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO363.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3960"];
	        #TRO363.stInSenJam3 := "DB_Inputs".Sensors["cInBG3961"];
	        
	        #TRO363.stInSwitch1.Settings.nSwitchNo := "cSwi363.1";
	        #TRO363.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO363.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO363.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO363.stInSwitch1.Settings.nTo1Destinations := 4; //Info nötig für HMI
	
	        #TRO363.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO363.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3137"].xInCamTriggerReady := "bx3137-TriggerReady";
	        #arCognexInterface["cScannerBX3137"].xInCamTriggerAck := "bx3137-TriggerAck";
	        #arCognexInterface["cScannerBX3137"].xInCamResultsAvailable := "bx3137-Results Available";
	        #arCognexInterface["cScannerBX3137"].xInCamGeneralFault := "bx3137-General Fault";
	        #arCognexInterface["cScannerBX3137"].hwInCamInspectionResults := "=A01+UC032-BX3137~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO363.stInSettings.xCar2NecRight := FALSE;
	        #TRO363.stInSettings.xCar2NecLeft := FALSE;
	        #TRO363.stInSettings.xPrioDir1 := TRUE;
	        #TRO363.stInSettings.xPrioDir2 := FALSE;
	        
	    //    "DB_JamArea2301".stJam2301_1.arCarrier[1].nDestination := "cDestF2HEmpty";
	        
	        #TRO363(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO363.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO363.TroOut,
	                nInMainTroNo := "cMainTro363",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO363,
	                xInCarouselRun1 := #fbExitConv2301.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv2301.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO363,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3137"],
	                arInOutJamEntr1 := "DB_JamArea2301".stJam2301_1.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2301".stJam2301_1.stData,
	                arInOutJamExit2 := "DB_JamArea2301".stJam2301_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2301".stJam2301_2.stData,
	                arInOutJamExit3 := "DB_JamArea2305".stJam2305_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2305".stJam2305_1.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro363"],
	                xOutStopper1 => "MB3960",
	                xOutSw1ExTo4 => "MB3961");
	        
	        "bx3137-TriggerEnable" := #arCognexInterface["cScannerBX3137"].xOutCamTriggerEnable;
	        "bx3137-Trigger" := #arCognexInterface["cScannerBX3137"].xOutCamTrigger;
	        "bx3137-ResultsAck" := #arCognexInterface["cScannerBX3137"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO363.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO363.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2301".stJam2301_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi363.1",
	                           nOutDirection => #TRO363.nInDirection,
	                           InOutCarrier := "DB_JamArea2301".stJam2301_1.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 364 (1Sep1Switch)+Scanner(BX3138)
	        #TRO364.stInSeparator1.Settings.nSeparatorNo := "cSep364.1";
	        #TRO364.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO364.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO364.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO364.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO364.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4020"];
	        #TRO364.stInSenJam2 := "DB_Inputs".Sensors["cInBG4021"];
	        
	        #TRO364.stInSwitch1.Settings.nSwitchNo := "cSwi361.1";
	        #TRO364.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO364.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO364.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO364.stInSwitch1.Settings.nTo1Destinations := 4; //Info nötig für HMI
	        
	        #TRO364.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO364.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3138"].xInCamTriggerReady := "bx3138-TriggerReady";
	        #arCognexInterface["cScannerBX3138"].xInCamTriggerAck := "bx3138-TriggerAck";
	        #arCognexInterface["cScannerBX3138"].xInCamResultsAvailable := "bx3138-Results Available";
	        #arCognexInterface["cScannerBX3138"].xInCamGeneralFault := "bx3138-General Fault";
	        #arCognexInterface["cScannerBX3138"].hwInCamInspectionResults := "=A01+UC032-BX3138~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO364.stInSettings.xCar2NecLeft := TRUE;
	        #TRO364.stInSettings.xCar2NecRight := FALSE;
	        #TRO364.stInSettings.xPrioDir2 := FALSE;
	        #TRO364.stInSettings.xPrioDir1 := TRUE;
	        
	        #TRO364(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO364.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO364.TroOut,
	                nInMainTroNo := "cMainTro364",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO364,
	                xInCarouselRun1 := #fbExitConv2301.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv2302.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO364,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3138"],
	                arInOutJamEntr1 := "DB_JamArea2301".stJam2301_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2301".stJam2301_2.stData,
	                arInOutJamExit2 := "DB_JamArea2302".stJam2302_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2302".stJam2302_3.stData,
	                arInOutJamExit3 := "DB_JamArea2306".stJam2306_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2306".stJam2306_1.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro364"],
	                xOutStopper1 => "MB4020",
	                xOutSw1ExTo4 => "MB4021");
	        
	        "bx3138-TriggerEnable" := #arCognexInterface["cScannerBX3138"].xOutCamTriggerEnable;
	        "bx3138-Trigger" := #arCognexInterface["cScannerBX3138"].xOutCamTrigger;
	        "bx3138-ResultsAck" := #arCognexInterface["cScannerBX3138"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO364.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO364.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2301".stJam2301_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi364.1",
	                           nOutDirection => #TRO364.nInDirection,
	                           InOutCarrier := "DB_JamArea2301".stJam2301_2.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 365 (1Sep1Switch)+Scanner(BX3140)
	        #TRO365.stInSeparator1.Settings.nSeparatorNo := "cSep365.1";
	        #TRO365.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO365.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO365.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO365.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO365.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4140"];
	        #TRO365.stInSenJam2 := "DB_Inputs".Sensors["cInBG4141"];
	        
	        #TRO365.stInSwitch1.Settings.nSwitchNo := "cSwi365.1";
	        #TRO365.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO365.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO365.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO365.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO365.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO365.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3140"].xInCamTriggerReady := "bx3140-TriggerReady";
	        #arCognexInterface["cScannerBX3140"].xInCamTriggerAck := "bx3140-TriggerAck";
	        #arCognexInterface["cScannerBX3140"].xInCamResultsAvailable := "bx3140-Results Available";
	        #arCognexInterface["cScannerBX3140"].xInCamGeneralFault := "bx3140-General Fault";
	        #arCognexInterface["cScannerBX3140"].hwInCamInspectionResults := "=A01+UC032-BX3140~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO365.stInSettings.xCar2NecRight := FALSE;
	        #TRO365.stInSettings.xCar2NecLeft := FALSE;
	        #TRO365.stInSettings.xPrioDir1 := FALSE;
	        #TRO365.stInSettings.xPrioDir2 := TRUE;
	        
	        #TRO365(stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO365.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO365.TroOut,
	                nInMainTroNo := "cMainTro365",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO365,
	                xInCarouselRun1 := #fbExitConv2302.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv2302.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO365,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3140"],
	                arInOutJamEntr1 := "DB_JamArea2302".stJam2302_1.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2302".stJam2302_1.stData,
	                arInOutJamExit2 := "DB_JamArea2308".stJam2308_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2308".stJam2308_1.stData,
	                arInOutJamExit3 := "DB_JamArea2302".stJam2302_2.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2302".stJam2302_2.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro365"],
	                xOutStopper1 => "MB4140",
	                xOutSw1ExTo3 => "MB4141");
	        
	        "bx3140-TriggerEnable" := #arCognexInterface["cScannerBX3140"].xOutCamTriggerEnable;
	        "bx3140-Trigger" := #arCognexInterface["cScannerBX3140"].xOutCamTrigger;
	        "bx3140-ResultsAck" := #arCognexInterface["cScannerBX3140"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO365.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO365.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2302".stJam2302_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi365.1",
	                           nOutDirection => #TRO365.nInDirection,
	                           InOutCarrier := "DB_JamArea2302".stJam2302_1.arCarrier[1]);
	            
	        END_REGION
	        
	        
	    END_REGION
	    
	    REGION TRO 366 (1Sep1Switch)+Scanner(BX3139)
	        #TRO366.stInSeparator1.Settings.nSeparatorNo := "cSep366.1";
	        #TRO366.stInSeparator1.Settings.SendOverJamTimeOut := TRUE; //true = alter Sep
	        #TRO366.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO366.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO366.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO366.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO366.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4080"];
	        #TRO366.stInSenJam2 := "DB_Inputs".Sensors["cInBG4081"];
	        
	        #TRO366.stInSwitch1.Settings.nSwitchNo := "cSwi366.1";
	        #TRO366.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO366.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO366.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO366.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO366.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX3139"].xInCamTriggerReady := "bx3139-TriggerReady";
	        #arCognexInterface["cScannerBX3139"].xInCamTriggerAck := "bx3139-TriggerAck";
	        #arCognexInterface["cScannerBX3139"].xInCamResultsAvailable := "bx3139-Results Available";
	        #arCognexInterface["cScannerBX3139"].xInCamGeneralFault := "bx3139-General Fault";
	        #arCognexInterface["cScannerBX3139"].hwInCamInspectionResults := "=A01+UC032-BX3139~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO366.stInSettings.xCar2NecRight := TRUE;
	        #TRO366.stInSettings.xCar2NecLeft := FALSE;
	        #TRO366.stInSettings.xPrioDir1 := FALSE;
	        #TRO366.stInSettings.xPrioDir2 := TRUE;
	        
	        #TRO366(stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO366.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO366.TroOut,
	                nInMainTroNo := "cMainTro366",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO366,
	                xInCarouselRun1 := #fbExitConv2302.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv2301.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO366,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX3139"],
	                arInOutJamEntr1 := "DB_JamArea2302".stJam2302_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2302".stJam2302_2.stData,
	                arInOutJamExit2 := "DB_JamArea2307".stJam2307_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2307".stJam2307_1.stData,
	                arInOutJamExit3 := "DB_JamArea2302".stJam2302_3.arCarrier,
	                stInOutJamExit3 := "DB_JamArea2302".stJam2302_3.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro366"],
	                xOutStopper1 => "MB4080",
	                xOutSw1ExTo3 => "MB4081");
	        
	        "bx3139-TriggerEnable" := #arCognexInterface["cScannerBX3139"].xOutCamTriggerEnable;
	        "bx3139-Trigger" := #arCognexInterface["cScannerBX3139"].xOutCamTrigger;
	        "bx3139-ResultsAck" := #arCognexInterface["cScannerBX3139"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO366.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO366.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea2302".stJam2302_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi366.1",
	                           nOutDirection => #TRO366.nInDirection,
	                           InOutCarrier := "DB_JamArea2302".stJam2302_2.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 367 (1Sep)
	        #TRO367.stInSeparator1.Settings.nSeparatorNo := "cSep360.1";
	        #TRO367.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO367.stInSeparator1.Settings.tTrailingTime := T#300ms;
	        #TRO367.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO367.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO367.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO367.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO367.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO367.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4085"];
	        #TRO367.stInSenJam2 := "DB_Inputs".Sensors["cInBG4092"];
	        
	        #TRO367(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO367.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO367.TroOut,
	                nInMainTroNo := "cMainTro367",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO367,
	                xInCancel := "cTodoFalse",
	                xInCarouselRun := #fbExitConv2302.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2302".stJam2302_3.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea2302".stJam2302_3.stData,
	                arInOutJamExit2 := "DB_JamArea2302".stJam2302_4.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2302".stJam2302_4.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO367,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro367"],
	                xOutStopper1 => "MB4085");
	    END_REGION
	    
	    REGION TRO 368 (Vario, from Lvl1)
	        
	        #TRO368.stInSeparator1.Settings.nSeparatorNo := "cSep368.1";
	        #TRO368.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO368.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO368.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO368.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO368.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO368.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO368.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO368.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4095"];
	        
	        #TRO368.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO368.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO368.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4097"]; //Finger in Pos
	        #TRO368.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4096"]; //MT in Pos
	        #TRO368.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4093"]; // Conveyor full
	        #TRO368.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4090"]; // Jam detector
	        
	        #TRO368.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO368.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO368.stInVario.Settings.tConvEmpty := T#25000ms;
	        #TRO368.stInVario.Settings.nCountCarrier := 1;
	        #TRO368.stInVario.Settings.tWaitForStop := t#3s;
	        
	        #TRO368.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	      //  #TRO368.stInSettings.xIsBorner := TRUE;
	        #TRO368(nInMainTroNo := "cMainTro368",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO368,
	                xInAutomatic := #t_Automatik_OF3,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0204",
	                arInOutJamEntr := "DB_JamArea2309".stJam2309_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2309".stJam2309_1.stData,
	                arInOutJamFinger := "DB_JamArea2309".stJam2309_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2309".stJam2309_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO368,
	                xOutStopper => "MB4095",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro368"],
	                xOutVarioMotor => "MA0204");
	        
	        REGION Übernahme von Level 2
	            "FB_I-Device_Receive_J2309"(xInReq := "IO_Device_UH02_FROM_UH01".bCARRIER_CONTROL_1.%X5,
	                                        stInData := "IO_Device_UH02_FROM_UH01".stCARRIER_INFO_2[1],
	                                        xInOutAck := "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL_1.%X5);
	            
	            
	            IF "FB_I-Device_Receive_J2309".xOutNewData THEN //1 Zyklus vom Baustein
	                //Daten von UH03 in UH02 Jam schieben
	                "FC_TSHR_AddAtEnd"(stInTrolley := "FB_I-Device_Receive_J2309".stOutData,
	                                   nOutCounter => #tmpTSHRCounter,
	                                   xOutResult => #tmpTSHRResult,
	                                   arTSHR := "DB_JamArea2309".stJam2309_1.arCarrier);
	            END_IF;
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 369 (1Sep)
	        #TRO369.stInSeparator1.Settings.nSeparatorNo := "cSep369.1";
	        #TRO369.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO369.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO369.stInSeparator1.Settings.tHandlingTime := t#200ms;
	        #TRO369.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO369.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO369.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO369.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO369.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4091"];
	        #TRO369.stInSenJam2 := "DB_Inputs".Sensors["cInBG4092"];
	        
	        #TRO369.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO369.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO369(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO369.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO369.TroOut,
	                nInMainTroNo := "cMainTro369",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO369,
	                xInCancel := "cTodoFalse",
	                xInCarouselRun := #fbExitConv2302.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2309".stJam2309_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea2309".stJam2309_2.stData,
	                arInOutJamExit2 := "DB_JamArea2302".stJam2302_4.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2302".stJam2302_4.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO369,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro369"],
	                xOutStopper1 => "MB4091");
	    END_REGION
	    
	    REGION TRO 370 (1Sep)
	        #TRO370.stInSeparator1.Settings.nSeparatorNo := "cSep370.1";
	        #TRO370.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO370.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO370.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO370.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO370.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO370.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4145"];
	        #TRO370.stInSenJam2 := "DB_Inputs".Sensors["cInBG4152"];
	        
	        #TRO370.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #stJamDataHandoverJam1601.Config.nCapacitySet := 1;
	        
	        #TRO370(nInMainTroNo := "cMainTro370",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO370 AND ("IO_Device_UH03_TO_UH01".stCARRIER_INFO_2[1].nBarcode = 0), //zwecks Übergabe warten bis UH02 Daten abgeholt hat,
	                xInCarouselRun := #fbExitConv2302.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2302".stJam2302_4.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea2302".stJam2302_4.stData,
	                arInOutJamExit2 := "IO_Device_UH03_TO_UH01".stCARRIER_INFO_2,
	                stInOutJamExit2 := #stJamDataHandoverJam1601,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO370,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro370"],
	                xOutStopper1 => "MB4145");
	        
	        "MB4146" := TRUE;
	        
	        REGION Übergabe Level 1
	            //todo: sicherstellen das UH02 ready ist, ansonsten sollte UH03 warten... 
	            "FB_I-Device_SendCarrier_J1601"(xInTrigger := (#TRO370.nState = 2500) AND #TRO370.fbSeparator1.xOutTrolleyReleasedEdge, //Trigger
	                                            xInAck := "IO_Device_UH02_FROM_UH01".bCARRIER_CONTROL.%X2, //von Empfänger
	                                            stInOutData := "IO_Device_UH03_TO_UH01".stCARRIER_INFO_2[1], //Daten
	                                            xOutReq := "IO_Device_UH03_TO_UH01".bCARRIER_CONTROL.%X2); //an Empfänger
	        END_REGION
	        
	    END_REGION; 
	    
	    
	    REGION TRO 372 (Vario)
	        
	        #TRO372.stInSeparator1.Settings.nSeparatorNo := "cSep372.1";
	        #TRO372.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO372.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO372.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO372.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO372.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO372.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO372.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO372.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3964"];
	        
	        #TRO372.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO372.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO372.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3963"]; //Pusher Dog in Pos
	        #TRO372.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3967"]; //MT in Pos
	        #TRO372.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4206"]; // Conveyor full
	        #TRO372.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4205"]; // Jam detector
	        
	        #TRO372.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO372.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO372.stInVario.Settings.tConvEmpty := T#30000ms;
	        #TRO372.stInVario.Settings.nCountCarrier := 1;
	        #TRO372.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO372.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO372(nInMainTroNo := "cMainTro372",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF3 AND "SF0190" AND "SF0240",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0191" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0262",
	                xInRelease := "DB_TRO_Test".TRO372,
	                arInOutJamEntr := "DB_JamArea2305".stJam2305_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2305".stJam2305_1.stData,
	                arInOutJamFinger := "DB_JamArea2305".stJam2305_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2305".stJam2305_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO372,
	                xOutStopper => "MB3964",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro372"],
	                xOutVarioMotor => "MA0262");
	        
	    END_REGION
	    
	    REGION TRO 373 (1Sep)
	        #TRO373.stInSeparator1.Settings.nSeparatorNo := "cSep373.1";
	        #TRO373.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO373.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO373.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO373.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO373.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO373.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO373.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO373.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO373.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4204"];
	        #TRO373.stInSenJam2 := "DB_Inputs".Sensors["cInBG4203"];
	        
	        #TRO373.stInSeparator1.Settings.tSenFree := T#3500ms;
	        #TRO373.stInSeparator1.Settings.tSenWait := T#5000ms;
	        
	        #TRO373(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO373.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO373.TroOut,
	                nInMainTroNo := "cMainTro373",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO373,
	                xInCancel := "cTodoFalse",
	                xInCarouselRun := #fbSortConv2303.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2305".stJam2305_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2305".stJam2305_2.stData,
	                arInOutJamExit2 := "DB_JamArea2303".stJam2303_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2303".stJam2303_2.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO373,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro373"],
	                xOutStopper1 => "MB4204");
	    END_REGION
	    
	    REGION TRO 375 (Vario)
	        
	        #TRO375.stInSeparator1.Settings.nSeparatorNo := "cSep375.1";
	        #TRO375.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO375.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO375.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO375.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO375.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO375.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO375.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO375.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4024"];
	        
	        #TRO375.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO375.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO375.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4023"]; //Pusher Dog in Pos
	        #TRO375.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4027"]; //MT in Pos
	        #TRO375.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4266"]; // Conveyor full
	        #TRO375.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4265"]; // Jam detector
	        
	        #TRO375.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO375.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO375.stInVario.Settings.tConvEmpty := T#30000ms;
	        #TRO375.stInVario.Settings.nCountCarrier := 1;
	        #TRO375.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO375.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO375(nInMainTroNo := "cMainTro375",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF3 AND "SF0192" AND "SF0242",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0193" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0263",
	                xInRelease := "DB_TRO_Test".TRO375,
	                arInOutJamEntr := "DB_JamArea2306".stJam2306_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2306".stJam2306_1.stData,
	                arInOutJamFinger := "DB_JamArea2306".stJam2306_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2306".stJam2306_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO375,
	                xOutStopper => "MB4024",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro375"],
	                xOutVarioMotor => "MA0263");
	        
	    END_REGION
	    
	    REGION TRO 376 (1Sep)
	        #TRO376.stInSeparator1.Settings.nSeparatorNo := "cSep376.1";
	        #TRO376.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO376.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO376.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO376.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO376.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO376.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO376.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO376.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO376.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4264"];
	        #TRO376.stInSenJam2 := "DB_Inputs".Sensors["cInBG4263"];
	        
	        #TRO376.stInSeparator1.Settings.tSenFree := T#3500ms;
	        #TRO376.stInSeparator1.Settings.tSenWait := T#5000ms;
	        
	      //  "DB_JamArea2306".stJam2306_2.arCarrier[1].nDestination := 23200;
	        
	        #TRO376(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO376.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO376.TroOut,
	                nInMainTroNo := "cMainTro376",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO376,
	                xInCancel := "cTodoFalse",
	                xInCarouselRun := #fbSortConv2303.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2306".stJam2306_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2306".stJam2306_2.stData,
	                arInOutJamExit2 := "DB_JamArea2303".stJam2303_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2303".stJam2303_1.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO376,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro376"],
	                xOutStopper1 => "MB4264");
	        
	    END_REGION
	    
	    REGION TRO 378 (Vario)
	        
	        #TRO378.stInSeparator1.Settings.nSeparatorNo := "cSep378.1";
	        #TRO378.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO378.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO378.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO378.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO378.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO378.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO378.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO378.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO378.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO378.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4084"];
	        
	        #TRO378.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO378.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO378.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4083"]; //Pusher Dog in Pos
	        #TRO378.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4087"]; //MT in Pos
	        #TRO378.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4326"]; // Conveyor full
	        #TRO378.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4325"]; // Jam detector
	        
	        #TRO378.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO378.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO378.stInVario.Settings.tConvEmpty := T#30000ms;
	        #TRO378.stInVario.Settings.nCountCarrier := 1;
	        #TRO378.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO378.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO378(nInMainTroNo := "cMainTro378",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF3 AND "SF0194" AND "SF0244",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0195" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0264",
	                xInRelease := "DB_TRO_Test".TRO378,
	                arInOutJamEntr := "DB_JamArea2307".stJam2307_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2307".stJam2307_1.stData,
	                arInOutJamFinger := "DB_JamArea2307".stJam2307_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2307".stJam2307_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO378,
	                xOutStopper => "MB4084",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro378"],
	                xOutVarioMotor => "MA0264");
	        
	    END_REGION
	    
	    REGION TRO 379 (1Sep)
	        #TRO379.stInSeparator1.Settings.nSeparatorNo := "cSep379.1";
	        #TRO379.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO379.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO379.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO379.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO379.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO379.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO379.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO379.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO379.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4324"];
	        #TRO379.stInSenJam2 := "DB_Inputs".Sensors["cInBG4323"];
	        
	        #TRO379.stInSeparator1.Settings.tSenFree := T#3500ms;
	        #TRO379.stInSeparator1.Settings.tSenWait := T#5000ms;
	        
	     //   "DB_JamArea2307".stJam2307_2.arCarrier[1].nDestination := 23300;
	        
	        #TRO379(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO379.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO379.TroOut,
	                nInMainTroNo := "cMainTro379",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO379,
	                xInCancel := "cTodoFalse",
	                xInCarouselRun := #fbSortConv2304.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2307".stJam2307_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2307".stJam2307_2.stData,
	                arInOutJamExit2 := "DB_JamArea2304".stJam2304_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2304".stJam2304_3.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO379,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro379"],
	                xOutStopper1 => "MB4324");
	        
	    END_REGION
	    
	    REGION TRO 381 (Vario)
	        
	        #TRO381.stInSeparator1.Settings.nSeparatorNo := "cSep381.1";
	        #TRO381.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO381.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO381.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO381.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO381.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO381.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO381.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO381.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO381.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO381.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4144"];
	        
	        #TRO381.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO381.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO381.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4143"]; //Pusher Dog in Pos
	        #TRO381.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4147"]; //MT in Pos
	        #TRO381.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4386"]; // Conveyor full
	        #TRO381.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4385"]; // Jam detector
	        
	        #TRO381.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO381.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO381.stInVario.Settings.tConvEmpty := T#30000ms;
	        #TRO381.stInVario.Settings.nCountCarrier := 1;
	        #TRO381.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO381.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO381(nInMainTroNo := "cMainTro381",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF3 AND "SF0196" AND "SF0246",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0197" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0265",
	                xInRelease := "DB_TRO_Test".TRO381,
	                arInOutJamEntr := "DB_JamArea2308".stJam2308_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea2308".stJam2308_1.stData,
	                arInOutJamFinger := "DB_JamArea2308".stJam2308_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2308".stJam2308_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO381,
	                xOutStopper => "MB4144",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro381"],
	                xOutVarioMotor => "MA0265");
	        
	    END_REGION
	    
	    REGION TRO 382 (1Sep)
	        #TRO382.stInSeparator1.Settings.nSeparatorNo := "cSep382.1";
	        #TRO382.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO382.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO382.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO382.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO382.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO382.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO382.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO382.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO382.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4384"];
	        #TRO382.stInSenJam2 := "DB_Inputs".Sensors["cInBG4383"];
	        
	        #TRO382.stInSeparator1.Settings.tSenFree := T#3500ms;
	        #TRO382.stInSeparator1.Settings.tSenWait := T#5000ms;
	        
	    //    "DB_JamArea2308".stJam2308_2.arCarrier[1].nDestination := 23400;
	        
	        #TRO382(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO382.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO382.TroOut,
	                nInMainTroNo := "cMainTro382",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO382,
	                xInCarouselRun := #fbSortConv2304.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea2308".stJam2308_2.arCarrier,
	                stInOutJamEntr1:= "DB_JamArea2308".stJam2308_2.stData,
	                arInOutJamExit2 := "DB_JamArea2304".stJam2304_4.arCarrier,
	                stInOutJamExit2 := "DB_JamArea2304".stJam2304_4.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO382,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro382"],
	                xOutStopper1 => "MB4384");
	        
	    END_REGION
	    
	    REGION TRO 383 (1Sep)
	        
	(*        #TRO383.stInSeparator1.Settings.nSeparatorNo := "cSep381.1";//to do
	        #TRO383.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO383.stInSeparator1.Settings.tSenWait := T#4300ms;
	        #TRO383.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO383.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO383.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO383.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO383.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        // #TRO383.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4450"];
	        
	        #TRO383.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO383.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        // #TRO383.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4451"]; //Pusher Dog in Pos
	        //MT in Pos "DB_Inputs".Sensors["cInBG4452"]
	        #TRO383.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4442"]; // Conveyor full
	        #TRO383.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4441"]; // Jam detector
	        
	        #TRO383.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO383.stInVario.Settings.tWaitForJog := T#400ms;
	        // #TRO383.stInVario.Settings.tConvEmpty := T#8000ms;
	        #TRO383.stInVario.Settings.nCountCarrier := 1;
	        
	        // #TRO383.stInSettings.sJamSrc := 'xxx';
	        // #TRO383.stInSettings.sJamDest := 'yyy';
	        
	        #TRO383(nInMainTroNo := "cMainTro381",//to do
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMain.Q,
	                xInAllRdyToStart := TRUE,
	                xInReset := "cTodoFalse",
	                // xInMotorProtection := "FC0265", to do
	                // xInRelease := "DB_Interface_HMI".arJams[x].stJamConfig.xLockExit,
	                arInOutJamEntr := "DB_JamArea2308".stJam2308_1.arCarrier,//JAMS TO DO
	                stInOutJamEntr := "DB_JamArea2308".stJam2308_1.stData,
	                arInOutJamFinger := "DB_JamArea2308".stJam2308_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea2308".stJam2308_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinet,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO381,//to do
	                // xOutStopper => "MB4450",
	                // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro383"],
	                xOutVarioMotor => "MA0073"); *)
	        
	    END_REGION
	    
	END_REGION
END_FUNCTION_BLOCK

