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

   VAR 
      fbSortConv1101 : "FB_Conveyor_Sort";   // Pin-Kreisel
      fbSortConv1102 : "FB_Conveyor_Sort";   // Pin-Kreisel
      fbSortConv1201 : "FB_Conveyor_Sort";   // Pin-Kreisel
      fbSortConv1202 : "FB_Conveyor_Sort";   // Pin-Kreisel
      fbSortConv1303 : "FB_Conveyor_Sort";   // Pin-Kreisel
      fbSortConv1304 : "FB_Conveyor_Sort";   // Pin-Kreisel
      fbCarousel1110 : "FB_Conveyor";   // Kreisel
      fbExitConv1103 : "FB_Conveyor";   // Kreisel
      fbExitConv1104 : "FB_Conveyor";   // Kreisel
      fbExitConv1203 : "FB_Conveyor";   // Kreisel
      fbExitConv1204 : "FB_Conveyor";   // Kreisel
      fbExitConv1301 : "FB_Conveyor";   // Kreisel
      fbExitConv1302 : "FB_Conveyor";   // Kreisel
      fbPinControl1101_1 : "FB_SupervisionRasterSensor";   // Pin-Überwachung mit "Zappler"-Sensor
      fbPinControl1101_2 : "FB_SupervisionRasterSensor";
      fbPinControl1102_1 : "FB_SupervisionRasterSensor";   // Pin-Überwachung mit "Zappler"-Sensor
      fbPinControl1102_2 : "FB_SupervisionRasterSensor";
      fbPinControl1201_1 : "FB_SupervisionRasterSensor";   // Pin-Überwachung mit "Zappler"-Sensor
      fbPinControl1201_2 : "FB_SupervisionRasterSensor";
      fbPinControl1202_1 : "FB_SupervisionRasterSensor";   // Pin-Überwachung mit "Zappler"-Sensor
      fbPinControl1202_2 : "FB_SupervisionRasterSensor";
      fbPinControl1303_1 : "FB_SupervisionRasterSensor";   // Pin-Überwachung mit "Zappler"-Sensor
      fbPinControl1303_2 : "FB_SupervisionRasterSensor";
      fbPinControl1304_1 : "FB_SupervisionRasterSensor";   // Pin-Überwachung mit "Zappler"-Sensor
      fbPinControl1304_2 : "FB_SupervisionRasterSensor";
      fbMonPinControl1101_1 : "FB_Monitoring";
      fbMonPinControl1101_2 : "FB_Monitoring";
      fbMonPinControl1102_1 : "FB_Monitoring";
      fbMonPinControl1102_2 : "FB_Monitoring";
      fbMonPinControl1201_1 : "FB_Monitoring";
      fbMonPinControl1201_2 : "FB_Monitoring";
      fbMonPinControl1202_1 : "FB_Monitoring";
      fbMonPinControl1202_2 : "FB_Monitoring";
      fbMonPinControl1303_1 : "FB_Monitoring";
      fbMonPinControl1303_2 : "FB_Monitoring";
      fbMonPinControl1304_1 : "FB_Monitoring";
      fbMonPinControl1304_2 : "FB_Monitoring";
      fbEncoderMonitor1101 : "FB_EncoderMonitor";   // Pin-Überwachung mit Encoder Werten
      fbEncoderMonitor1102 : "FB_EncoderMonitor";   // Pin-Überwachung mit Encoder Werten
      fbEncoderMonitor1201 : "FB_EncoderMonitor";   // Pin-Überwachung mit Encoder Werten
      fbEncoderMonitor1202 : "FB_EncoderMonitor";   // Pin-Überwachung mit Encoder Werten
      fbEncoderMonitor1303 : "FB_EncoderMonitor";   // Pin-Überwachung mit Encoder Werten
      fbEncoderMonitor1304 : "FB_EncoderMonitor";   // Pin-Überwachung mit Encoder Werten
      fbEncoderGF2200 : "FB_EncoderTR";   // Encoder
      fbEncoderGF2201 : "FB_EncoderTR";   // Encoder
      fbEncoderGF2202 : "FB_EncoderTR";   // Encoder
      fbEncoderGF2203 : "FB_EncoderTR";   // Encoder
      fbEncoderGF2204 : "FB_EncoderTR";   // Encoder
      fbEncoderGF2205 : "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
      TRO200 : "FB_ILS_MTRO_Vario";
      TRO201 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_1Sep";
      TRO202 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_1Sep1Swi";
      TRO203 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_1Sep1Swi";
      TRO204 : "FB_ILS_MTRO_1Sep1Swi";
      TRO205 : "FB_ILS_MTRO_1Sep1Swi";
      TRO206 : "FB_ILS_MTRO_1Sep1Swi";
      TRO207 : "FB_ILS_MTRO_1Sep";
      TRO208 : "FB_ILS_MTRO_PinStore_Auto";   // Block 1.1.1
      TRO209 : "FB_ILS_MTRO_Vario";   // Rückführung Vario
      TRO210 : "FB_ILS_MTRO_1Sep";   // Rückführung 1Sep
      TRO211 : "FB_ILS_MTRO_PinStore_Auto";   // Block 1.1.2
      TRO212 : "FB_ILS_MTRO_Vario";   // Rückführung Vario
      TRO213 : "FB_ILS_MTRO_1Sep";   // Rückführung 1Sep
      TRO214 : "FB_ILS_MTRO_PinStore_Auto";   // Block 1.1.3
      TRO215 : "FB_ILS_MTRO_Vario";   // Rückführung Vario
      TRO216 : "FB_ILS_MTRO_1Sep";   // Rückführung 1Sep
      TRO217 : "FB_ILS_MTRO_PinStore_Auto";   // Block 1.1.4
      TRO218 : "FB_ILS_MTRO_Vario";   // Rückführung Vario
      TRO219 : "FB_ILS_MTRO_1Sep";   // Rückführung 1Sep
      TRO220 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_Vario";
      TRO221 : "FB_ILS_MTRO_1Sep";
      TRO222 : "FB_ILS_MTRO_1Sep1Swi";
      TRO223 : "FB_ILS_MTRO_1Sep1Swi";
      TRO224 : "FB_ILS_MTRO_1Sep1Swi";
      TRO225 : "FB_ILS_MTRO_1Sep1Swi";
      TRO226 : "FB_ILS_MTRO_1Sep1Swi";
      TRO227 : "FB_ILS_MTRO_1Sep";
      TRO228 : "FB_ILS_MTRO_PinStore_Auto";   // Block 1.2.1
      TRO229 : "FB_ILS_MTRO_Vario";   // Rückführung Vario
      TRO230 : "FB_ILS_MTRO_1Sep";   // Rückführung 1Sep
      TRO231 : "FB_ILS_MTRO_PinStore_Auto";   // Block 1.2.2
      TRO232 : "FB_ILS_MTRO_Vario";
      TRO233 : "FB_ILS_MTRO_1Sep";
      TRO234 : "FB_ILS_MTRO_PinStore_Auto";   // Block 1.2.3
      TRO235 : "FB_ILS_MTRO_Vario";
      TRO236 : "FB_ILS_MTRO_1Sep";
      TRO237 { S7_SetPoint := 'False'} : "FB_ILS_MTRO_PinStore_Auto";   // Block 1.2.2
      TRO238 : "FB_ILS_MTRO_Vario";
      TRO239 : "FB_ILS_MTRO_1Sep";
      TRO240 : "FB_ILS_MTRO_Vario";
      TRO241 : "FB_ILS_MTRO_1Sep";
      TRO242 : "FB_ILS_MTRO_1Sep1Swi";
      TRO243 : "FB_ILS_MTRO_1Sep1Swi";
      TRO244 : "FB_ILS_MTRO_1Sep1Swi";
      TRO245 : "FB_ILS_MTRO_1Sep1Swi";
      TRO246 : "FB_ILS_MTRO_1Sep1Swi";
      TRO247 : "FB_ILS_MTRO_1Sep";
      TRO248 : "FB_ILS_MTRO_PinStore_Auto";   // Block 1.3.1
      TRO249 : "FB_ILS_MTRO_Vario";   // Rückführung Vario
      TRO250 : "FB_ILS_MTRO_1Sep";   // Rückführung 1Sep
      TRO251 : "FB_ILS_MTRO_PinStore_Auto";   // Block 1.3.2
      TRO252 : "FB_ILS_MTRO_Vario";
      TRO253 : "FB_ILS_MTRO_1Sep";
      TRO254 : "FB_ILS_MTRO_PinStore_Auto";   // Block 1.3.3
      TRO255 : "FB_ILS_MTRO_Vario";
      TRO256 : "FB_ILS_MTRO_1Sep";
      TRO257 : "FB_ILS_MTRO_PinStore_Auto";   // Block 1.3.4
      TRO258 : "FB_ILS_MTRO_Vario";
      TRO259 : "FB_ILS_MTRO_1Sep";
      TRO260 : "FB_ILS_MTRO_Vario";
      TRO261 : "FB_ILS_MTRO_1Sep";
      TRO262 : "FB_ILS_MTRO_Vario";
      TRO263 : "FB_ILS_MTRO_1Sep";
      TRO264 : "FB_ILS_MTRO_Vario";
      TRO265 : "FB_ILS_MTRO_1Sep";
      TRO266 : "FB_ILS_MTRO_1Sep";
      TRO267 : "FB_ILS_MTRO_1Sep2Swi";
      TRO268 : "FB_ILS_MTRO_1Sep2Swi";
      TRO269 : "FB_ILS_MTRO_1Sep";
      TRO270 : "FB_ILS_MTRO_Vario";
      TRO271 : "FB_ILS_MTRO_1Sep";
      TRO272 : "FB_ILS_MTRO_Vario";
      TRO273 : "FB_ILS_MTRO_1Sep";
      TRO274 : "FB_ILS_MTRO_1Sep";
      TRO275 : "FB_ILS_MTRO_1Sep";
      xReInit : Bool;
      rTrigReInit {InstructionName := 'R_TRIG'; LibVersion := '1.0'; S7_SetPoint := 'False'} : R_TRIG;
      tOnHeartbeat {InstructionName := 'TON_TIME'; LibVersion := '1.0'} : TON_TIME;
      xSendHB : Bool;
      fTrig_TRO271_TRO306 {InstructionName := 'F_TRIG'; LibVersion := '1.0'} : F_TRIG;
      fTrig_TRO273_TRO307 {InstructionName := 'F_TRIG'; LibVersion := '1.0'} : F_TRIG;
   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";
      arDummyEventCorrectionInfo : Array[0..1] of "stEventCorrectionInfo";
      arCarrierHandoverJam2109 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam2109 : "stJamData";
      arCarrierHandoverJam2209 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam2209 : "stJamData";
      arCarrierHandoverJam2309 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam2309 : "stJamData";
      arCarrierHandoverJam5000 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam5000 : "stJamData";
      arCarrierHandoverJam5001 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam5001 : "stJamData";
      arCarrierHandoverJam4301 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam4301 : "stJamData";
      arCarrierHandoverJam4401 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam4401 : "stJamData";
      arCarrierHandoverJam4701 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam4701 : "stJamData";
      arCarrierHandoverJam1801 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam1801 : "stJamData";
      arCarrierHandoverJam1801_2 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam1801_2 : "stJamData";
      arCarrierHandoverJam4701_2 : Array[1..1] of "stCarrier";
      stJamDataHandoverJam4701_2 : "stJamData";
      tmpTSHRCounter : DInt;
      tmpTSHRResult : Bool;
      nIdxUnloading : Int;
      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
	        
	        #TRO200.nState := "DB_GLOB_TroState".arTroState["cMainTro200"];
	        #TRO201.nState := "DB_GLOB_TroState".arTroState["cMainTro201"];
	        #TRO202.nState := "DB_GLOB_TroState".arTroState["cMainTro202"];
	        #TRO203.nState := "DB_GLOB_TroState".arTroState["cMainTro203"];
	        #TRO204.nState := "DB_GLOB_TroState".arTroState["cMainTro204"];
	        #TRO205.nState := "DB_GLOB_TroState".arTroState["cMainTro205"];
	        #TRO206.nState := "DB_GLOB_TroState".arTroState["cMainTro206"];
	        #TRO207.nState := "DB_GLOB_TroState".arTroState["cMainTro207"];
	        #TRO209.nState := "DB_GLOB_TroState".arTroState["cMainTro209"];
	        #TRO210.nState := "DB_GLOB_TroState".arTroState["cMainTro210"];
	        
	        // #TRO211.nState := "DB_GLOB_TroState".arTroState["cMainTro211"];
	        #TRO212.nState := "DB_GLOB_TroState".arTroState["cMainTro212"];
	        #TRO213.nState := "DB_GLOB_TroState".arTroState["cMainTro213"];
	        // #TRO214.nState := "DB_GLOB_TroState".arTroState["cMainTro214"];
	        #TRO215.nState := "DB_GLOB_TroState".arTroState["cMainTro215"];
	        #TRO216.nState := "DB_GLOB_TroState".arTroState["cMainTro216"];
	        // #TRO217.nState := "DB_GLOB_TroState".arTroState["cMainTro217"];
	        
	        #TRO218.nState := "DB_GLOB_TroState".arTroState["cMainTro218"];
	        #TRO219.nState := "DB_GLOB_TroState".arTroState["cMainTro219"];
	        #TRO220.nState := "DB_GLOB_TroState".arTroState["cMainTro220"];
	        #TRO221.nState := "DB_GLOB_TroState".arTroState["cMainTro221"];
	        #TRO222.nState := "DB_GLOB_TroState".arTroState["cMainTro222"];
	        #TRO223.nState := "DB_GLOB_TroState".arTroState["cMainTro223"];
	        #TRO224.nState := "DB_GLOB_TroState".arTroState["cMainTro224"];
	        #TRO225.nState := "DB_GLOB_TroState".arTroState["cMainTro225"];
	        #TRO226.nState := "DB_GLOB_TroState".arTroState["cMainTro226"];
	        #TRO227.nState := "DB_GLOB_TroState".arTroState["cMainTro227"];
	        // #TRO228.nState := "DB_GLOB_TroState".arTroState["cMainTro228"];
	        #TRO229.nState := "DB_GLOB_TroState".arTroState["cMainTro229"];
	        #TRO230.nState := "DB_GLOB_TroState".arTroState["cMainTro230"];
	        // #TRO231.nState := "DB_GLOB_TroState".arTroState["cMainTro231"];
	        #TRO232.nState := "DB_GLOB_TroState".arTroState["cMainTro232"];
	        // #TRO234.nState := "DB_GLOB_TroState".arTroState["cMainTro234"];
	        #TRO235.nState := "DB_GLOB_TroState".arTroState["cMainTro235"];
	        #TRO236.nState := "DB_GLOB_TroState".arTroState["cMainTro236"];
	        // #TRO237.nState := "DB_GLOB_TroState".arTroState["cMainTro237"];
	        #TRO238.nState := "DB_GLOB_TroState".arTroState["cMainTro238"];
	        #TRO239.nState := "DB_GLOB_TroState".arTroState["cMainTro239"];
	        #TRO240.nState := "DB_GLOB_TroState".arTroState["cMainTro240"];
	        #TRO241.nState := "DB_GLOB_TroState".arTroState["cMainTro241"];
	        #TRO242.nState := "DB_GLOB_TroState".arTroState["cMainTro242"];
	        #TRO243.nState := "DB_GLOB_TroState".arTroState["cMainTro243"];
	        #TRO244.nState := "DB_GLOB_TroState".arTroState["cMainTro244"];
	        #TRO245.nState := "DB_GLOB_TroState".arTroState["cMainTro245"];
	        #TRO246.nState := "DB_GLOB_TroState".arTroState["cMainTro246"];
	        #TRO247.nState := "DB_GLOB_TroState".arTroState["cMainTro247"];
	        // #TRO248.nState := "DB_GLOB_TroState".arTroState["cMainTro248"];
	        #TRO249.nState := "DB_GLOB_TroState".arTroState["cMainTro249"];
	        #TRO250.nState := "DB_GLOB_TroState".arTroState["cMainTro250"];
	        // #TRO251.nState := "DB_GLOB_TroState".arTroState["cMainTro251"];
	        #TRO252.nState := "DB_GLOB_TroState".arTroState["cMainTro252"];
	        #TRO253.nState := "DB_GLOB_TroState".arTroState["cMainTro253"];
	        // #TRO254.nState := "DB_GLOB_TroState".arTroState["cMainTro254"];
	        #TRO255.nState := "DB_GLOB_TroState".arTroState["cMainTro255"];
	        #TRO256.nState := "DB_GLOB_TroState".arTroState["cMainTro256"];
	        // #TRO257.nState := "DB_GLOB_TroState".arTroState["cMainTro257"];
	        #TRO258.nState := "DB_GLOB_TroState".arTroState["cMainTro258"];
	        #TRO259.nState := "DB_GLOB_TroState".arTroState["cMainTro259"];
	        #TRO260.nState := "DB_GLOB_TroState".arTroState["cMainTro260"];
	        #TRO261.nState := "DB_GLOB_TroState".arTroState["cMainTro261"];
	        #TRO262.nState := "DB_GLOB_TroState".arTroState["cMainTro262"];
	        #TRO263.nState := "DB_GLOB_TroState".arTroState["cMainTro263"];
	        #TRO264.nState := "DB_GLOB_TroState".arTroState["cMainTro264"];
	        #TRO265.nState := "DB_GLOB_TroState".arTroState["cMainTro265"];
	        #TRO266.nState := "DB_GLOB_TroState".arTroState["cMainTro266"];
	        #TRO267.nState := "DB_GLOB_TroState".arTroState["cMainTro267"];
	        #TRO268.nState := "DB_GLOB_TroState".arTroState["cMainTro268"];
	        #TRO269.nState := "DB_GLOB_TroState".arTroState["cMainTro269"];
	        #TRO270.nState := "DB_GLOB_TroState".arTroState["cMainTro270"];
	        #TRO271.nState := "DB_GLOB_TroState".arTroState["cMainTro271"];
	        #TRO272.nState := "DB_GLOB_TroState".arTroState["cMainTro272"];
	        #TRO273.nState := "DB_GLOB_TroState".arTroState["cMainTro273"];
	        #TRO274.nState := "DB_GLOB_TroState".arTroState["cMainTro274"];
	        #TRO275.nState := "DB_GLOB_TroState".arTroState["cMainTro275"];
	        
	    END_IF;
	    
	END_REGION
	
	REGION Automatik
	    #t_Automatik_OF1 := "DB_InterfaceSafety".stFromSafety.stMainContactorsUH02.Q; //#stInOutControlUnitCabinetOF1.xRunning AND NOT #stInOutControlUnitCabinetOF1.xStarting AND "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q(* AND "IBN".xAutomatikON *);
	    #t_Automatik_OF2 := "DB_InterfaceSafety".stFromSafety.stMainContactorsUC021.Q; //#stInOutControlUnitCabinetOF2.xRunning AND NOT #stInOutControlUnitCabinetOF2.xStarting AND "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q(* AND "IBN".xAutomatikON *);
	    #t_Automatik_OF3 := "DB_InterfaceSafety".stFromSafety.stMainContactorsUC022.Q; //#stInOutControlUnitCabinetOF3.xRunning AND NOT #stInOutControlUnitCabinetOF3.xStarting AND "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q(* AND "IBN".xAutomatikON *);
	    #t_Automatik_OF4 := "DB_InterfaceSafety".stFromSafety.stMainContactorsUC023.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 1101
	            #fbSortConv1101.Settings.tEnergySafeTime := T#120s; // Konstante TODO
	            #fbSortConv1101.Settings.tStartingTime := T#50ms;
	            #fbSortConv1101.Settings.xGridActive := FALSE;
	            #fbSortConv1101.Settings.sMotorProtectName := 'FC0140';
	            #fbSortConv1101(xInEnabled :=
	                            "SF0120" AND "SF0122" AND
	                            NOT #fbPinControl1101_1.xOutErrorRasterSensor AND
	                            NOT #fbPinControl1101_2.xOutErrorRasterSensor AND
	                            NOT #fbEncoderMonitor1101.xOutError AND
	                            NOT #TRO208.xOutUnloadingError AND
	                            NOT #TRO211.xOutUnloadingError,
	                            xInFull := "cTodoFalse",
	                            xInNextConveyorReady := "cTodoTRUE",
	                            xInAutomaticMode := #t_Automatik_OF2,
	                            xInEnergySafeRequest := NOT #stInOutControlUnitCabinetOF2.xRestart AND NOT #TRO208.xOutConvReqSort AND
	                            NOT #TRO211.xOutConvReqSort AND NOT #TRO210.xOutCarouselReq AND
	                            NOT #TRO213.xOutCarouselReq AND NOT #TRO202.xOutCarouselReq2,
	                            xInChainBreakMonitoring := TRUE,
	                            xInChainBreakMonitoringSmoothing := false,
	                            xInMotorProtectionMonitoring := "FC0140",
	                            xInSafetyEnable := "cTodoTRUE",
	                            xOutPowerContactor => "MA0140",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF2,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".#stConveyors.stSort.stCS1101);
	            
	            REGION Überwachung Pins 1
	                
	                #fbPinControl1101_1.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl1101_1.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl1101_1.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1101_1.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1101_1(stInSenRaster := "DB_Inputs".Sensors["cInBG3061"],
	                                    xInErrorQuit := "SF0121" OR "SF0123" OR "SF0117",
	                                    xInMotorRun := #fbSortConv1101.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl1101_1.stSettings.nErrorType := 1;
	                    #fbMonPinControl1101_1.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl1101_1.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl1101_1.stSettings.tDelay := T#1s;
	                    #fbMonPinControl1101_1(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M1101',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG3061"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF2,
	                                           xInQuitError := #stInOutControlUnitCabinetOF2.xQuitError,
	                                           xInSignal := NOT #fbPinControl1101_1.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	                
	            END_REGION
	            
	            REGION Überwachung Pins 2
	                
	                #fbPinControl1101_2.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl1101_2.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl1101_2.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1101_2.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1101_2(stInSenRaster := "DB_Inputs".Sensors["cInBG3001"],
	                                    xInErrorQuit := "SF0121" OR "SF0123" OR "SF0117",
	                                    xInMotorRun := #fbSortConv1101.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl1101_2.stSettings.nErrorType := 1;
	                    #fbMonPinControl1101_2.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl1101_2.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl1101_2.stSettings.tDelay := T#1s;
	                    #fbMonPinControl1101_2(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M1101',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG3001"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF2,
	                                           xInQuitError := #stInOutControlUnitCabinetOF2.xQuitError,
	                                           xInSignal := NOT #fbPinControl1101_2.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	                
	            END_REGION
	            
	            REGION Überwachung Encoder
	                #fbEncoderMonitor1101(sInConveyor := 'KR-M1101',
	                                      sInEncoder := 'GF2200',
	                                      nInEncoderValue := "GF2200_PosAct",
	                                      nInEncoderMax := "cEncoderGF2200",
	                                      nInEncMonVal := "cEncMonVal",
	                                      xInClock := "Clock_2Hz",
	                                      xInConveyorRun := #fbSortConv1101.xOutConveyorFullSpeed,
	                                      xInQuit := "SF0121" OR "SF0123" OR "SF0117" OR "IBN".xQuitGlob,
	                                      xInActivate := TRUE,
	                                      stInOutControlUnitCabinet:=#stInOutControlUnitCabinetOF2);
	            END_REGION
	            
	        END_REGION
	        
	        REGION Conveyor 1102
	            #fbSortConv1102.Settings.tEnergySafeTime := T#120s; // Konstante TODO
	            #fbSortConv1102.Settings.tStartingTime := T#50ms;
	            #fbSortConv1102.Settings.xGridActive := FALSE;
	            #fbSortConv1102.Settings.sMotorProtectName := 'FC0141';
	            
	            #fbSortConv1102(xInEnabled :=
	                            "SF0124" AND "SF0126" AND
	                            NOT #fbPinControl1102_1.xOutErrorRasterSensor AND
	                            NOT #fbPinControl1102_2.xOutErrorRasterSensor AND
	                            NOT #fbEncoderMonitor1102.xOutError AND
	                            NOT #TRO214.xOutUnloadingError AND
	                            NOT #TRO217.xOutUnloadingError,
	                            xInFull := "cTodoFalse",
	                            xInNextConveyorReady := "cTodoTRUE",
	                            xInAutomaticMode := #t_Automatik_OF2,
	                            xInEnergySafeRequest := NOT #stInOutControlUnitCabinetOF2.xRestart AND NOT #TRO214.xOutConvReqSort AND
	                            NOT #TRO217.xOutConvReqSort AND NOT #TRO216.xOutCarouselReq AND
	                            NOT #TRO219.xOutCarouselReq AND NOT #TRO202.xOutCarouselReq1 AND NOT #TRO202.xOutCarouselReq2 AND NOT #TRO201.xOutCarouselReq,
	                            
	                            xInChainBreakMonitoring := TRUE,
	                            xInChainBreakMonitoringSmoothing := false,
	                            xInMotorProtectionMonitoring := "FC0141",
	                            xInSafetyEnable := "cTodoTRUE",
	                            xOutPowerContactor => "MA0141",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF2,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".stConveyors.stSort.stCS1102);
	            
	            REGION Überwachung Pins 1
	                
	                #fbPinControl1102_1.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl1102_1.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl1102_1.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1102_1.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1102_1(stInSenRaster := "DB_Inputs".Sensors["cInBG3121"],
	                                    xInErrorQuit := "SF0125" OR "SF0127" OR "SF0117",
	                                    xInMotorRun := #fbSortConv1102.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl1102_1.stSettings.nErrorType := 1;
	                    #fbMonPinControl1102_1.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl1102_1.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl1102_1.stSettings.tDelay := T#1s;
	                    #fbMonPinControl1102_1(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M1102',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG3121"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF2,
	                                           xInQuitError := #stInOutControlUnitCabinetOF2.xQuitError,
	                                           xInSignal := NOT #fbPinControl1102_1.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	            END_REGION
	            
	            REGION Überwachung Pins 2
	                
	                #fbPinControl1102_2.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl1102_2.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl1102_2.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1102_2.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1102_2(stInSenRaster := "DB_Inputs".Sensors["cInBG3181"],
	                                    xInErrorQuit := "SF0125" OR "SF0127" OR "SF0117",
	                                    xInMotorRun := #fbSortConv1102.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl1102_2.stSettings.nErrorType := 1;
	                    #fbMonPinControl1102_2.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl1102_2.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl1102_2.stSettings.tDelay := T#1s;
	                    #fbMonPinControl1102_2(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M1102',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG3181"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF2,
	                                           xInQuitError := #stInOutControlUnitCabinetOF2.xQuitError,
	                                           xInSignal := NOT #fbPinControl1102_2.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	                
	            END_REGION
	            
	            REGION Überwachung Encoder
	                #fbEncoderMonitor1102(sInConveyor := 'KR-M1102',
	                                      sInEncoder := 'GF2201',
	                                      nInEncoderValue := "GF2201_PosAct",
	                                      nInEncoderMax := "cEncoderGF2201",
	                                      nInEncMonVal := "cEncMonVal",
	                                      xInClock := "Clock_2Hz",
	                                      xInConveyorRun := #fbSortConv1102.xOutConveyorFullSpeed,
	                                      xInQuit := "SF0125" OR "SF0127" OR "SF0117" OR "IBN".xQuitGlob,
	                                      xInActivate := TRUE,
	                                      stInOutControlUnitCabinet:= #stInOutControlUnitCabinetOF2);
	            END_REGION
	            
	        END_REGION
	        
	        REGION Conveyor 1201
	            #fbSortConv1201.Settings.tEnergySafeTime := T#120s; // Konstante TODO
	            #fbSortConv1201.Settings.tStartingTime := T#50ms;
	            #fbSortConv1201.Settings.xGridActive := FALSE;
	            #fbSortConv1201.Settings.sMotorProtectName := 'FC0062';
	            
	            #fbSortConv1201(xInEnabled :=
	                            "SF0050" AND "SF0052" AND
	                            NOT #fbPinControl1201_1.xOutErrorRasterSensor AND
	                            NOT #fbPinControl1201_2.xOutErrorRasterSensor AND
	                            NOT #fbEncoderMonitor1201.xOutError AND
	                            NOT #TRO228.xOutUnloadingError AND
	                            NOT #TRO231.xOutUnloadingError,
	                            xInFull := "cTodoFalse",
	                            xInNextConveyorReady := "cTodoTRUE",
	                            xInAutomaticMode := #t_Automatik_OF1,
	                            xInEnergySafeRequest := NOT #stInOutControlUnitCabinetOF1.xRestart AND NOT #TRO228.xOutConvReqSort AND
	                            NOT #TRO231.xOutConvReqSort AND NOT #TRO230.xOutCarouselReq AND
	                            NOT #TRO233.xOutCarouselReq AND NOT #TRO222.xOutCarouselReq2,
	                            xInChainBreakMonitoring := TRUE,
	                            xInChainBreakMonitoringSmoothing := false,
	                            xInMotorProtectionMonitoring := "FC0062",
	                            xInSafetyEnable := "cTodoTRUE",
	                            xOutPowerContactor => "MA0062",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".stConveyors.stSort.stCS1201);
	            
	            REGION Überwachung Pins 1
	                
	                #fbPinControl1201_1.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl1201_1.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl1201_1.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1201_1.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1201_1(stInSenRaster := "DB_Inputs".Sensors["cInBG3481"],
	                                    xInErrorQuit := "SF0051",
	                                    xInMotorRun := #fbSortConv1201.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl1201_1.stSettings.nErrorType := 1;
	                    #fbMonPinControl1201_1.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl1201_1.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl1201_1.stSettings.tDelay := T#1s;
	                    #fbMonPinControl1201_1(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M1201',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG3481"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF1,
	                                           xInQuitError := #stInOutControlUnitCabinetOF1.xQuitError,
	                                           xInSignal := NOT #fbPinControl1201_1.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	            END_REGION
	            
	            REGION Überwachung Pins 2
	                
	                #fbPinControl1201_2.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl1201_2.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl1201_2.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1201_2.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1201_2(stInSenRaster := "DB_Inputs".Sensors["cInBG3541"],
	                                    xInErrorQuit := "SF0053",
	                                    xInMotorRun := #fbSortConv1201.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl1201_2.stSettings.nErrorType := 1;
	                    #fbMonPinControl1201_2.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl1201_2.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl1201_2.stSettings.tDelay := T#1s;
	                    #fbMonPinControl1201_2(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M1201',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG3541"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF1,
	                                           xInQuitError := #stInOutControlUnitCabinetOF1.xQuitError,
	                                           xInSignal := NOT #fbPinControl1201_2.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	            END_REGION
	            
	            REGION Überwachung Encoder
	                #fbEncoderMonitor1201(sInConveyor := 'KR-M1201',
	                                      sInEncoder := 'GF2202',
	                                      nInEncoderValue := "GF2202_PosAct",
	                                      nInEncoderMax := "cEncoderGF2202",
	                                      nInEncMonVal := "cEncMonVal",
	                                      xInClock := "Clock_2Hz",
	                                      xInConveyorRun := #fbSortConv1201.xOutConveyorFullSpeed,
	                                      xInQuit := "SF0051" OR "SF0053" OR "IBN".xQuitGlob,
	                                      xInActivate := TRUE,
	                                      stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1);
	            END_REGION
	            
	        END_REGION
	        
	        REGION Conveyor 1202
	            #fbSortConv1202.Settings.tEnergySafeTime := T#120s; // Konstante TODO
	            #fbSortConv1202.Settings.tStartingTime := T#50ms;
	            #fbSortConv1202.Settings.xGridActive := FALSE;
	            #fbSortConv1202.Settings.sMotorProtectName := 'FC0063';
	            #fbSortConv1202(xInEnabled :=
	                            "SF0054" AND "SF0056" AND
	                            NOT #fbPinControl1202_1.xOutErrorRasterSensor AND
	                            NOT #fbPinControl1202_2.xOutErrorRasterSensor AND
	                            NOT #fbEncoderMonitor1202.xOutError AND
	                            NOT #TRO234.xOutUnloadingError AND
	                            NOT #TRO237.xOutUnloadingError,
	                            xInFull := "cTodoFalse",
	                            xInNextConveyorReady := "cTodoTRUE",
	                            xInAutomaticMode := #t_Automatik_OF1,
	                            xInEnergySafeRequest := NOT #stInOutControlUnitCabinetOF1.xRestart AND NOT #TRO234.xOutConvReqSort AND
	                            NOT #TRO237.xOutConvReqSort AND NOT #TRO236.xOutCarouselReq AND NOT #TRO222.xOutCarouselReq1 AND
	                            NOT #TRO239.xOutCarouselReq AND NOT #TRO221.xOutCarouselReq,
	                            xInChainBreakMonitoring := TRUE,
	                            xInChainBreakMonitoringSmoothing := false,
	                            xInMotorProtectionMonitoring := "FC0063",
	                            xInSafetyEnable := "cTodoTRUE",
	                            xOutPowerContactor => "MA0063",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".stConveyors.stSort.stCS1202);
	            
	            REGION Überwachung Pins 1
	                
	                #fbPinControl1202_1.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl1202_1.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl1202_1.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1202_1.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1202_1(stInSenRaster := "DB_Inputs".Sensors["cInBG3601"],
	                                    xInErrorQuit := "SF0055",
	                                    xInMotorRun := #fbSortConv1202.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl1202_1.stSettings.nErrorType := 1;
	                    #fbMonPinControl1202_1.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl1202_1.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl1202_1.stSettings.tDelay := T#1s;
	                    #fbMonPinControl1202_1(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M1202',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG3601"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF1,
	                                           xInQuitError := #stInOutControlUnitCabinetOF1.xQuitError,
	                                           xInSignal := NOT #fbPinControl1202_1.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	            END_REGION
	            
	            REGION Überwachung Pins 2
	                
	                #fbPinControl1202_2.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl1202_2.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl1202_2.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1202_2.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1202_2(stInSenRaster := "DB_Inputs".Sensors["cInBG3661"],
	                                    xInErrorQuit := "SF0057",
	                                    xInMotorRun := #fbSortConv1202.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl1202_2.stSettings.nErrorType := 1;
	                    #fbMonPinControl1202_2.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl1202_2.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl1202_2.stSettings.tDelay := T#1s;
	                    #fbMonPinControl1202_2(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M1202',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG3661"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF1,
	                                           xInQuitError := #stInOutControlUnitCabinetOF1.xQuitError,
	                                           xInSignal := NOT #fbPinControl1202_2.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	            END_REGION
	            
	            REGION Überwachung Encoder
	                #fbEncoderMonitor1202(sInConveyor := 'KR-M1202',
	                                      sInEncoder := 'GF2203',
	                                      nInEncoderValue := "GF2203_PosAct",
	                                      nInEncoderMax := "cEncoderGF2203",
	                                      nInEncMonVal := "cEncMonVal",
	                                      xInClock := "Clock_2Hz",
	                                      xInConveyorRun := #fbSortConv1202.xOutConveyorFullSpeed,
	                                      xInQuit := "SF0055" OR "SF0057" OR "IBN".xQuitGlob,
	                                      xInActivate := TRUE,
	                                      stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1);
	            END_REGION
	            
	        END_REGION
	        
	        REGION Conveyor 1303
	            #fbSortConv1303.Settings.tEnergySafeTime := T#120s; // Konstante TODO
	            #fbSortConv1303.Settings.tStartingTime := T#50ms;
	            #fbSortConv1303.Settings.xGridActive := FALSE;
	            #fbSortConv1303.Settings.sMotorProtectName := 'FC0260';
	            #fbSortConv1303(xInEnabled :=
	                            "SF0240" AND "SF0242" AND
	                            NOT #fbPinControl1303_1.xOutErrorRasterSensor AND
	                            NOT #fbPinControl1303_2.xOutErrorRasterSensor AND
	                            NOT #fbEncoderMonitor1303.xOutError AND
	                            NOT #TRO248.xOutUnloadingError AND
	                            NOT #TRO251.xOutUnloadingError,
	                            xInFull := "cTodoFalse",
	                            xInNextConveyorReady := "cTodoTRUE",
	                            xInAutomaticMode := #t_Automatik_OF4,
	                            xInEnergySafeRequest := NOT #stInOutControlUnitCabinetOF4.xRestart AND NOT #TRO248.xOutConvReqSort AND
	                            NOT #TRO251.xOutConvReqSort AND NOT #TRO250.xOutCarouselReq AND
	                            NOT #TRO253.xOutCarouselReq AND NOT #TRO242.xOutCarouselReq1,
	                            xInChainBreakMonitoring := TRUE,
	                            xInChainBreakMonitoringSmoothing := false,
	                            xInMotorProtectionMonitoring := "FC0260",
	                            xInSafetyEnable := "cTodoTRUE",
	                            xOutPowerContactor => "MA0260",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF4,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".stConveyors.stSort.stCS1303);
	            
	            REGION Überwachung Pins 1
	                
	                #fbPinControl1303_1.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl1303_1.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl1303_1.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1303_1.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1303_1(stInSenRaster := "DB_Inputs".Sensors["cInBG4261"],
	                                    xInErrorQuit := "SF0243",
	                                    xInMotorRun := #fbSortConv1303.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl1303_1.stSettings.nErrorType := 1;
	                    #fbMonPinControl1303_1.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl1303_1.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl1303_1.stSettings.tDelay := T#1s;
	                    #fbMonPinControl1303_1(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M1303',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG4261"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF4,
	                                           xInQuitError := #stInOutControlUnitCabinetOF4.xQuitError,
	                                           xInSignal := NOT #fbPinControl1303_1.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	            END_REGION
	            
	            REGION Überwachung Pins 2
	                
	                #fbPinControl1303_2.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl1303_2.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl1303_2.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1303_2.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1303_2(stInSenRaster := "DB_Inputs".Sensors["cInBG4201"],
	                                    xInErrorQuit := "SF0241",
	                                    xInMotorRun := #fbSortConv1303.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl1303_2.stSettings.nErrorType := 1;
	                    #fbMonPinControl1303_2.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl1303_2.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl1303_2.stSettings.tDelay := T#1s;
	                    #fbMonPinControl1303_2(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M1303',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG4201"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF4,
	                                           xInQuitError := #stInOutControlUnitCabinetOF4.xQuitError,
	                                           xInSignal := NOT #fbPinControl1303_2.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	            END_REGION
	            
	            REGION Überwachung Encoder
	                #fbEncoderMonitor1303(sInConveyor := 'KR-M1303',
	                                      sInEncoder := 'GF2204',
	                                      nInEncoderValue := "GF2204_PosAct",
	                                      nInEncoderMax := "cEncoderGF2204",
	                                      nInEncMonVal := "cEncMonVal",
	                                      xInClock := "Clock_2Hz",
	                                      xInConveyorRun := #fbSortConv1303.xOutConveyorFullSpeed,
	                                      xInQuit := "SF0241" OR "SF0243" OR "IBN".xQuitGlob,
	                                      xInActivate := TRUE,
	                                      stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF4);
	            END_REGION
	            
	        END_REGION
	        
	        REGION Conveyor 1304
	            #fbSortConv1304.Settings.tEnergySafeTime := T#120s; // Konstante TODO
	            #fbSortConv1304.Settings.tStartingTime := T#50ms;
	            #fbSortConv1304.Settings.xGridActive := FALSE;
	            #fbSortConv1304.Settings.sMotorProtectName := 'FC0261';
	            #fbSortConv1304(xInEnabled :=
	                            "SF0244" AND "SF0246" AND
	                            NOT #fbPinControl1304_1.xOutErrorRasterSensor AND
	                            NOT #fbPinControl1304_2.xOutErrorRasterSensor AND
	                            NOT #fbEncoderMonitor1304.xOutError AND
	                            NOT #TRO254.xOutUnloadingError AND
	                            NOT #TRO257.xOutUnloadingError,
	                            xInFull := "cTodoFalse",
	                            xInNextConveyorReady := "cTodoTRUE",
	                            xInAutomaticMode := #t_Automatik_OF4,
	                            xInEnergySafeRequest := NOT #stInOutControlUnitCabinetOF4.xRestart AND NOT #TRO254.xOutConvReqSort AND
	                            NOT #TRO257.xOutConvReqSort AND NOT #TRO256.xOutCarouselReq AND
	                            NOT #TRO259.xOutCarouselReq AND NOT #TRO241.xOutCarouselReq AND NOT #TRO242.xOutCarouselReq2,
	                            xInChainBreakMonitoring := TRUE,
	                            xInChainBreakMonitoringSmoothing := false,
	                            xInMotorProtectionMonitoring := "FC0261",
	                            xInSafetyEnable := "cTodoTRUE",
	                            xOutPowerContactor => "MA0261",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF4,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".stConveyors.stSort.stCS1304);
	            
	            REGION Überwachung Pins 1
	                
	                #fbPinControl1304_1.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl1304_1.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl1304_1.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1304_1.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1304_1(stInSenRaster := "DB_Inputs".Sensors["cInBG4321"],
	                                    xInErrorQuit := "SF0245",
	                                    xInMotorRun := #fbSortConv1304.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl1304_1.stSettings.nErrorType := 1;
	                    #fbMonPinControl1304_1.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl1304_1.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl1304_1.stSettings.tDelay := T#1s;
	                    #fbMonPinControl1304_1(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M1304',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG4321"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF4,
	                                           xInQuitError := #stInOutControlUnitCabinetOF4.xQuitError,
	                                           xInSignal := NOT #fbPinControl1304_1.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	            END_REGION
	            
	            REGION Überwachung Pins 2
	                
	                #fbPinControl1304_2.stInSettings.xInEnableSupervision := TRUE;
	                #fbPinControl1304_2.stInSettings.tInDelayMotorRun := T#1000ms;
	                #fbPinControl1304_2.stInSettings.tInRasterHigh := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1304_2.stInSettings.tInRasterLow := T#1800ms;//T#1300ms;//T#600ms;
	                #fbPinControl1304_2(stInSenRaster := "DB_Inputs".Sensors["cInBG4381"],
	                                    xInErrorQuit := "SF0247",
	                                    xInMotorRun := #fbSortConv1304.xOutConveyorFullSpeed);
	                
	                REGION Monitoring
	                    #fbMonPinControl1304_2.stSettings.nErrorType := 1;
	                    #fbMonPinControl1304_2.stSettings.xErrLedIfMachineIsOff := TRUE;
	                    #fbMonPinControl1304_2.stSettings.xSelfQuit := TRUE;
	                    #fbMonPinControl1304_2.stSettings.tDelay := T#1s;
	                    #fbMonPinControl1304_2(sInFctnName := 'Rastersensorueberwachung',
	                                           sInPrefix := 'KR-M1304',
	                                           wInTextListId_Function := 3000,
	                                           wInTextListId_Message := 3000,
	                                           sInSuffix := "DB_Inputs".Sensors["cInBG4381"].sName,
	                                           InOutMachineState := #stInOutControlUnitCabinetOF4,
	                                           xInQuitError := #stInOutControlUnitCabinetOF4.xQuitError,
	                                           xInSignal := NOT #fbPinControl1304_2.xOutErrorRasterSensor,
	                                           sInAlarmMessage := 'Rastersensorueberwachung ausgeloest');
	                END_REGION
	            END_REGION
	            
	            REGION Überwachung Encoder
	                #fbEncoderMonitor1304(sInConveyor := 'KR-M1304',
	                                      sInEncoder := 'GF2205',
	                                      nInEncoderValue := "GF2205_PosAct",
	                                      nInEncoderMax := "cEncoderGF2205",
	                                      nInEncMonVal := "cEncMonVal",
	                                      xInClock := "Clock_2Hz",
	                                      xInConveyorRun := #fbSortConv1304.xOutConveyorFullSpeed,
	                                      xInQuit := "SF0245" OR "SF0247" OR "IBN".xQuitGlob,
	                                      xInActivate := TRUE,
	                                      stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF4);
	            END_REGION
	            
	        END_REGION
	    END_REGION
	    
	    REGION Kreisel
	        
	        REGION Conveyor 1110
	            #fbCarousel1110.Settings.tEnergySafeTime := T#90s;
	            #fbCarousel1110.Settings.tStartingTime := T#50ms;
	            #fbCarousel1110.Settings.xGridActive := TRUE;
	            #fbCarousel1110.Settings.sMotorProtectName := 'FC0075';
	            #fbCarousel1110.Settings.sGridSenName := 'BG4510';
	            #fbCarousel1110(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *)#stInOutControlUnitCabinetOF1.xRestart OR
	                            #TRO261.xOutCarouselReq OR
	                            #TRO263.xOutCarouselReq OR
	                            #TRO265.xOutCarouselReq OR
	                            #TRO266.xOutCarouselReq OR
	                            #TRO267.xOutCarouselReq1 OR #TRO267.xOutCarouselReq2 OR
	                            #TRO268.xOutCarouselReq1 OR #TRO268.xOutCarouselReq2 OR
	                            #TRO269.xOutCarouselReq OR
	                            #TRO274.xOutCarouselReq OR
	                            #TRO275.xOutCarouselReq,
	                            xInEnabled := "SF0080" AND "SF0082",
	                            xInGridSen := "DB_Inputs".Sensors["cInBG4510"].xDirectSensor,
	                            xInGridQuit := "SF0083",
	                            xInAutomaticMode := #t_Automatik_OF1,
	                            xInMotorProtectionMonitoring := "FC0075",
	                            xOutPowerContactor => "MA0075",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".stConveyors.stCarousel.stCarEntr1);
	        END_REGION
	        
	        
	        
	        REGION "Exit" Conv 1103          
	            #fbExitConv1103.Settings.tEnergySafeTime := T#90s;
	            #fbExitConv1103.Settings.tStartingTime := T#50ms;
	            #fbExitConv1103.Settings.xGridActive := TRUE;
	            #fbExitConv1103.Settings.sMotorProtectName := 'FC0060';
	            #fbExitConv1103.Settings.sGridSenName := 'BG3306';
	            #fbExitConv1103(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *)#stInOutControlUnitCabinetOF1.xRestart OR
	                            #TRO208.xOutConvReqExit OR #TRO211.xOutConvReqExit OR
	                            #TRO203.xOutCarouselReq1 OR #TRO203.xOutCarouselReq2 OR
	                            #TRO204.xOutCarouselReq1 OR #TRO204.xOutCarouselReq2 OR
	                            #TRO206.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.stCar1103Exit);
	        END_REGION
	        
	        REGION "Exit" Conv 1104
	            #fbExitConv1104.Settings.tEnergySafeTime := T#90s;
	            #fbExitConv1104.Settings.tStartingTime := T#50ms;
	            #fbExitConv1104.Settings.xGridActive := TRUE;
	            #fbExitConv1104.Settings.sMotorProtectName := 'FC0061';
	            #fbExitConv1104.Settings.sGridSenName := 'BG3433';
	            #fbExitConv1104(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *)#stInOutControlUnitCabinetOF1.xRestart OR
	                            #TRO214.xOutConvReqExit OR #TRO217.xOutConvReqExit OR
	                            #TRO205.xOutCarouselReq1 OR #TRO205.xOutCarouselReq2 OR
	                            #TRO206.xOutCarouselReq1 OR #TRO206.xOutCarouselReq2 OR
	                            #TRO204.xOutCarouselReq2 OR #TRO207.xOutCarouselReq,
	                            xInEnabled := "SF0044" AND "SF0046",
	                            xInGridSen := "DB_Inputs".Sensors["cInBG3433"].xDirectSensor,
	                            xInGridQuit := "SF0055" OR "SF0057",
	                            xInAutomaticMode := #t_Automatik_OF1,
	                            xInMotorProtectionMonitoring := "FC0061",
	                            xOutPowerContactor => "MA0061",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".stConveyors.stCarousel.stCar1104Exit);
	        END_REGION
	        
	        REGION "Exit" Conv 1203
	            #fbExitConv1203.Settings.tEnergySafeTime := T#90s;
	            #fbExitConv1203.Settings.tStartingTime := T#50ms;
	            #fbExitConv1203.Settings.xGridActive := TRUE;
	            #fbExitConv1203.Settings.sMotorProtectName := 'FC0200';
	            #fbExitConv1203.Settings.sGridSenName := 'BG3786';
	            #fbExitConv1203(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *)#stInOutControlUnitCabinetOF3.xRestart OR
	                            #TRO228.xOutConvReqExit OR #TRO231.xOutConvReqExit OR
	                            #TRO223.xOutCarouselReq1 OR #TRO223.xOutCarouselReq2 OR
	                            #TRO224.xOutCarouselReq1 OR #TRO224.xOutCarouselReq2 OR
	                            #TRO226.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.stCar1203Exit);
	        END_REGION
	        
	        REGION "Exit" Conv 1204
	            #fbExitConv1204.Settings.tEnergySafeTime := T#90s;
	            #fbExitConv1204.Settings.tStartingTime := T#50ms;
	            #fbExitConv1204.Settings.xGridActive := TRUE;
	            #fbExitConv1204.Settings.sMotorProtectName := 'FC0201';
	            #fbExitConv1204.Settings.sGridSenName := 'BG3911';
	            #fbExitConv1204(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *)#stInOutControlUnitCabinetOF3.xRestart OR
	                            #TRO234.xOutConvReqExit OR #TRO237.xOutConvReqExit OR
	                            #TRO225.xOutCarouselReq1 OR #TRO225.xOutCarouselReq2 OR
	                            #TRO226.xOutCarouselReq1 OR #TRO226.xOutCarouselReq2 OR
	                            #TRO224.xOutCarouselReq2 OR
	                            #TRO227.xOutCarouselReq,
	                            xInEnabled := "SF0184" AND "SF0186",
	                            xInGridSen := "DB_Inputs".Sensors["cInBG3911"].xDirectSensor,
	                            xInGridQuit := "SF0185" OR "SF0187",
	                            xInAutomaticMode := #t_Automatik_OF3,
	                            xInMotorProtectionMonitoring := "FC0201",
	                            xOutPowerContactor => "MA0201",
	                            stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF3,
	                            stInOutInterfaceHMI := "DB_Interface_HMI".stConveyors.stCarousel.stCar1204Exit);
	        END_REGION
	        
	        REGION "Exit" Conv 1301
	            #fbExitConv1301.Settings.tEnergySafeTime := T#90s;
	            #fbExitConv1301.Settings.tStartingTime := T#50ms;
	            #fbExitConv1301.Settings.xGridActive := TRUE;
	            #fbExitConv1301.Settings.sMotorProtectName := 'FC0202';
	            #fbExitConv1301.Settings.sGridSenName := 'BG4026';
	            #fbExitConv1301(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *)#stInOutControlUnitCabinetOF3.xRestart OR
	                            #TRO248.xOutConvReqExit OR #TRO251.xOutConvReqExit OR
	                            #TRO243.xOutCarouselReq1 OR #TRO243.xOutCarouselReq2 OR
	                            #TRO244.xOutCarouselReq1 OR #TRO244.xOutCarouselReq2 OR
	                            #TRO246.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.stCar1301Exit);
	        END_REGION
	        
	        REGION "Exit" Conv 1302
	            #fbExitConv1302.Settings.tEnergySafeTime := T#90s;
	            #fbExitConv1302.Settings.tStartingTime := T#50ms;
	            #fbExitConv1302.Settings.xGridActive := TRUE;
	            #fbExitConv1302.Settings.sMotorProtectName := 'FC0203';
	            #fbExitConv1302.Settings.sGridSenName := 'BG4150';
	            #fbExitConv1302(xInRequestRun := (* "fbPreMain_DB".fbStateMain.nConveyorStartUpCounter = 100 OR *)#stInOutControlUnitCabinetOF3.xRestart OR
	                            #TRO254.xOutConvReqExit OR #TRO257.xOutConvReqExit OR
	                            #TRO245.xOutCarouselReq1 OR #TRO245.xOutCarouselReq2 OR
	                            #TRO246.xOutCarouselReq1 OR #TRO246.xOutCarouselReq2 OR
	                            #TRO244.xOutCarouselReq1 OR #TRO247.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.stCar1302Exit);
	        END_REGION
	        
	    END_REGION
	END_REGION ;
	
	REGION Encoder
	    REGION GF2200
	        #fbEncoderGF2200(nInPosAct := "GF2200_PosAct",
	                         xInPresetAdjQuit := "GF2200_PresetAdjQuit",
	                         nInEncoderMax := "cEncoderGF2200",
	                         nInHooksSorterMax := "cHooksSorterMaxPin",
	                         stInSensorReference := "DB_Inputs".Sensors["cInBG3061"],
	                         nInPitch := 250); //Konstante
	        
	        "GF2200_PresetAdjSet" := #fbEncoderGF2200.xOutPresetAdjSet;
	        "GF2200_PresetAdjValue" := #fbEncoderGF2200.nOutPresetAdjSetValue;
	    END_REGION
	    
	    REGION GF2201
	        #fbEncoderGF2201(nInPosAct := "GF2201_PosAct",
	                         xInPresetAdjQuit := "GF2201_PresetAdjQuit",
	                         nInEncoderMax := "cEncoderGF2201",
	                         nInHooksSorterMax := "cHooksSorterMaxPin",
	                         stInSensorReference := "DB_Inputs".Sensors["cInBG3121"],
	                         nInPitch := 250); //Konstante
	        
	        "GF2201_PresetAdjSet" := #fbEncoderGF2201.xOutPresetAdjSet;
	        "GF2201_PresetAdjValue" := #fbEncoderGF2201.nOutPresetAdjSetValue;
	    END_REGION
	    
	    REGION GF2202
	        #fbEncoderGF2202(nInPosAct := "GF2202_PosAct",
	                         xInPresetAdjQuit := "GF2202_PresetAdjQuit",
	                         nInEncoderMax := "cEncoderGF2202",
	                         nInHooksSorterMax := "cHooksSorterMaxPin",
	                         stInSensorReference := "DB_Inputs".Sensors["cInBG3541"],
	                         nInPitch := 250); //Konstante
	        
	        "GF2202_PresetAdjSet" := #fbEncoderGF2202.xOutPresetAdjSet;
	        "GF2202_PresetAdjValue" := #fbEncoderGF2202.nOutPresetAdjSetValue;
	    END_REGION
	    
	    REGION GF2203
	        #fbEncoderGF2203(nInPosAct := "GF2203_PosAct",
	                         xInPresetAdjQuit := "GF2203_PresetAdjQuit",
	                         nInEncoderMax := "cEncoderGF2203",
	                         nInHooksSorterMax := "cHooksSorterMaxPin",
	                         stInSensorReference := "DB_Inputs".Sensors["cInBG3601"],
	                         nInPitch := 250); //Konstante
	        
	        "GF2203_PresetAdjSet" := #fbEncoderGF2203.xOutPresetAdjSet;
	        "GF2203_PresetAdjValue" := #fbEncoderGF2203.nOutPresetAdjSetValue;
	    END_REGION
	    
	    REGION GF2204
	        #fbEncoderGF2204(nInPosAct := "GF2204_PosAct",
	                         xInPresetAdjQuit := "GF2204_PresetAdjQuit",
	                         nInEncoderMax := "cEncoderGF2204",
	                         nInHooksSorterMax := "cHooksSorterMaxPin",
	                         stInSensorReference := "DB_Inputs".Sensors["cInBG4261"],
	                         nInPitch := 250); //Konstante
	        
	        "GF2204_PresetAdjSet" := #fbEncoderGF2204.xOutPresetAdjSet;
	        "GF2204_PresetAdjValue" := #fbEncoderGF2204.nOutPresetAdjSetValue;
	    END_REGION
	    
	    REGION GF2205
	        #fbEncoderGF2205(nInPosAct := "GF2205_PosAct",
	                         xInPresetAdjQuit := "GF2205_PresetAdjQuit",
	                         nInEncoderMax := "cEncoderGF2205",
	                         nInHooksSorterMax := "cHooksSorterMaxPin",
	                         stInSensorReference := "DB_Inputs".Sensors["cInBG4321"],
	                         nInPitch := 250); //Konstante
	        
	        "GF2205_PresetAdjSet" := #fbEncoderGF2205.xOutPresetAdjSet;
	        "GF2205_PresetAdjValue" := #fbEncoderGF2205.nOutPresetAdjSetValue;
	    END_REGION
	    
	END_REGION
	
	
	REGION SECTION 1.1
	    REGION BLOCK 1.1.1 (TRO 208)                      
	        REGION Encoder Settings
	            #TRO208.stInEncoderParameter.nPosActDif := #fbEncoderGF2200.nOutPosActDif;
	            #TRO208.stInEncoderParameter.nPosPitchPart := #fbEncoderGF2200.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO208.stInSettings.nDestGeneral := "cDest11100";
	            #TRO208.stInSettings.nConvStations := "cHooksSorterMaxPin111"; //Konstante todo
	            #TRO208.stInSettings.nStationsMax := "cStationsMax111"; // Konstante todo
	            #TRO208.stInSettings.nStorageThreshold := "cNoPositionsBlock1"; //Konstante todo
	            #TRO208.stInSettings.nNoOfLines := 19;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO208.stInSensorReference := "DB_Inputs".Sensors["cInBG3001"];
	        END_REGION
	        
	        REGION Barcode Reader In (BX2104)
	            #TRO208.stInBarcodeReader.Settings.nStation := 111; // todo Konstante
	            #TRO208.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO208.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO208.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX2104"].xInCamTriggerReady := "bx2104-TriggerReady";
	            #arCognexInterface["cScannerBX2104"].xInCamTriggerAck := "bx2104-TriggerAck";
	            #arCognexInterface["cScannerBX2104"].xInCamResultsAvailable := "bx2104-Results Available";
	            #arCognexInterface["cScannerBX2104"].xInCamGeneralFault := "bx2104-General Fault";
	            #arCognexInterface["cScannerBX2104"].hwInCamInspectionResults := "=A01+UH02-BX2104~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            REGION Sep Pin
	                #TRO208.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3000"];
	                #TRO208.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO208.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO208.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := 4;//"cStorage111ExitJam1";
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3270"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam2";
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3271"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam3";
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3272"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam4";
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3273"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam5";
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3274"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam6";
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3275"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam7";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3276"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam8";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3277"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam9";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3280"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam10";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3281"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam11";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3282"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam12";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3283"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam13";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3284"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam14";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3285"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam15";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3286"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam16";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3287"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam17";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3290"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 18
	                #nActNo := 18;
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam18";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3291"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 19
	                #nActNo := 19;
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO208.arInSep[#nActNo].stSettings.nJamLength := "cStorage111ExitJam19";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO208.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO208.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3292"];
	                #TRO208.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO208.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO208.xInQuitLocal := "SF0121" OR "SF0117";
	            
	            #TRO208.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3030"];
	            
	            #TRO208.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3031"];
	            
	            #TRO208.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3032"];
	            
	            #TRO208.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3033"];
	            
	            #TRO208.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3034"];
	            
	            #TRO208.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3035"];
	            
	            #TRO208.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3036"];
	            
	            #TRO208.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3037"];
	            
	            #TRO208.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3040"];
	            
	            #TRO208.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3041"];
	            
	            #TRO208.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3042"];
	            
	            #TRO208.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3043"];
	            
	            #TRO208.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3044"];
	            
	            #TRO208.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG3045"];
	            
	            #TRO208.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG3046"];
	            
	            #TRO208.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG3047"];
	            
	            #TRO208.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG3050"];
	            
	            #TRO208.arInJamSensor[18] := "DB_Inputs".Sensors["cInBG3051"];
	            
	            #TRO208.arInJamSensor[19] := "DB_Inputs".Sensors["cInBG3052"];
	            
	        END_REGION
	        
	        REGION Aufruf: TRO208
	            
	            #TRO208.stInPriorityManager.xReleaseOk := TRUE;
	            
	            #TRO208(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                    nInTestTarget := "IBN".nTestTarget111,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO208,
	                    xInConveyorRunIn := #fbSortConv1101.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv1103.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF2,
	                    arInOutStorageLines := "DB_Storage1.1.1".arLine,
	                    arInOutJamEntr := "DB_JamArea1101".stJam1101_2.arCarrier,
	                    stInOutJamEntr := "DB_JamArea1101".stJam1101_2.stData,
	                    arInOutJamExit := "DB_JamArea1103".stJam1103_1.arCarrier,
	                    stInOutJamExit := "DB_JamArea1103".stJam1103_1.stData,
	                    arInOutJamBypass := #arCarrierPlaceHolder,
	                    stInOutJamBypass := #stJamDataPlaceHolder,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO208,
	                    stMFRStorageRemovalInterface := "DB_HandshakeStorage".Str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl1[1],
	                    xOutSeparatorPin => "MB3000",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTRO208"],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX2104"],
	                    stConveyorStations:= "DB_ConveyorStations".stConveyorStations111);
	        END_REGION ;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO208.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO208.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1101".stJam1101_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Barcode Reader Out (BX2104)
	            "bx2104-TriggerEnable" := #arCognexInterface["cScannerBX2104"].xOutCamTriggerEnable;
	            "bx2104-Trigger" := #arCognexInterface["cScannerBX2104"].xOutCamTrigger;
	            "bx2104-ResultsAck" := #arCognexInterface["cScannerBX2104"].xOutCamResultsAck;
	        END_REGION
	        
	        
	        
	        REGION Separator Store Out
	            "MB3270" := #TRO208.arOutSeparatorStore[1];
	            "MB3271" := #TRO208.arOutSeparatorStore[2];
	            "MB3272" := #TRO208.arOutSeparatorStore[3];
	            "MB3273" := #TRO208.arOutSeparatorStore[4];
	            "MB3274" := #TRO208.arOutSeparatorStore[5];
	            "MB3275" := #TRO208.arOutSeparatorStore[6];
	            "MB3276" := #TRO208.arOutSeparatorStore[7];
	            "MB3277" := #TRO208.arOutSeparatorStore[8];
	            "MB3280" := #TRO208.arOutSeparatorStore[9];
	            "MB3281" := #TRO208.arOutSeparatorStore[10];
	            "MB3282" := #TRO208.arOutSeparatorStore[11];
	            "MB3283" := #TRO208.arOutSeparatorStore[12];
	            "MB3284" := #TRO208.arOutSeparatorStore[13];
	            "MB3285" := #TRO208.arOutSeparatorStore[14];
	            "MB3286" := #TRO208.arOutSeparatorStore[15];
	            "MB3287" := #TRO208.arOutSeparatorStore[16];
	            "MB3290" := #TRO208.arOutSeparatorStore[17];
	            "MB3291" := #TRO208.arOutSeparatorStore[18];
	            "MB3292" := #TRO208.arOutSeparatorStore[19];
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB3030" := #TRO208.arOutSwitch[1];
	            "MB3031" := #TRO208.arOutSwitch[2];
	            "MB3032" := #TRO208.arOutSwitch[3];
	            "MB3033" := #TRO208.arOutSwitch[4];
	            "MB3034" := #TRO208.arOutSwitch[5];
	            "MB3035" := #TRO208.arOutSwitch[6];
	            "MB3036" := #TRO208.arOutSwitch[7];
	            "MB3037" := #TRO208.arOutSwitch[8];
	            "MB3040" := #TRO208.arOutSwitch[9];
	            "MB3041" := #TRO208.arOutSwitch[10];
	            "MB3042" := #TRO208.arOutSwitch[11];
	            "MB3043" := #TRO208.arOutSwitch[12];
	            "MB3044" := #TRO208.arOutSwitch[13];
	            "MB3045" := #TRO208.arOutSwitch[14];
	            "MB3046" := #TRO208.arOutSwitch[15];
	            "MB3047" := #TRO208.arOutSwitch[16];
	            "MB3050" := #TRO208.arOutSwitch[17];
	            "MB3051" := #TRO208.arOutSwitch[18];
	            "MB3052" := #TRO208.arOutSwitch[19];
	        END_REGION
	        
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 19 DO
	                IF #TRO208.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO208.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest11100" + #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 1.1.2 (TRO 211)
	        REGION Encoder Settings
	            #TRO211.stInEncoderParameter.nPosActDif := #fbEncoderGF2200.nOutPosActDif;
	            #TRO211.stInEncoderParameter.nPosPitchPart := #fbEncoderGF2200.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO211.stInSettings.nDestGeneral := "cDest11200";
	            #TRO211.stInSettings.nConvStations := "cHooksSorterMaxPin112"; //Konstante todo
	            #TRO211.stInSettings.nStationsMax := "cStationsMax112"; // Konstante todo
	            #TRO211.stInSettings.nStorageThreshold := "cNoPositionsBlock1"; //Konstante todo
	            #TRO211.stInSettings.nNoOfLines := 17;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO211.stInSensorReference := "DB_Inputs".Sensors["cInBG3061"];
	        END_REGION
	        
	        REGION Barcode Reader IN (BX2105)
	            #TRO211.stInBarcodeReader.Settings.nStation := 212; // todo Konstante
	            #TRO211.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO211.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO211.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX2105"].xInCamTriggerReady := "bx2105-TriggerReady";
	            #arCognexInterface["cScannerBX2105"].xInCamTriggerAck := "bx2105-TriggerAck";
	            #arCognexInterface["cScannerBX2105"].xInCamResultsAvailable := "bx2105-Results Available";
	            #arCognexInterface["cScannerBX2105"].xInCamGeneralFault := "bx2105-General Fault";
	            #arCognexInterface["cScannerBX2105"].hwInCamInspectionResults := "=A01+UH02-BX2105~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            
	            REGION Pin
	                #TRO211.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3060"];
	                #TRO211.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO211.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO211.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam1";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3330"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam2";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3331"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam3";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3332"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam4";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3333"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam5";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3334"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam6";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3335"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam7";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3336"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam8";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3337"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam9";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3340"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam10";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3341"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam11";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3342"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam12";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3343"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam13";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3344"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam14";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3345"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam15";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3346"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam16";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3347"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO211.arInSep[#nActNo].stSettings.nJamLength := "cStorage112ExitJam17";
	                #TRO211.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3350"];
	                #TRO211.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO211.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO211.xInQuitLocal := "SF0123" OR "SF0117";
	            
	            #TRO211.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3090"];
	            
	            #TRO211.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3091"];
	            
	            #TRO211.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3092"];
	            
	            #TRO211.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3093"];
	            
	            #TRO211.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3094"];
	            
	            #TRO211.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3095"];
	            
	            #TRO211.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3096"];
	            
	            #TRO211.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3097"];
	            
	            #TRO211.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3100"];
	            
	            #TRO211.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3101"];
	            
	            #TRO211.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3102"];
	            
	            #TRO211.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3103"];
	            
	            #TRO211.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3104"];
	            
	            #TRO211.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG3105"];
	            
	            #TRO211.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG3106"];
	            
	            #TRO211.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG3107"];
	            
	            #TRO211.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG3110"];
	        END_REGION ;
	        
	        REGION Aufruf: TRO211
	            
	            #TRO211.stInPriorityManager.xReleaseOk := True;
	            
	            #TRO211(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                    nInTestTarget := "IBN".nTestTarget112,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO211,
	                    xInConveyorRunIn := #fbSortConv1101.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv1103.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF2,
	                    arInOutStorageLines := "DB_Storage1.1.2".arLine,
	                    arInOutJamEntr := "DB_JamArea1101".stJam1101_1.arCarrier,
	                    stInOutJamEntr := "DB_JamArea1101".stJam1101_1.stData,
	                    arInOutJamExit := "DB_JamArea1103".stJam1103_2.arCarrier,
	                    stInOutJamExit := "DB_JamArea1103".stJam1103_2.stData,
	                    arInOutJamBypass := "DB_JamArea1101".stJam1101_2.arCarrier,
	                    stInOutJamBypass := "DB_JamArea1101".stJam1101_2.stData,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO211,
	                    stMFRStorageRemovalInterface := "DB_HandshakeStorage".Str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl1[2],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX2105"],
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainT
	                    xOutSeparatorPin => "MB3060",
	                    stConveyorStations:="DB_ConveyorStations".stConveyorStations112);
	        END_REGION ;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO211.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO211.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1101".stJam1101_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Barcode Reader Out (BX2105)                
	            "bx2105-TriggerEnable" := #arCognexInterface["cScannerBX2105"].xOutCamTriggerEnable;
	            "bx2105-Trigger" := #arCognexInterface["cScannerBX2105"].xOutCamTrigger;
	            "bx2105-ResultsAck" := #arCognexInterface["cScannerBX2105"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB3330" := #TRO211.arOutSeparatorStore[1];
	            "MB3331" := #TRO211.arOutSeparatorStore[2];
	            "MB3332" := #TRO211.arOutSeparatorStore[3];
	            "MB3333" := #TRO211.arOutSeparatorStore[4];
	            "MB3334" := #TRO211.arOutSeparatorStore[5];
	            "MB3335" := #TRO211.arOutSeparatorStore[6];
	            "MB3336" := #TRO211.arOutSeparatorStore[7];
	            "MB3337" := #TRO211.arOutSeparatorStore[8];
	            "MB3340" := #TRO211.arOutSeparatorStore[9];
	            "MB3341" := #TRO211.arOutSeparatorStore[10];
	            "MB3342" := #TRO211.arOutSeparatorStore[11];
	            "MB3343" := #TRO211.arOutSeparatorStore[12];
	            "MB3344" := #TRO211.arOutSeparatorStore[13];
	            "MB3345" := #TRO211.arOutSeparatorStore[14];
	            "MB3346" := #TRO211.arOutSeparatorStore[15];
	            "MB3347" := #TRO211.arOutSeparatorStore[16];
	            "MB3350" := #TRO211.arOutSeparatorStore[17];
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB3090" := #TRO211.arOutSwitch[1];
	            "MB3091" := #TRO211.arOutSwitch[2];
	            "MB3092" := #TRO211.arOutSwitch[3];
	            "MB3093" := #TRO211.arOutSwitch[4];
	            "MB3094" := #TRO211.arOutSwitch[5];
	            "MB3095" := #TRO211.arOutSwitch[6];
	            "MB3096" := #TRO211.arOutSwitch[7];
	            "MB3097" := #TRO211.arOutSwitch[8];
	            "MB3100" := #TRO211.arOutSwitch[9];
	            "MB3101" := #TRO211.arOutSwitch[10];
	            "MB3102" := #TRO211.arOutSwitch[11];
	            "MB3103" := #TRO211.arOutSwitch[12];
	            "MB3104" := #TRO211.arOutSwitch[13];
	            "MB3105" := #TRO211.arOutSwitch[14];
	            "MB3106" := #TRO211.arOutSwitch[15];
	            "MB3107" := #TRO211.arOutSwitch[16];
	            "MB3110" := #TRO211.arOutSwitch[17];
	            
	        END_REGION
	        
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 17 DO
	                IF #TRO211.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO211.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest11200" + #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 1.1.3 (TRO 214)
	        
	        REGION Encoder Settings
	            #TRO214.stInEncoderParameter.nPosActDif := #fbEncoderGF2201.nOutPosActDif;
	            #TRO214.stInEncoderParameter.nPosPitchPart := #fbEncoderGF2201.nPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO214.stInSettings.nDestGeneral := "cDest11300";
	            #TRO214.stInSettings.nConvStations := "cHooksSorterMaxPin113"; //Konstante todo
	            #TRO214.stInSettings.nStationsMax := "cStationsMax113"; // Konstante todo
	            #TRO214.stInSettings.nStorageThreshold := "cNoPositionsBlock1"; //Konstante todo
	            #TRO214.stInSettings.nNoOfLines := 21;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO214.stInSensorReference := "DB_Inputs".Sensors["cInBG3121"];
	        END_REGION
	        
	        REGION Barcode Reader In (BX2106)
	            #TRO214.stInBarcodeReader.Settings.nStation := 113; // todo Konstante
	            #TRO214.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO214.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO214.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX2106"].xInCamTriggerReady := "bx2106-TriggerReady";
	            #arCognexInterface["cScannerBX2106"].xInCamTriggerAck := "bx2106-TriggerAck";
	            #arCognexInterface["cScannerBX2106"].xInCamResultsAvailable := "bx2106-Results Available";
	            #arCognexInterface["cScannerBX2106"].xInCamGeneralFault := "bx2106-General Fault";
	            #arCognexInterface["cScannerBX2106"].hwInCamInspectionResults := "=A01+UH02-BX2106~Ergebnisse_–_64_Bytes_1";
	            
	        END_REGION
	        
	        REGION Separator Settings
	            
	            REGION Pin
	                #TRO214.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3120"];
	                #TRO214.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO214.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO214.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam1";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3390"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam2";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3391"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam3";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3392"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam4";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3393"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam5";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3394"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam6";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3395"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam7";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3396"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam8";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3397"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam9";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3400"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam10";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3401"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam11";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3402"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam12";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3403"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam13";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3404"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam14";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3405"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam15";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3406"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam16";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3407"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam17";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3410"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 18
	                #nActNo := 18;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam18";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3411"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 19
	                #nActNo := 19;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam19";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3412"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 20
	                #nActNo := 20;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam10";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3413"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 21
	                #nActNo := 21;
	                #TRO214.arInSep[#nActNo].stSettings.nJamLength := "cStorage113ExitJam11";
	                #TRO214.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3414"];
	                #TRO214.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO214.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            
	        END_REGION
	        
	        REGION Aufruf: TRO214
	            
	            #TRO214.stInPriorityManager.xReleaseOk := "cTodoTRUE";
	            
	            #TRO214(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                    nInTestTarget := "IBN".nTestTarget113,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO214,
	                    xInConveyorRunIn := #fbSortConv1102.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv1104.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF2,
	                    arInOutStorageLines := "DB_Storage1.1.3".arLine,
	                    arInOutJamEntr := "DB_JamArea1102".stJam1102_2.arCarrier,
	                    stInOutJamEntr := "DB_JamArea1102".stJam1102_2.stData,
	                    arInOutJamExit := "DB_JamArea1104".stJam1104_2.arCarrier,
	                    stInOutJamExit := "DB_JamArea1104".stJam1104_2.stData,
	                    arInOutJamBypass := "DB_JamArea1102".stJam1102_3.arCarrier,
	                    stInOutJamBypass := "DB_JamArea1102".stJam1102_3.stData,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO214,
	                    stMFRStorageRemovalInterface := "DB_HandshakeStorage".Str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl1[3],
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTRO214"],
	                    xOutSeparatorPin => "MB3120",
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX2106"],
	                    stConveyorStations:="DB_ConveyorStations".stConveyorStations113);
	        END_REGION
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO214.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO214.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1102".stJam1102_2.arCarrier[1]);
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO214.xInQuitLocal := "SF0125" OR "SF0117";
	            
	            #TRO214.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3150"];
	            
	            #TRO214.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3151"];
	            
	            #TRO214.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3152"];
	            
	            #TRO214.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3153"];
	            
	            #TRO214.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3154"];
	            
	            #TRO214.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3155"];
	            
	            #TRO214.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3156"];
	            
	            #TRO214.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3157"];
	            
	            #TRO214.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3160"];
	            
	            #TRO214.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3161"];
	            
	            #TRO214.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3162"];
	            
	            #TRO214.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3163"];
	            
	            #TRO214.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3164"];
	            
	            #TRO214.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG3165"];
	            
	            #TRO214.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG3166"];
	            
	            #TRO214.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG3167"];
	            
	            #TRO214.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG3170"];
	            
	            #TRO214.arInJamSensor[18] := "DB_Inputs".Sensors["cInBG3171"];
	            
	            #TRO214.arInJamSensor[19] := "DB_Inputs".Sensors["cInBG3172"];
	            
	            #TRO214.arInJamSensor[20] := "DB_Inputs".Sensors["cInBG3173"];
	            
	            #TRO214.arInJamSensor[21] := "DB_Inputs".Sensors["cInBG3174"];
	        END_REGION ;
	        
	        REGION Barcode Reader Out (BX2106)                
	            "bx2106-TriggerEnable" := #arCognexInterface["cScannerBX2106"].xOutCamTriggerEnable;
	            "bx2106-Trigger" := #arCognexInterface["cScannerBX2106"].xOutCamTrigger;
	            "bx2106-ResultsAck" := #arCognexInterface["cScannerBX2106"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB3390" := #TRO214.arOutSeparatorStore[1];
	            "MB3391" := #TRO214.arOutSeparatorStore[2];
	            "MB3392" := #TRO214.arOutSeparatorStore[3];
	            "MB3393" := #TRO214.arOutSeparatorStore[4];
	            "MB3394" := #TRO214.arOutSeparatorStore[5];
	            "MB3395" := #TRO214.arOutSeparatorStore[6];
	            "MB3396" := #TRO214.arOutSeparatorStore[7];
	            "MB3397" := #TRO214.arOutSeparatorStore[8];
	            "MB3400" := #TRO214.arOutSeparatorStore[9];
	            "MB3401" := #TRO214.arOutSeparatorStore[10];
	            "MB3402" := #TRO214.arOutSeparatorStore[11];
	            "MB3403" := #TRO214.arOutSeparatorStore[12];
	            "MB3404" := #TRO214.arOutSeparatorStore[13];
	            "MB3405" := #TRO214.arOutSeparatorStore[14];
	            "MB3406" := #TRO214.arOutSeparatorStore[15];
	            "MB3407" := #TRO214.arOutSeparatorStore[16];
	            "MB3410" := #TRO214.arOutSeparatorStore[17];
	            "MB3411" := #TRO214.arOutSeparatorStore[18];
	            "MB3412" := #TRO214.arOutSeparatorStore[19];
	            "MB3413" := #TRO214.arOutSeparatorStore[20];
	            "MB3414" := #TRO214.arOutSeparatorStore[21];
	        END_REGION
	        
	        REGION Unlaoding Stations Out
	            "MB3150" := #TRO214.arOutSwitch[1];
	            "MB3151" := #TRO214.arOutSwitch[2];
	            "MB3152" := #TRO214.arOutSwitch[3];
	            "MB3153" := #TRO214.arOutSwitch[4];
	            "MB3154" := #TRO214.arOutSwitch[5];
	            "MB3155" := #TRO214.arOutSwitch[6];
	            "MB3156" := #TRO214.arOutSwitch[7];
	            "MB3157" := #TRO214.arOutSwitch[8];
	            "MB3160" := #TRO214.arOutSwitch[9];
	            "MB3161" := #TRO214.arOutSwitch[10];
	            "MB3162" := #TRO214.arOutSwitch[11];
	            "MB3163" := #TRO214.arOutSwitch[12];
	            "MB3164" := #TRO214.arOutSwitch[13];
	            "MB3165" := #TRO214.arOutSwitch[14];
	            "MB3166" := #TRO214.arOutSwitch[15];
	            "MB3167" := #TRO214.arOutSwitch[16];
	            "MB3170" := #TRO214.arOutSwitch[17];
	            "MB3171" := #TRO214.arOutSwitch[18];
	            "MB3172" := #TRO214.arOutSwitch[19];
	            "MB3173" := #TRO214.arOutSwitch[20];
	            "MB3174" := #TRO214.arOutSwitch[21];
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 21 DO
	                IF #TRO214.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO214.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest11300" + #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 1.1.4 (TRO 217)
	        
	        REGION Encoder Settings
	            #TRO217.stInEncoderParameter.nPosActDif := #fbEncoderGF2201.nOutPosActDif;
	            #TRO217.stInEncoderParameter.nPosPitchPart := #fbEncoderGF2201.nPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO217.stInSettings.nDestGeneral := "cDest11400";
	            #TRO217.stInSettings.nConvStations := "cHooksSorterMaxPin114"; //Konstante todo
	            #TRO217.stInSettings.nStationsMax := "cStationsMax114"; // Konstante todo
	            #TRO217.stInSettings.nStorageThreshold := "cNoPositionsBlock1"; //Konstante todo
	            #TRO217.stInSettings.nNoOfLines := 13;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO217.stInSensorReference := "DB_Inputs".Sensors["cInBG3181"];
	        END_REGION
	        
	        REGION Barcode Reader In (BX2107)
	            #TRO217.stInBarcodeReader.Settings.nStation := 114; // todo Konstante
	            #TRO217.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO217.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO217.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX2107"].xInCamTriggerReady := "bx2107-TriggerReady";
	            #arCognexInterface["cScannerBX2107"].xInCamTriggerAck := "bx2107-TriggerAck";
	            #arCognexInterface["cScannerBX2107"].xInCamResultsAvailable := "bx2107-Results Available";
	            #arCognexInterface["cScannerBX2107"].xInCamGeneralFault := "bx2107-General Fault";
	            #arCognexInterface["cScannerBX2107"].hwInCamInspectionResults := "=A01+UH02-BX2107~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            
	            REGION Pin
	                #TRO217.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3180"];
	                #TRO217.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO217.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO217.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO217.arInSep[#nActNo].stSettings.nJamLength := "cStorage114ExitJam1";
	                #TRO217.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3450"];
	                #TRO217.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO217.arInSep[#nActNo].stSettings.nJamLength := "cStorage114ExitJam2";
	                #TRO217.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3451"];
	                #TRO217.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO217.arInSep[#nActNo].stSettings.nJamLength := "cStorage114ExitJam3";
	                #TRO217.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3452"];
	                #TRO217.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO217.arInSep[#nActNo].stSettings.nJamLength := "cStorage114ExitJam4";
	                #TRO217.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3453"];
	                #TRO217.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO217.arInSep[#nActNo].stSettings.nJamLength := "cStorage114ExitJam5";
	                #TRO217.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3454"];
	                #TRO217.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO217.arInSep[#nActNo].stSettings.nJamLength := "cStorage114ExitJam6";
	                #TRO217.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3455"];
	                #TRO217.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO217.arInSep[#nActNo].stSettings.nJamLength := "cStorage114ExitJam7";
	                #TRO217.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3456"];
	                #TRO217.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO217.arInSep[#nActNo].stSettings.nJamLength := "cStorage114ExitJam8";
	                #TRO217.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3457"];
	                #TRO217.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO217.arInSep[#nActNo].stSettings.nJamLength := "cStorage114ExitJam9";
	                #TRO217.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3460"];
	                #TRO217.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO217.arInSep[#nActNo].stSettings.nJamLength := "cStorage114ExitJam10";
	                #TRO217.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3461"];
	                #TRO217.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO217.arInSep[#nActNo].stSettings.nJamLength := "cStorage114ExitJam11";
	                #TRO217.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3462"];
	                #TRO217.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO217.arInSep[#nActNo].stSettings.nJamLength := "cStorage114ExitJam12";
	                #TRO217.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3463"];
	                #TRO217.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO217.arInSep[#nActNo].stSettings.nJamLength := "cStorage114ExitJam13";
	                #TRO217.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3464"];
	                #TRO217.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO217.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO217.xInQuitLocal := "SF0127" OR "SF0117";
	            
	            #TRO217.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3210"];
	            
	            #TRO217.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3211"];
	            
	            #TRO217.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3212"];
	            
	            #TRO217.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3213"];
	            
	            #TRO217.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3214"];
	            
	            #TRO217.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3215"];
	            
	            #TRO217.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3216"];
	            
	            #TRO217.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3217"];
	            
	            #TRO217.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3220"];
	            
	            #TRO217.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3221"];
	            
	            #TRO217.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3222"];
	            
	            #TRO217.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3223"];
	            
	            #TRO217.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3224"];
	        END_REGION
	        
	        
	        REGION Aufruf: TRO217
	            #TRO217.stInPriorityManager.xReleaseOk := "cTodoTRUE";
	            
	            #TRO217(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                    nInTestTarget := "IBN".nTestTarget114,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO217,
	                    xInConveyorRunIn := #fbSortConv1102.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv1104.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF2,
	                    arInOutStorageLines := "DB_Storage1.1.4".arLine,
	                    xOutSeparatorPin => "MB3180",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTRO217"],
	                    arInOutJamEntr := "DB_JamArea1102".stJam1102_3.arCarrier,
	                    stInOutJamEntr := "DB_JamArea1102".stJam1102_3.stData,
	                    arInOutJamExit := "DB_JamArea1104".stJam1104_1.arCarrier,
	                    stInOutJamExit := "DB_JamArea1104".stJam1104_1.stData,
	                    arInOutJamBypass := #arCarrierPlaceHolder,
	                    stInOutJamBypass := #stJamDataPlaceHolder,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO217,
	                    stMFRStorageRemovalInterface := "DB_HandshakeStorage".Str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl1[4],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX2107"],
	                    stConveyorStations := "DB_ConveyorStations".stConveyorStations114);
	        END_REGION
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO217.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO217.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1102".stJam1102_3.arCarrier[1]);
	        END_REGION
	        
	        REGION Barcode Reader Out (BX2107)                
	            "bx2107-TriggerEnable" := #arCognexInterface["cScannerBX2107"].xOutCamTriggerEnable;
	            "bx2107-Trigger" := #arCognexInterface["cScannerBX2107"].xOutCamTrigger;
	            "bx2107-ResultsAck" := #arCognexInterface["cScannerBX2107"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB3450" := #TRO217.arOutSeparatorStore[1];
	            "MB3451" := #TRO217.arOutSeparatorStore[2];
	            "MB3452" := #TRO217.arOutSeparatorStore[3];
	            "MB3453" := #TRO217.arOutSeparatorStore[4];
	            "MB3454" := #TRO217.arOutSeparatorStore[5];
	            "MB3455" := #TRO217.arOutSeparatorStore[6];
	            "MB3456" := #TRO217.arOutSeparatorStore[7];
	            "MB3457" := #TRO217.arOutSeparatorStore[8];
	            "MB3460" := #TRO217.arOutSeparatorStore[9];
	            "MB3461" := #TRO217.arOutSeparatorStore[10];
	            "MB3462" := #TRO217.arOutSeparatorStore[11];
	            "MB3463" := #TRO217.arOutSeparatorStore[12];
	            "MB3464" := #TRO217.arOutSeparatorStore[13];
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB3210" := #TRO217.arOutSwitch[1];
	            "MB3211" := #TRO217.arOutSwitch[2];
	            "MB3212" := #TRO217.arOutSwitch[3];
	            "MB3213" := #TRO217.arOutSwitch[4];
	            "MB3214" := #TRO217.arOutSwitch[5];
	            "MB3215" := #TRO217.arOutSwitch[6];
	            "MB3216" := #TRO217.arOutSwitch[7];
	            "MB3217" := #TRO217.arOutSwitch[8];
	            "MB3220" := #TRO217.arOutSwitch[9];
	            "MB3221" := #TRO217.arOutSwitch[10];
	            "MB3222" := #TRO217.arOutSwitch[11];
	            "MB3223" := #TRO217.arOutSwitch[12];
	            "MB3224" := #TRO217.arOutSwitch[13];
	        END_REGION
	        
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 13 DO
	                IF #TRO217.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO217.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest11400" + #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 1.2  
	    
	    REGION BLOCK 1.2.1 (TRO228)
	        REGION Encoder Settings
	            #TRO228.stInEncoderParameter.nPosActDif := #fbEncoderGF2202.nOutPosActDif;
	            #TRO228.stInEncoderParameter.nPosPitchPart := #fbEncoderGF2202.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO228.stInSettings.nDestGeneral := "cDest12100";
	            #TRO228.stInSettings.nConvStations := "cHooksSorterMaxPin121"; //Konstante todo
	            #TRO228.stInSettings.nStationsMax := "cStationsMax121"; // Konstante todo
	            #TRO228.stInSettings.nStorageThreshold := "cNoPositionsBlock2"; //Konstante todo
	            #TRO228.stInSettings.nNoOfLines := 19;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO228.stInSensorReference := "DB_Inputs".Sensors["cInBG3481"];
	        END_REGION
	        
	        REGION Barcode Reader (BX2122)
	            #TRO228.stInBarcodeReader.Settings.nStation := 121; // todo Konstante
	            #TRO228.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO228.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO228.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX2122"].xInCamTriggerReady := "bx2122-TriggerReady";
	            #arCognexInterface["cScannerBX2122"].xInCamTriggerAck := "bx2122-TriggerAck";
	            #arCognexInterface["cScannerBX2122"].xInCamResultsAvailable := "bx2122-Results Available";
	            #arCognexInterface["cScannerBX2122"].xInCamGeneralFault := "bx2122-General Fault";
	            #arCognexInterface["cScannerBX2122"].hwInCamInspectionResults := "=A01+UH02-BX2122~Ergebnisse_–_64_Bytes_1";
	            
	        END_REGION
	        
	        REGION Separator Settings
	            REGION Sep Pin 
	                #TRO228.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3480"];
	                #TRO228.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO228.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO228.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam1";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3750"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam2";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3751"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam3";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3752"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam4";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3753"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam5";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3754"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam6";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3755"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam7";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3756"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam8";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3757"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam9";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3760"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam10";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3761"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam11";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3762"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam12";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3763"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam13";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3764"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam14";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3765"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam15";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3766"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam16";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3767"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam17";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3770"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 18
	                #nActNo := 18;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam18";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3771"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 19
	                #nActNo := 19;
	                #TRO228.arInSep[#nActNo].stSettings.nJamLength := "cStorage121ExitJam19";
	                #TRO228.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3772"];
	                #TRO228.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO228.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO228.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	        END_REGION
	        
	        REGION Unloading Station Settings
	            #TRO228.xInQuitLocal := "SF0051";
	            
	            #TRO228.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3510"];
	            
	            #TRO228.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3511"];
	            
	            #TRO228.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3512"];
	            
	            #TRO228.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3513"];
	            
	            #TRO228.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3514"];
	            
	            #TRO228.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3515"];
	            
	            #TRO228.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3516"];
	            
	            #TRO228.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3517"];
	            
	            #TRO228.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3520"];
	            
	            #TRO228.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3521"];
	            
	            #TRO228.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3522"];
	            
	            #TRO228.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3523"];
	            
	            #TRO228.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3524"];
	            
	            #TRO228.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG3525"];
	            
	            #TRO228.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG3526"];
	            
	            #TRO228.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG3527"];
	            
	            #TRO228.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG3530"];
	            
	            #TRO228.arInJamSensor[18] := "DB_Inputs".Sensors["cInBG3531"];
	            
	            #TRO228.arInJamSensor[19] := "DB_Inputs".Sensors["cInBG3532"];
	            
	            
	            
	            
	        END_REGION
	        
	        REGION Aufruf: TRO228
	            
	            #TRO228.stInPriorityManager.xReleaseOk := TRUE;
	            
	            #TRO228(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                    nInTestTarget := "IBN".nTestTarget121,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO228,
	                    xInConveyorRunIn := #fbSortConv1201.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv1203.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                    arInOutStorageLines := "DB_Storage1.2.1".arLine,
	                    arInOutJamEntr := "DB_JamArea1201".stJam1201_2.arCarrier,
	                    stInOutJamEntr := "DB_JamArea1201".stJam1201_2.stData,
	                    arInOutJamExit := "DB_JamArea1203".stJam1203_1.arCarrier,
	                    stInOutJamExit := "DB_JamArea1203".stJam1203_1.stData,
	                    arInOutJamBypass := #arCarrierPlaceHolder,
	                    stInOutJamBypass := #stJamDataPlaceHolder,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO228,
	                    stMFRStorageRemovalInterface := "DB_HandshakeStorage".Str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl1[5],
	                    xOutSeparatorPin => "MB3480",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro327"],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX2122"],
	                    stConveyorStations:="DB_ConveyorStations".stConveyorStations121);
	        END_REGION ;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO228.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO228.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1201".stJam1201_2.arCarrier[1]);
	        END_REGION
	        
	        REGION Barcode Reader OUT
	            "bx2122-TriggerEnable" := #arCognexInterface["cScannerBX2122"].xOutCamTriggerEnable;
	            "bx2122-Trigger" := #arCognexInterface["cScannerBX2122"].xOutCamTrigger;
	            "bx2122-ResultsAck" := #arCognexInterface["cScannerBX2122"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store OUT
	            "MB3750" := #TRO228.arOutSeparatorStore[1];
	            "MB3751" := #TRO228.arOutSeparatorStore[2];
	            "MB3752" := #TRO228.arOutSeparatorStore[3];
	            "MB3753" := #TRO228.arOutSeparatorStore[4];
	            "MB3754" := #TRO228.arOutSeparatorStore[5];
	            "MB3755" := #TRO228.arOutSeparatorStore[6];
	            "MB3756" := #TRO228.arOutSeparatorStore[7];
	            "MB3757" := #TRO228.arOutSeparatorStore[8];
	            "MB3760" := #TRO228.arOutSeparatorStore[9];
	            "MB3761" := #TRO228.arOutSeparatorStore[10];
	            "MB3762" := #TRO228.arOutSeparatorStore[11];
	            "MB3763" := #TRO228.arOutSeparatorStore[12];
	            "MB3764" := #TRO228.arOutSeparatorStore[13];
	            "MB3765" := #TRO228.arOutSeparatorStore[14];
	            "MB3766" := #TRO228.arOutSeparatorStore[15];
	            "MB3767" := #TRO228.arOutSeparatorStore[16];
	            "MB3770" := #TRO228.arOutSeparatorStore[17];
	            "MB3771" := #TRO228.arOutSeparatorStore[18];
	            "MB3772" := #TRO228.arOutSeparatorStore[19];
	            
	            
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB3510" := #TRO228.arOutSwitch[1];
	            "MB3511" := #TRO228.arOutSwitch[2];
	            "MB3512" := #TRO228.arOutSwitch[3];
	            "MB3513" := #TRO228.arOutSwitch[4];
	            "MB3514" := #TRO228.arOutSwitch[5];
	            "MB3515" := #TRO228.arOutSwitch[6];
	            "MB3516" := #TRO228.arOutSwitch[7];
	            "MB3517" := #TRO228.arOutSwitch[8];
	            "MB3520" := #TRO228.arOutSwitch[9];
	            "MB3521" := #TRO228.arOutSwitch[10];
	            "MB3522" := #TRO228.arOutSwitch[11];
	            "MB3523" := #TRO228.arOutSwitch[12];
	            "MB3524" := #TRO228.arOutSwitch[13];
	            "MB3525" := #TRO228.arOutSwitch[14];
	            "MB3526" := #TRO228.arOutSwitch[15];
	            "MB3527" := #TRO228.arOutSwitch[16];
	            "MB3530" := #TRO228.arOutSwitch[17];
	            "MB3531" := #TRO228.arOutSwitch[18];
	            "MB3532" := #TRO228.arOutSwitch[19];
	            
	        END_REGION
	        
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 19 DO
	                IF #TRO228.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO228.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest12100" + #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 1.2.2 (TRO231)
	        REGION Encoder Settings
	            #TRO231.stInEncoderParameter.nPosActDif := #fbEncoderGF2202.nOutPosActDif;
	            #TRO231.stInEncoderParameter.nPosPitchPart := #fbEncoderGF2202.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO231.stInSettings.nDestGeneral := "cDest12200";
	            #TRO231.stInSettings.nConvStations := "cHooksSorterMaxPin122"; //Konstante todo
	            #TRO231.stInSettings.nStationsMax := "cStationsMax122"; // Konstante todo
	            #TRO231.stInSettings.nStorageThreshold := "cNoPositionsBlock2"; //Konstante todo
	            #TRO231.stInSettings.nNoOfLines := 17;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO231.stInSensorReference := "DB_Inputs".Sensors["cInBG3541"];
	        END_REGION
	        
	        REGION Barcode Reader (BX2123)
	            #TRO231.stInBarcodeReader.Settings.nStation := 122; // todo Konstante
	            #TRO231.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO231.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO231.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX2123"].xInCamTriggerReady := "bx2123-TriggerReady";
	            #arCognexInterface["cScannerBX2123"].xInCamTriggerAck := "bx2123-TriggerAck";
	            #arCognexInterface["cScannerBX2123"].xInCamResultsAvailable := "bx2123-Results Available";
	            #arCognexInterface["cScannerBX2123"].xInCamGeneralFault := "bx2123-General Fault";
	            #arCognexInterface["cScannerBX2123"].hwInCamInspectionResults := "=A01+UH02-BX2123~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings 
	            REGION Sep Pin
	                #TRO231.stInSeparatorPin.stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO231.stInSeparatorPin.stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO231.stInSeparatorPin.stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO231.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3540"];
	                #TRO231.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO231.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO231.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam1";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3810"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam2";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3811"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam3";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3812"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam4";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3813"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam5";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3814"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam6";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3815"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam7";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3816"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam8";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3817"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam9";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3820"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam10";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3821"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam11";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3822"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam12";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3823"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam13";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3824"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam14";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3825"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam15";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3826"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam16";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3827"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO231.arInSep[#nActNo].stSettings.nJamLength := "cStorage122ExitJam17";
	                #TRO231.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3830"];
	                #TRO231.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO231.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO231.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO231.xInQuitLocal := "SF0053";
	            
	            #TRO231.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3570"];
	            
	            #TRO231.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3571"];
	            
	            #TRO231.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3572"];
	            
	            #TRO231.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3573"];
	            
	            #TRO231.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3574"];
	            
	            #TRO231.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3575"];
	            
	            #TRO231.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3576"];
	            
	            #TRO231.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3577"];
	            
	            #TRO231.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3580"];
	            
	            #TRO231.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3581"];
	            
	            #TRO231.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3582"];
	            
	            #TRO231.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3583"];
	            
	            #TRO231.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3584"];
	            
	            #TRO231.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG3585"];
	            
	            #TRO231.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG3586"];
	            
	            #TRO231.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG3587"];
	            
	            #TRO231.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG3590"];
	        END_REGION
	        
	        REGION Aufruf: TRO231
	            
	            #TRO231.stInPriorityManager.xReleaseOk := TRUE;
	            
	            #TRO231(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                    nInTestTarget := "IBN".nTestTarget122,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO231,
	                    xInConveyorRunIn := #fbSortConv1201.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv1203.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                    arInOutStorageLines := "DB_Storage1.2.2".arLine,
	                    arInOutJamEntr := "DB_JamArea1201".stJam1201_1.arCarrier,
	                    stInOutJamEntr := "DB_JamArea1201".stJam1201_1.stData,
	                    arInOutJamExit := "DB_JamArea1203".stJam1203_2.arCarrier,
	                    stInOutJamExit := "DB_JamArea1203".stJam1203_2.stData,
	                    arInOutJamBypass := "DB_JamArea1201".stJam1201_2.arCarrier,
	                    stInOutJamBypass := "DB_JamArea1201".stJam1201_2.stData,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO231,
	                    stMFRStorageRemovalInterface := "DB_HandshakeStorage".Str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl1[6],
	                    xOutSeparatorPin => "MB3540",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro327"],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX2123"],
	                    stConveyorStations:="DB_ConveyorStations".stConveyorStations122);
	        END_REGION ;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO231.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO231.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1201".stJam1201_1.arCarrier[1]);
	        END_REGION
	        
	        REGION Barcode-Reader OUT
	            "bx2123-TriggerEnable" := #arCognexInterface["cScannerBX2123"].xOutCamTriggerEnable;
	            "bx2123-Trigger" := #arCognexInterface["cScannerBX2123"].xOutCamTrigger;
	            "bx2123-ResultsAck" := #arCognexInterface["cScannerBX2123"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB3810" := #TRO231.arOutSeparatorStore[1];
	            "MB3811" := #TRO231.arOutSeparatorStore[2];
	            "MB3812" := #TRO231.arOutSeparatorStore[3];
	            "MB3813" := #TRO231.arOutSeparatorStore[4];
	            "MB3814" := #TRO231.arOutSeparatorStore[5];
	            "MB3815" := #TRO231.arOutSeparatorStore[6];
	            "MB3816" := #TRO231.arOutSeparatorStore[7];
	            "MB3817" := #TRO231.arOutSeparatorStore[8];
	            "MB3820" := #TRO231.arOutSeparatorStore[9];
	            "MB3821" := #TRO231.arOutSeparatorStore[10];
	            "MB3822" := #TRO231.arOutSeparatorStore[11];
	            "MB3823" := #TRO231.arOutSeparatorStore[12];
	            "MB3824" := #TRO231.arOutSeparatorStore[13];
	            "MB3825" := #TRO231.arOutSeparatorStore[14];
	            "MB3826" := #TRO231.arOutSeparatorStore[15];
	            "MB3827" := #TRO231.arOutSeparatorStore[16];
	            "MB3830" := #TRO231.arOutSeparatorStore[17];
	            
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB3570" := #TRO231.arOutSwitch[1];
	            "MB3571" := #TRO231.arOutSwitch[2];
	            "MB3572" := #TRO231.arOutSwitch[3];
	            "MB3573" := #TRO231.arOutSwitch[4];
	            "MB3574" := #TRO231.arOutSwitch[5];
	            "MB3575" := #TRO231.arOutSwitch[6];
	            "MB3576" := #TRO231.arOutSwitch[7];
	            "MB3577" := #TRO231.arOutSwitch[8];
	            "MB3580" := #TRO231.arOutSwitch[9];
	            "MB3581" := #TRO231.arOutSwitch[10];
	            "MB3582" := #TRO231.arOutSwitch[11];
	            "MB3583" := #TRO231.arOutSwitch[12];
	            "MB3584" := #TRO231.arOutSwitch[13];
	            "MB3585" := #TRO231.arOutSwitch[14];
	            "MB3586" := #TRO231.arOutSwitch[15];
	            "MB3587" := #TRO231.arOutSwitch[16];
	            "MB3590" := #TRO231.arOutSwitch[17];
	        END_REGION
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 17 DO
	                IF #TRO231.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO231.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest12200" + #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 1.2.3 (TRO234)
	        REGION Encoder Settings
	            #TRO234.stInEncoderParameter.nPosActDif := #fbEncoderGF2203.nOutPosActDif;
	            #TRO234.stInEncoderParameter.nPosPitchPart := #fbEncoderGF2203.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO234.stInSettings.nDestGeneral := "cDest12300";
	            #TRO234.stInSettings.nConvStations := "cHooksSorterMaxPin123"; //Konstante todo
	            #TRO234.stInSettings.nStationsMax := "cStationsMax123"; // Konstante todo
	            #TRO234.stInSettings.nStorageThreshold := "cNoPositionsBlock2"; //Konstante todo
	            #TRO234.stInSettings.nNoOfLines := 21;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO234.stInSensorReference := "DB_Inputs".Sensors["cInBG3601"];
	        END_REGION
	        
	        REGION Barcode Reader (BX2124)
	            #TRO234.stInBarcodeReader.Settings.nStation := 123; // todo Konstante
	            #TRO234.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO234.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO234.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX2124"].xInCamTriggerReady := "bx2124-TriggerReady";
	            #arCognexInterface["cScannerBX2124"].xInCamTriggerAck := "bx2124-TriggerAck";
	            #arCognexInterface["cScannerBX2124"].xInCamResultsAvailable := "bx2124-Results Available";
	            #arCognexInterface["cScannerBX2124"].xInCamGeneralFault := "bx2124-General Fault";
	            #arCognexInterface["cScannerBX2124"].hwInCamInspectionResults := "=A01+UH02-BX2124~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            REGION Sep Pin
	                #TRO234.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3600"];
	                #TRO234.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO234.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO234.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam1";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3870"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam2";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3871"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam3";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3872"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam4";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3873"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam5";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3874"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam6";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3875"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam7";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3876"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam8";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3877"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam9";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3880"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam10";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3881"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam11";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3882"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam12";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3883"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam13";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3884"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam14";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3885"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam15";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3886"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam16";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3887"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam17";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3890"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 18
	                #nActNo := 18;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam18";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3891"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 19
	                #nActNo := 19;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam19";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3892"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 20
	                #nActNo := 20;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam10";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3893"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 21
	                #nActNo := 21;
	                #TRO234.arInSep[#nActNo].stSettings.nJamLength := "cStorage123ExitJam11";
	                #TRO234.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3894"];
	                #TRO234.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO234.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO234.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO234.xInQuitLocal := "SF0055";
	            
	            #TRO234.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3630"];
	            
	            #TRO234.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3631"];
	            
	            #TRO234.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3632"];
	            
	            #TRO234.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3633"];
	            
	            #TRO234.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3634"];
	            
	            #TRO234.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3635"];
	            
	            #TRO234.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3636"];
	            
	            #TRO234.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3637"];
	            
	            #TRO234.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3640"];
	            
	            #TRO234.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3641"];
	            
	            #TRO234.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3642"];
	            
	            #TRO234.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3643"];
	            
	            #TRO234.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3644"];
	            
	            #TRO234.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG3645"];
	            
	            #TRO234.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG3646"];
	            
	            #TRO234.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG3647"];
	            
	            #TRO234.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG3650"];
	            
	            #TRO234.arInJamSensor[18] := "DB_Inputs".Sensors["cInBG3651"];
	            
	            #TRO234.arInJamSensor[19] := "DB_Inputs".Sensors["cInBG3652"];
	            
	            #TRO234.arInJamSensor[20] := "DB_Inputs".Sensors["cInBG3653"];
	            
	            #TRO234.arInJamSensor[21] := "DB_Inputs".Sensors["cInBG3654"];
	            
	        END_REGION
	        
	        REGION Aufruf: TRO234
	            
	            #TRO234.stInPriorityManager.xReleaseOk := TRUE;
	            
	            #TRO234(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                    nInTestTarget := "IBN".nTestTarget123,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO234,
	                    xInConveyorRunIn := #fbSortConv1202.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv1204.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                    arInOutStorageLines := "DB_Storage1.2.3".arLine,
	                    arInOutJamEntr := "DB_JamArea1202".stJam1202_2.arCarrier,
	                    stInOutJamEntr := "DB_JamArea1202".stJam1202_2.stData,
	                    arInOutJamExit := "DB_JamArea1204".stJam1204_2.arCarrier,
	                    stInOutJamExit := "DB_JamArea1204".stJam1204_2.stData,
	                    arInOutJamBypass := "DB_JamArea1202".stJam1202_3.arCarrier,
	                    stInOutJamBypass := "DB_JamArea1202".stJam1202_3.stData,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO234,
	                    stMFRStorageRemovalInterface := "DB_HandshakeStorage".Str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl1[7],
	                    xOutSeparatorPin => "MB3600",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro327"],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX2124"],
	                    stConveyorStations:="DB_ConveyorStations".stConveyorStations123);
	        END_REGION
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO234.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO234.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1202".stJam1202_3.arCarrier[1]);
	        END_REGION
	        
	        REGION Barcode Reader OUT (BX2124)                
	            "bx2124-TriggerEnable" := #arCognexInterface["cScannerBX2124"].xOutCamTriggerEnable;
	            "bx2124-Trigger" := #arCognexInterface["cScannerBX2124"].xOutCamTrigger;
	            "bx2124-ResultsAck" := #arCognexInterface["cScannerBX2124"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB3870" := #TRO234.arOutSeparatorStore[1];
	            "MB3871" := #TRO234.arOutSeparatorStore[2];
	            "MB3872" := #TRO234.arOutSeparatorStore[3];
	            "MB3873" := #TRO234.arOutSeparatorStore[4];
	            "MB3874" := #TRO234.arOutSeparatorStore[5];
	            "MB3875" := #TRO234.arOutSeparatorStore[6];
	            "MB3876" := #TRO234.arOutSeparatorStore[7];
	            "MB3877" := #TRO234.arOutSeparatorStore[8];
	            "MB3880" := #TRO234.arOutSeparatorStore[9];
	            "MB3881" := #TRO234.arOutSeparatorStore[10];
	            "MB3882" := #TRO234.arOutSeparatorStore[11];
	            "MB3883" := #TRO234.arOutSeparatorStore[12];
	            "MB3884" := #TRO234.arOutSeparatorStore[13];
	            "MB3885" := #TRO234.arOutSeparatorStore[14];
	            "MB3886" := #TRO234.arOutSeparatorStore[15];
	            "MB3887" := #TRO234.arOutSeparatorStore[16];
	            "MB3890" := #TRO234.arOutSeparatorStore[17];
	            "MB3891" := #TRO234.arOutSeparatorStore[18];
	            "MB3892" := #TRO234.arOutSeparatorStore[19];
	            "MB3893" := #TRO234.arOutSeparatorStore[20];
	            "MB3894" := #TRO234.arOutSeparatorStore[21];
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB3630" := #TRO234.arOutSwitch[1];
	            "MB3631" := #TRO234.arOutSwitch[2];
	            "MB3632" := #TRO234.arOutSwitch[3];
	            "MB3633" := #TRO234.arOutSwitch[4];
	            "MB3634" := #TRO234.arOutSwitch[5];
	            "MB3635" := #TRO234.arOutSwitch[6];
	            "MB3636" := #TRO234.arOutSwitch[7];
	            "MB3637" := #TRO234.arOutSwitch[8];
	            "MB3640" := #TRO234.arOutSwitch[9];
	            "MB3641" := #TRO234.arOutSwitch[10];
	            "MB3642" := #TRO234.arOutSwitch[11];
	            "MB3643" := #TRO234.arOutSwitch[12];
	            "MB3644" := #TRO234.arOutSwitch[13];
	            "MB3645" := #TRO234.arOutSwitch[14];
	            "MB3646" := #TRO234.arOutSwitch[15];
	            "MB3647" := #TRO234.arOutSwitch[16];
	            "MB3650" := #TRO234.arOutSwitch[17];
	            "MB3651" := #TRO234.arOutSwitch[18];
	            "MB3652" := #TRO234.arOutSwitch[19];
	            "MB3653" := #TRO234.arOutSwitch[20];
	            "MB3654" := #TRO234.arOutSwitch[21];
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 21 DO
	                IF #TRO234.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO234.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest12300" + #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 1.2.4 (TRO237)
	        REGION Encoder Settings
	            #TRO237.stInEncoderParameter.nPosActDif := #fbEncoderGF2203.nOutPosActDif;
	            #TRO237.stInEncoderParameter.nPosPitchPart := #fbEncoderGF2203.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO237.stInSettings.nDestGeneral := "cDest12400";
	            #TRO237.stInSettings.nConvStations := "cHooksSorterMaxPin124"; //Konstante todo
	            #TRO237.stInSettings.nStationsMax := "cStationsMax124"; // Konstante todo
	            #TRO237.stInSettings.nStorageThreshold := "cNoPositionsBlock2"; //Konstante todo
	            #TRO237.stInSettings.nNoOfLines := 13;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO237.stInSensorReference := "DB_Inputs".Sensors["cInBG3661"];
	        END_REGION
	        
	        REGION Barcode Reader (BX2125)
	            #TRO237.stInBarcodeReader.Settings.nStation := 124; // todo Konstante
	            #TRO237.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO237.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO237.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX2125"].xInCamTriggerReady := "bx2125-TriggerReady";
	            #arCognexInterface["cScannerBX2125"].xInCamTriggerAck := "bx2125-TriggerAck";
	            #arCognexInterface["cScannerBX2125"].xInCamResultsAvailable := "bx2125-Results Available";
	            #arCognexInterface["cScannerBX2125"].xInCamGeneralFault := "bx2125-General Fault";
	            #arCognexInterface["cScannerBX2125"].hwInCamInspectionResults := "=A01+UH02-BX2125~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            REGION Sep Pin
	                #TRO237.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG3660"];
	                #TRO237.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO237.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO237.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO237.arInSep[#nActNo].stSettings.nJamLength := "cStorage124ExitJam1";
	                #TRO237.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3930"];
	                #TRO237.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO237.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO237.arInSep[#nActNo].stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO237.arInSep[#nActNo].stSettings.nJamLength := "cStorage124ExitJam2";
	                #TRO237.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3931"];
	                #TRO237.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO237.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO237.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO237.arInSep[#nActNo].stSettings.nJamLength := "cStorage124ExitJam3";
	                #TRO237.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3932"];
	                #TRO237.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO237.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO237.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO237.arInSep[#nActNo].stSettings.nJamLength := "cStorage124ExitJam4";
	                #TRO237.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3933"];
	                #TRO237.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO237.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO237.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO237.arInSep[#nActNo].stSettings.nJamLength := "cStorage124ExitJam5";
	                #TRO237.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3934"];
	                #TRO237.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO237.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO237.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO237.arInSep[#nActNo].stSettings.nJamLength := "cStorage124ExitJam6";
	                #TRO237.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3935"];
	                #TRO237.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO237.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO237.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO237.arInSep[#nActNo].stSettings.nJamLength := "cStorage124ExitJam7";
	                #TRO237.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3936"];
	                #TRO237.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO237.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO237.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO237.arInSep[#nActNo].stSettings.nJamLength := "cStorage124ExitJam8";
	                #TRO237.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3937"];
	                #TRO237.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO237.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO237.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO237.arInSep[#nActNo].stSettings.nJamLength := "cStorage124ExitJam9";
	                #TRO237.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3940"];
	                #TRO237.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO237.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO237.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO237.arInSep[#nActNo].stSettings.nJamLength := "cStorage124ExitJam10";
	                #TRO237.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3941"];
	                #TRO237.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO237.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO237.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO237.arInSep[#nActNo].stSettings.nJamLength := "cStorage124ExitJam11";
	                #TRO237.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3942"];
	                #TRO237.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO237.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO237.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO237.arInSep[#nActNo].stSettings.nJamLength := "cStorage124ExitJam12";
	                #TRO237.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3943"];
	                #TRO237.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO237.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO237.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO237.arInSep[#nActNo].stSettings.nJamLength := "cStorage124ExitJam13";
	                #TRO237.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3944"];
	                #TRO237.arInSep[#nActNo].stSettings.tHandlingTime := T#300ms;
	                #TRO237.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO237.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO237.xInQuitLocal := "SF0057";
	            
	            #TRO237.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG3690"];
	            
	            #TRO237.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG3691"];
	            
	            #TRO237.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG3692"];
	            
	            #TRO237.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG3693"];
	            
	            #TRO237.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG3694"];
	            
	            #TRO237.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG3695"];
	            
	            #TRO237.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG3696"];
	            
	            #TRO237.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG3697"];
	            
	            #TRO237.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG3700"];
	            
	            #TRO237.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG3701"];
	            
	            #TRO237.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG3702"];
	            
	            #TRO237.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG3703"];
	            
	            #TRO237.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG3704"];
	            
	            
	        END_REGION
	        
	        REGION Aufruf: TRO237
	            
	            #TRO237.stInPriorityManager.xReleaseOk := TRUE;
	            
	            #TRO237(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                    nInTestTarget := "IBN".nTestTarget124,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO237,
	                    xInConveyorRunIn := #fbSortConv1202.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv1204.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF1,
	                    arInOutStorageLines := "DB_Storage1.2.4".arLine,
	                    arInOutJamEntr := "DB_JamArea1202".stJam1202_3.arCarrier,
	                    stInOutJamEntr := "DB_JamArea1202".stJam1202_3.stData,
	                    arInOutJamExit := "DB_JamArea1204".stJam1204_1.arCarrier,
	                    stInOutJamExit := "DB_JamArea1204".stJam1204_1.stData,
	                    arInOutJamBypass := #arCarrierPlaceHolder,
	                    stInOutJamBypass := #stJamDataPlaceHolder,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO237,
	                    stMFRStorageRemovalInterface := "DB_HandshakeStorage".Str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl1[8],
	                    xOutSeparatorPin => "MB3660",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro327"],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX2125"],
	                    stConveyorStations := "DB_ConveyorStations".stConveyorStations124);
	            
	            
	        END_REGION
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO237.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO237.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1202".stJam1202_3.arCarrier[1]);
	        END_REGION
	        
	        REGION Barcode Reader OUT (BX2125)
	            "bx2125-TriggerEnable" := #arCognexInterface["cScannerBX2125"].xOutCamTriggerEnable;
	            "bx2125-Trigger" := #arCognexInterface["cScannerBX2125"].xOutCamTrigger;
	            "bx2125-ResultsAck" := #arCognexInterface["cScannerBX2125"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB3930" := #TRO237.arOutSeparatorStore[1];
	            "MB3931" := #TRO237.arOutSeparatorStore[2];
	            "MB3932" := #TRO237.arOutSeparatorStore[3];
	            "MB3933" := #TRO237.arOutSeparatorStore[4];
	            "MB3934" := #TRO237.arOutSeparatorStore[5];
	            "MB3935" := #TRO237.arOutSeparatorStore[6];
	            "MB3936" := #TRO237.arOutSeparatorStore[7];
	            "MB3937" := #TRO237.arOutSeparatorStore[8];
	            "MB3940" := #TRO237.arOutSeparatorStore[9];
	            "MB3941" := #TRO237.arOutSeparatorStore[10];
	            "MB3942" := #TRO237.arOutSeparatorStore[11];
	            "MB3943" := #TRO237.arOutSeparatorStore[12];
	            "MB3944" := #TRO237.arOutSeparatorStore[13];
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB3690" := #TRO237.arOutSwitch[1];
	            "MB3691" := #TRO237.arOutSwitch[2];
	            "MB3692" := #TRO237.arOutSwitch[3];
	            "MB3693" := #TRO237.arOutSwitch[4];
	            "MB3694" := #TRO237.arOutSwitch[5];
	            "MB3695" := #TRO237.arOutSwitch[6];
	            "MB3696" := #TRO237.arOutSwitch[7];
	            "MB3697" := #TRO237.arOutSwitch[8];
	            "MB3700" := #TRO237.arOutSwitch[9];
	            "MB3701" := #TRO237.arOutSwitch[10];
	            "MB3702" := #TRO237.arOutSwitch[11];
	            "MB3703" := #TRO237.arOutSwitch[12];
	            "MB3704" := #TRO237.arOutSwitch[13];
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 13 DO
	                IF #TRO237.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO237.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest12400" + #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 1.3
	    REGION BLOCK 1.3.1 (TRO 248)  
	        
	        REGION Encoder Settings
	            #TRO248.stInEncoderParameter.nPosActDif := #fbEncoderGF2204.nOutPosActDif;
	            #TRO248.stInEncoderParameter.nPosPitchPart := #fbEncoderGF2204.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO248.stInSettings.nDestGeneral := "cDest13100";
	            #TRO248.stInSettings.nConvStations := "cHooksSorterMaxPin131"; //Konstante todo
	            #TRO248.stInSettings.nStationsMax := "cStationsMax131"; // Konstante todo
	            #TRO248.stInSettings.nStorageThreshold := "cNoPositionsBlock3"; //Konstante todo
	            #TRO248.stInSettings.nNoOfLines := 19;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO248.stInSensorReference := "DB_Inputs".Sensors["cInBG4201"];
	        END_REGION
	        
	        REGION Barcode Reader In (BX2131)
	            #TRO248.stInBarcodeReader.Settings.nStation := 131; // todo Konstante
	            #TRO248.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO248.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO248.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX2131"].xInCamTriggerReady := "bx2131-TriggerReady";
	            #arCognexInterface["cScannerBX2131"].xInCamTriggerAck := "bx2131-TriggerAck";
	            #arCognexInterface["cScannerBX2131"].xInCamResultsAvailable := "bx2131-Results Available";
	            #arCognexInterface["cScannerBX2131"].xInCamGeneralFault := "bx2131-General Fault";
	            #arCognexInterface["cScannerBX2131"].hwInCamInspectionResults := "=A01+UC023-BX2131~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            REGION Sep Pin
	                #TRO248.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG4200"];
	                #TRO248.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO248.stInSeparatorPin.stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := 4;//"cStorage131ExitJam1";
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3990"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam2";
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3991"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam3";
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3992"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam4";
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3993"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam5";
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3994"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam6";
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3995"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam7";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3996"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam8";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG3997"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam9";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4000"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam10";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4001"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam11";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4002"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam12";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4003"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam13";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4004"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam14";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4005"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam15";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4006"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam16";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4007"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam17";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4010"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 18
	                #nActNo := 18;
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam18";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4011"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 19
	                #nActNo := 19;
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.xActive := "DB_SIM_PARAM".xSimuActive;
	                #TRO248.arInSep[#nActNo].stSettings.nJamLength := "cStorage131ExitJam19";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.tSenTime := "tSimuSenTime";
	                #TRO248.arInSep[#nActNo].stSettings.stSimu.stJamConfig := "DB_SIM_PARAM".stStorageLineGlob.stSimuJamConfig;
	                #TRO248.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4012"];
	                #TRO248.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO248.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO248.xInQuitLocal := "SF0241" OR "SF0237";
	            
	            #TRO248.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG4230"];
	            
	            #TRO248.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG4231"];
	            
	            #TRO248.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG4232"];
	            
	            #TRO248.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG4233"];
	            
	            #TRO248.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG4234"];
	            
	            #TRO248.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG4235"];
	            
	            #TRO248.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG4236"];
	            
	            #TRO248.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG4237"];
	            
	            #TRO248.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG4240"];
	            
	            #TRO248.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG4241"];
	            
	            #TRO248.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG4242"];
	            
	            #TRO248.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG4243"];
	            
	            #TRO248.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG4244"];
	            
	            #TRO248.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG4245"];
	            
	            #TRO248.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG4246"];
	            
	            #TRO248.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG4247"];
	            
	            #TRO248.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG4250"];
	            
	            #TRO248.arInJamSensor[18] := "DB_Inputs".Sensors["cInBG4251"];
	            
	            #TRO248.arInJamSensor[19] := "DB_Inputs".Sensors["cInBG4252"];
	            
	        END_REGION
	        
	        REGION Aufruf: TRO248
	            
	            #TRO248.stInPriorityManager.xReleaseOk := TRUE;
	            
	            #TRO248(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                    nInTestTarget := "IBN".nTestTarget131,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO248,
	                    xInConveyorRunIn := #fbSortConv1303.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv1301.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF4,
	                    arInOutStorageLines := "DB_Storage1.3.1".arLine,
	                    arInOutJamEntr := "DB_JamArea1303".stJam1303_2.arCarrier,
	                    stInOutJamEntr := "DB_JamArea1303".stJam1303_2.stData,
	                    arInOutJamExit := "DB_JamArea1301".stJam1301_1.arCarrier,
	                    stInOutJamExit := "DB_JamArea1301".stJam1301_1.stData,
	                    arInOutJamBypass := #arCarrierPlaceHolder,
	                    stInOutJamBypass := #stJamDataPlaceHolder,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO248,
	                    stMFRStorageRemovalInterface := "DB_HandshakeStorage".Str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl1[9],
	                    xOutSeparatorPin => "MB4200",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTRO248"],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX2131"],
	                    stConveyorStations:="DB_ConveyorStations".stConveyorStations131);
	        END_REGION ;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO248.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO248.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1303".stJam1303_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Barcode Reader Out (BX2131)
	            "bx2131-TriggerEnable" := #arCognexInterface["cScannerBX2131"].xOutCamTriggerEnable;
	            "bx2131-Trigger" := #arCognexInterface["cScannerBX2131"].xOutCamTrigger;
	            "bx2131-ResultsAck" := #arCognexInterface["cScannerBX2131"].xOutCamResultsAck;
	        END_REGION
	        
	        
	        
	        REGION Separator Store Out
	            "MB3990" := #TRO248.arOutSeparatorStore[1];
	            "MB3991" := #TRO248.arOutSeparatorStore[2];
	            "MB3992" := #TRO248.arOutSeparatorStore[3];
	            "MB3993" := #TRO248.arOutSeparatorStore[4];
	            "MB3994" := #TRO248.arOutSeparatorStore[5];
	            "MB3995" := #TRO248.arOutSeparatorStore[6];
	            "MB3996" := #TRO248.arOutSeparatorStore[7];
	            "MB3997" := #TRO248.arOutSeparatorStore[8];
	            "MB4000" := #TRO248.arOutSeparatorStore[9];
	            "MB4001" := #TRO248.arOutSeparatorStore[10];
	            "MB4002" := #TRO248.arOutSeparatorStore[11];
	            "MB4003" := #TRO248.arOutSeparatorStore[12];
	            "MB4004" := #TRO248.arOutSeparatorStore[13];
	            "MB4005" := #TRO248.arOutSeparatorStore[14];
	            "MB4006" := #TRO248.arOutSeparatorStore[15];
	            "MB4007" := #TRO248.arOutSeparatorStore[16];
	            "MB4010" := #TRO248.arOutSeparatorStore[17];
	            "MB4011" := #TRO248.arOutSeparatorStore[18];
	            "MB4012" := #TRO248.arOutSeparatorStore[19];
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB4230" := #TRO248.arOutSwitch[1];
	            "MB4231" := #TRO248.arOutSwitch[2];
	            "MB4232" := #TRO248.arOutSwitch[3];
	            "MB4233" := #TRO248.arOutSwitch[4];
	            "MB4234" := #TRO248.arOutSwitch[5];
	            "MB4235" := #TRO248.arOutSwitch[6];
	            "MB4236" := #TRO248.arOutSwitch[7];
	            "MB4237" := #TRO248.arOutSwitch[8];
	            "MB4240" := #TRO248.arOutSwitch[9];
	            "MB4241" := #TRO248.arOutSwitch[10];
	            "MB4242" := #TRO248.arOutSwitch[11];
	            "MB4243" := #TRO248.arOutSwitch[12];
	            "MB4244" := #TRO248.arOutSwitch[13];
	            "MB4245" := #TRO248.arOutSwitch[14];
	            "MB4246" := #TRO248.arOutSwitch[15];
	            "MB4247" := #TRO248.arOutSwitch[16];
	            "MB4250" := #TRO248.arOutSwitch[17];
	            "MB4251" := #TRO248.arOutSwitch[18];
	            "MB4252" := #TRO248.arOutSwitch[19];
	        END_REGION
	        
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 19 DO
	                IF #TRO248.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO248.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest13100" + #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 1.3.2 (TRO 251)
	        REGION Encoder Settings
	            #TRO251.stInEncoderParameter.nPosActDif := #fbEncoderGF2204.nOutPosActDif;
	            #TRO251.stInEncoderParameter.nPosPitchPart := #fbEncoderGF2204.nOutPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO251.stInSettings.nDestGeneral := "cDest13200";
	            #TRO251.stInSettings.nConvStations := "cHooksSorterMaxPin132"; //Konstante todo
	            #TRO251.stInSettings.nStationsMax := "cStationsMax132"; // Konstante todo
	            #TRO251.stInSettings.nStorageThreshold := "cNoPositionsBlock3"; //Konstante todo
	            #TRO251.stInSettings.nNoOfLines := 17;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO251.stInSensorReference := "DB_Inputs".Sensors["cInBG4261"];
	        END_REGION
	        
	        REGION Barcode Reader IN (BX2132)
	            #TRO251.stInBarcodeReader.Settings.nStation := 132; // todo Konstante
	            #TRO251.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO251.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO251.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX2132"].xInCamTriggerReady := "bx2132-TriggerReady";
	            #arCognexInterface["cScannerBX2132"].xInCamTriggerAck := "bx2132-TriggerAck";
	            #arCognexInterface["cScannerBX2132"].xInCamResultsAvailable := "bx2132-Results Available";
	            #arCognexInterface["cScannerBX2132"].xInCamGeneralFault := "bx2132-General Fault";
	            #arCognexInterface["cScannerBX2132"].hwInCamInspectionResults := "=A01+UC023-BX2132~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            
	            REGION Pin
	                #TRO251.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG4260"];
	                #TRO251.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO251.stInSeparatorPin.stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam1";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4050"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam2";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4051"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam3";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4052"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam4";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4053"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam5";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4054"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam6";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4055"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam7";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4056"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam8";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4057"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam9";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4060"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam10";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4061"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam11";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4062"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam12";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4063"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam13";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4064"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam14";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4065"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam15";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4066"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam16";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4067"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO251.arInSep[#nActNo].stSettings.nJamLength := "cStorage132ExitJam17";
	                #TRO251.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4070"];
	                #TRO251.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO251.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO251.xInQuitLocal := "SF0243" OR "SF0237";
	            
	            #TRO251.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG4290"];
	            
	            #TRO251.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG4291"];
	            
	            #TRO251.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG4292"];
	            
	            #TRO251.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG4293"];
	            
	            #TRO251.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG4294"];
	            
	            #TRO251.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG4295"];
	            
	            #TRO251.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG4296"];
	            
	            #TRO251.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG4297"];
	            
	            #TRO251.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG4300"];
	            
	            #TRO251.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG4301"];
	            
	            #TRO251.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG4302"];
	            
	            #TRO251.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG4303"];
	            
	            #TRO251.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG4304"];
	            
	            #TRO251.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG4305"];
	            
	            #TRO251.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG4306"];
	            
	            #TRO251.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG4307"];
	            
	            #TRO251.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG4310"];
	        END_REGION ;
	        
	        REGION Aufruf: TRO251
	            
	            #TRO251.stInPriorityManager.xReleaseOk := True;
	            
	            #TRO251(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                    nInTestTarget := "IBN".nTestTarget132,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO251,
	                    xInConveyorRunIn := #fbSortConv1303.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv1301.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF4,
	                    arInOutStorageLines := "DB_Storage1.3.2".arLine,
	                    arInOutJamEntr := "DB_JamArea1303".stJam1303_1.arCarrier,
	                    stInOutJamEntr := "DB_JamArea1303".stJam1303_1.stData,
	                    arInOutJamExit := "DB_JamArea1301".stJam1301_2.arCarrier,
	                    stInOutJamExit := "DB_JamArea1301".stJam1301_2.stData,
	                    arInOutJamBypass := "DB_JamArea1303".stJam1303_2.arCarrier,
	                    stInOutJamBypass := "DB_JamArea1303".stJam1303_2.stData,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO251,
	                    stMFRStorageRemovalInterface := "DB_HandshakeStorage".Str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl1[10],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX2132"],
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTRO251"],
	                    xOutSeparatorPin => "MB4260",
	                    stConveyorStations:="DB_ConveyorStations".stConveyorStations132);
	        END_REGION ;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO251.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO251.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1303".stJam1303_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Barcode Reader Out (BX2132)                
	            "bx2132-TriggerEnable" := #arCognexInterface["cScannerBX2132"].xOutCamTriggerEnable;
	            "bx2132-Trigger" := #arCognexInterface["cScannerBX2132"].xOutCamTrigger;
	            "bx2132-ResultsAck" := #arCognexInterface["cScannerBX2132"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB4050" := #TRO251.arOutSeparatorStore[1];
	            "MB4051" := #TRO251.arOutSeparatorStore[2];
	            "MB4052" := #TRO251.arOutSeparatorStore[3];
	            "MB4053" := #TRO251.arOutSeparatorStore[4];
	            "MB4054" := #TRO251.arOutSeparatorStore[5];
	            "MB4055" := #TRO251.arOutSeparatorStore[6];
	            "MB4056" := #TRO251.arOutSeparatorStore[7];
	            "MB4057" := #TRO251.arOutSeparatorStore[8];
	            "MB4060" := #TRO251.arOutSeparatorStore[9];
	            "MB4061" := #TRO251.arOutSeparatorStore[10];
	            "MB4062" := #TRO251.arOutSeparatorStore[11];
	            "MB4063" := #TRO251.arOutSeparatorStore[12];
	            "MB4064" := #TRO251.arOutSeparatorStore[13];
	            "MB4065" := #TRO251.arOutSeparatorStore[14];
	            "MB4066" := #TRO251.arOutSeparatorStore[15];
	            "MB4067" := #TRO251.arOutSeparatorStore[16];
	            "MB4070" := #TRO251.arOutSeparatorStore[17];
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB4290" := #TRO251.arOutSwitch[1];
	            "MB4291" := #TRO251.arOutSwitch[2];
	            "MB4292" := #TRO251.arOutSwitch[3];
	            "MB4293" := #TRO251.arOutSwitch[4];
	            "MB4294" := #TRO251.arOutSwitch[5];
	            "MB4295" := #TRO251.arOutSwitch[6];
	            "MB4296" := #TRO251.arOutSwitch[7];
	            "MB4297" := #TRO251.arOutSwitch[8];
	            "MB4300" := #TRO251.arOutSwitch[9];
	            "MB4301" := #TRO251.arOutSwitch[10];
	            "MB4302" := #TRO251.arOutSwitch[11];
	            "MB4303" := #TRO251.arOutSwitch[12];
	            "MB4304" := #TRO251.arOutSwitch[13];
	            "MB4305" := #TRO251.arOutSwitch[14];
	            "MB4306" := #TRO251.arOutSwitch[15];
	            "MB4307" := #TRO251.arOutSwitch[16];
	            "MB4310" := #TRO251.arOutSwitch[17];
	            
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 17 DO
	                IF #TRO251.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO251.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest13200" + #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 1.3.3 (TRO 254)
	        
	        REGION Encoder Settings
	            #TRO254.stInEncoderParameter.nPosActDif := #fbEncoderGF2205.nOutPosActDif;
	            #TRO254.stInEncoderParameter.nPosPitchPart := #fbEncoderGF2205.nPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO254.stInSettings.nDestGeneral := "cDest13300";
	            #TRO254.stInSettings.nConvStations := "cHooksSorterMaxPin133"; //Konstante todo
	            #TRO254.stInSettings.nStationsMax := "cStationsMax133"; // Konstante todo
	            #TRO254.stInSettings.nStorageThreshold := "cNoPositionsBlock3"; //Konstante todo
	            #TRO254.stInSettings.nNoOfLines := 21;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO254.stInSensorReference := "DB_Inputs".Sensors["cInBG4321"];
	        END_REGION
	        
	        REGION Barcode Reader In (BX2133)
	            #TRO254.stInBarcodeReader.Settings.nStation := 133; // todo Konstante
	            #TRO254.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO254.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO254.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX2133"].xInCamTriggerReady := "bx2133-TriggerReady";
	            #arCognexInterface["cScannerBX2133"].xInCamTriggerAck := "bx2133-TriggerAck";
	            #arCognexInterface["cScannerBX2133"].xInCamResultsAvailable := "bx2133-Results Available";
	            #arCognexInterface["cScannerBX2133"].xInCamGeneralFault := "bx2133-General Fault";
	            #arCognexInterface["cScannerBX2133"].hwInCamInspectionResults := "=A01+UC023-BX2133~Ergebnisse_–_64_Bytes_1";
	            
	        END_REGION
	        
	        REGION Separator Settings
	            
	            REGION Pin
	                #TRO254.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG4320"];
	                #TRO254.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO254.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO254.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam1";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4110"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam2";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4111"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam3";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4112"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam4";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4113"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam5";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4114"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam6";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4115"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam7";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4116"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam8";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4117"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam9";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4120"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam10";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4121"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam11";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4122"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam12";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4123"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam13";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4124"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 14
	                #nActNo := 14;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam14";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4125"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 15
	                #nActNo := 15;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam15";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4126"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 16
	                #nActNo := 16;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam16";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4127"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 17
	                #nActNo := 17;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam17";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4130"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 18
	                #nActNo := 18;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam18";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4131"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 19
	                #nActNo := 19;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam19";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4132"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 20
	                #nActNo := 20;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam10";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4133"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 21
	                #nActNo := 21;
	                #TRO254.arInSep[#nActNo].stSettings.nJamLength := "cStorage133ExitJam11";
	                #TRO254.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4134"];
	                #TRO254.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO254.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO254.xInQuitLocal := "SF0245" OR "SF0237";
	            
	            #TRO254.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG4350"];
	            
	            #TRO254.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG4351"];
	            
	            #TRO254.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG4352"];
	            
	            #TRO254.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG4353"];
	            
	            #TRO254.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG4354"];
	            
	            #TRO254.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG4355"];
	            
	            #TRO254.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG4356"];
	            
	            #TRO254.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG4357"];
	            
	            #TRO254.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG4360"];
	            
	            #TRO254.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG4361"];
	            
	            #TRO254.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG4362"];
	            
	            #TRO254.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG4363"];
	            
	            #TRO254.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG4364"];
	            
	            #TRO254.arInJamSensor[14] := "DB_Inputs".Sensors["cInBG4365"];
	            
	            #TRO254.arInJamSensor[15] := "DB_Inputs".Sensors["cInBG4366"];
	            
	            #TRO254.arInJamSensor[16] := "DB_Inputs".Sensors["cInBG4367"];
	            
	            #TRO254.arInJamSensor[17] := "DB_Inputs".Sensors["cInBG4370"];
	            
	            #TRO254.arInJamSensor[18] := "DB_Inputs".Sensors["cInBG4371"];
	            
	            #TRO254.arInJamSensor[19] := "DB_Inputs".Sensors["cInBG4372"];
	            
	            #TRO254.arInJamSensor[20] := "DB_Inputs".Sensors["cInBG4373"];
	            
	            #TRO254.arInJamSensor[21] := "DB_Inputs".Sensors["cInBG4374"];
	            
	        END_REGION ;
	        
	        REGION Aufruf: TRO254
	            
	            #TRO254.stInPriorityManager.xReleaseOk := "cTodoTRUE";
	            
	            #TRO254(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                    nInTestTarget := "IBN".nTestTarget133,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO254,
	                    xInConveyorRunIn := #fbSortConv1304.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv1302.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF4,
	                    arInOutStorageLines := "DB_Storage1.3.3".arLine,
	                    arInOutJamEntr := "DB_JamArea1304".stJam1304_2.arCarrier,
	                    stInOutJamEntr := "DB_JamArea1304".stJam1304_2.stData,
	                    arInOutJamExit := "DB_JamArea1302".stJam1302_2.arCarrier,
	                    stInOutJamExit := "DB_JamArea1302".stJam1302_2.stData,
	                    arInOutJamBypass := "DB_JamArea1304".stJam1304_3.arCarrier,
	                    stInOutJamBypass := "DB_JamArea1304".stJam1304_3.stData,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO254,
	                    stMFRStorageRemovalInterface := "DB_HandshakeStorage".Str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl1[11],
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTRO254"],
	                    xOutSeparatorPin => "MB4320",
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX2133"],
	                    stConveyorStations:="DB_ConveyorStations".stConveyorStations133);
	        END_REGION
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO254.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO254.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1304".stJam1304_2.arCarrier[1]);
	        END_REGION
	        
	        REGION Barcode Reader Out (BX2133)                
	            "bx2133-TriggerEnable" := #arCognexInterface["cScannerBX2133"].xOutCamTriggerEnable;
	            "bx2133-Trigger" := #arCognexInterface["cScannerBX2133"].xOutCamTrigger;
	            "bx2133-ResultsAck" := #arCognexInterface["cScannerBX2133"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB4110" := #TRO254.arOutSeparatorStore[1];
	            "MB4111" := #TRO254.arOutSeparatorStore[2];
	            "MB4112" := #TRO254.arOutSeparatorStore[3];
	            "MB4113" := #TRO254.arOutSeparatorStore[4];
	            "MB4114" := #TRO254.arOutSeparatorStore[5];
	            "MB4115" := #TRO254.arOutSeparatorStore[6];
	            "MB4116" := #TRO254.arOutSeparatorStore[7];
	            "MB4117" := #TRO254.arOutSeparatorStore[8];
	            "MB4120" := #TRO254.arOutSeparatorStore[9];
	            "MB4121" := #TRO254.arOutSeparatorStore[10];
	            "MB4122" := #TRO254.arOutSeparatorStore[11];
	            "MB4123" := #TRO254.arOutSeparatorStore[12];
	            "MB4124" := #TRO254.arOutSeparatorStore[13];
	            "MB4125" := #TRO254.arOutSeparatorStore[14];
	            "MB4126" := #TRO254.arOutSeparatorStore[15];
	            "MB4127" := #TRO254.arOutSeparatorStore[16];
	            "MB4130" := #TRO254.arOutSeparatorStore[17];
	            "MB4131" := #TRO254.arOutSeparatorStore[18];
	            "MB4132" := #TRO254.arOutSeparatorStore[19];
	            "MB4133" := #TRO254.arOutSeparatorStore[20];
	            "MB4134" := #TRO254.arOutSeparatorStore[21];
	        END_REGION
	        
	        REGION Unlaoding Stations Out
	            "MB4350" := #TRO254.arOutSwitch[1];
	            "MB4351" := #TRO254.arOutSwitch[2];
	            "MB4352" := #TRO254.arOutSwitch[3];
	            "MB4353" := #TRO254.arOutSwitch[4];
	            "MB4354" := #TRO254.arOutSwitch[5];
	            "MB4355" := #TRO254.arOutSwitch[6];
	            "MB4356" := #TRO254.arOutSwitch[7];
	            "MB4357" := #TRO254.arOutSwitch[8];
	            "MB4360" := #TRO254.arOutSwitch[9];
	            "MB4361" := #TRO254.arOutSwitch[10];
	            "MB4362" := #TRO254.arOutSwitch[11];
	            "MB4363" := #TRO254.arOutSwitch[12];
	            "MB4364" := #TRO254.arOutSwitch[13];
	            "MB4365" := #TRO254.arOutSwitch[14];
	            "MB4366" := #TRO254.arOutSwitch[15];
	            "MB4367" := #TRO254.arOutSwitch[16];
	            "MB4370" := #TRO254.arOutSwitch[17];
	            "MB4371" := #TRO254.arOutSwitch[18];
	            "MB4372" := #TRO254.arOutSwitch[19];
	            "MB4373" := #TRO254.arOutSwitch[20];
	            "MB4374" := #TRO254.arOutSwitch[21];
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 21 DO
	                IF #TRO254.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO254.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest13300" + #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 1.3.4 (TRO 257)
	        
	        REGION Encoder Settings
	            #TRO257.stInEncoderParameter.nPosActDif := #fbEncoderGF2205.nOutPosActDif;
	            #TRO257.stInEncoderParameter.nPosPitchPart := #fbEncoderGF2205.nPosPitchPart;
	        END_REGION
	        
	        REGION ConveyorStation Settings
	            #TRO257.stInSettings.nDestGeneral := "cDest13400";
	            #TRO257.stInSettings.nConvStations := "cHooksSorterMaxPin134"; //Konstante todo
	            #TRO257.stInSettings.nStationsMax := "cStationsMax134"; // Konstante todo
	            #TRO257.stInSettings.nStorageThreshold := "cNoPositionsBlock3"; //Konstante todo
	            #TRO257.stInSettings.nNoOfLines := 13;
	        END_REGION
	        
	        REGION Pin Query / "Zappler"
	            #TRO257.stInSensorReference := "DB_Inputs".Sensors["cInBG4381"];
	        END_REGION
	        
	        REGION Barcode Reader In (BX2134)
	            #TRO257.stInBarcodeReader.Settings.nStation := 134; // todo Konstante
	            #TRO257.stInBarcodeReader.Settings.nScannerPurpose := 0; // todo Konstante
	            #TRO257.stInBarcodeReader.Settings.tTimeout := T#5s; // todo Konstante
	            #TRO257.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	            
	            #arCognexInterface["cScannerBX2134"].xInCamTriggerReady := "bx2134-TriggerReady";
	            #arCognexInterface["cScannerBX2134"].xInCamTriggerAck := "bx2134-TriggerAck";
	            #arCognexInterface["cScannerBX2134"].xInCamResultsAvailable := "bx2134-Results Available";
	            #arCognexInterface["cScannerBX2134"].xInCamGeneralFault := "bx2134-General Fault";
	            #arCognexInterface["cScannerBX2134"].hwInCamInspectionResults := "=A01+UC023-BX2134~Ergebnisse_–_64_Bytes_1";
	        END_REGION
	        
	        REGION Separator Settings
	            
	            REGION Pin
	                #TRO257.stInSeparatorPin.stSenTrolley := "DB_Inputs".Sensors["cInBG4380"];
	                #TRO257.stInSeparatorPin.stSettings.tHandlingTime := T#0ms;
	                #TRO257.stInSeparatorPin.stSettings.tTrailingTime := T#50ms;
	                #TRO257.stInSeparatorPin.stSettings.xPluggedScanner := TRUE;
	            END_REGION
	            
	            REGION Sep Store 1
	                #nActNo := 1;
	                #TRO257.arInSep[#nActNo].stSettings.nJamLength := "cStorage134ExitJam1";
	                #TRO257.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4170"];
	                #TRO257.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 2
	                #nActNo := 2;
	                #TRO257.arInSep[#nActNo].stSettings.nJamLength := "cStorage134ExitJam2";
	                #TRO257.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4171"];
	                #TRO257.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 3
	                #nActNo := 3;
	                #TRO257.arInSep[#nActNo].stSettings.nJamLength := "cStorage134ExitJam3";
	                #TRO257.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4172"];
	                #TRO257.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 4
	                #nActNo := 4;
	                #TRO257.arInSep[#nActNo].stSettings.nJamLength := "cStorage134ExitJam4";
	                #TRO257.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4173"];
	                #TRO257.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 5
	                #nActNo := 5;
	                #TRO257.arInSep[#nActNo].stSettings.nJamLength := "cStorage134ExitJam5";
	                #TRO257.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4174"];
	                #TRO257.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 6
	                #nActNo := 6;
	                #TRO257.arInSep[#nActNo].stSettings.nJamLength := "cStorage134ExitJam6";
	                #TRO257.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4175"];
	                #TRO257.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 7
	                #nActNo := 7;
	                #TRO257.arInSep[#nActNo].stSettings.nJamLength := "cStorage134ExitJam7";
	                #TRO257.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4176"];
	                #TRO257.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 8
	                #nActNo := 8;
	                #TRO257.arInSep[#nActNo].stSettings.nJamLength := "cStorage134ExitJam8";
	                #TRO257.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4177"];
	                #TRO257.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 9
	                #nActNo := 9;
	                #TRO257.arInSep[#nActNo].stSettings.nJamLength := "cStorage134ExitJam9";
	                #TRO257.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4180"];
	                #TRO257.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 10
	                #nActNo := 10;
	                #TRO257.arInSep[#nActNo].stSettings.nJamLength := "cStorage134ExitJam10";
	                #TRO257.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4181"];
	                #TRO257.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 11
	                #nActNo := 11;
	                #TRO257.arInSep[#nActNo].stSettings.nJamLength := "cStorage134ExitJam11";
	                #TRO257.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4182"];
	                #TRO257.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 12
	                #nActNo := 12;
	                #TRO257.arInSep[#nActNo].stSettings.nJamLength := "cStorage134ExitJam12";
	                #TRO257.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4183"];
	                #TRO257.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            REGION Sep Store 13
	                #nActNo := 13;
	                #TRO257.arInSep[#nActNo].stSettings.nJamLength := "cStorage134ExitJam13";
	                #TRO257.arInSep[#nActNo].stSenTrolley := "DB_Inputs".Sensors["cInBG4184"];
	                #TRO257.arInSep[#nActNo].stSettings.tHandlingTime := "cTimeSepHandlingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.tTrailingTime := "cTimeSepTrailingStorageLine";
	                #TRO257.arInSep[#nActNo].stSettings.xPluggedScanner := FALSE;
	            END_REGION
	            
	            
	        END_REGION
	        
	        REGION UnloadingStations Settings
	            #TRO257.xInQuitLocal := "SF0247" OR "SF0237";
	            
	            #TRO257.arInJamSensor[1] := "DB_Inputs".Sensors["cInBG4410"];
	            
	            #TRO257.arInJamSensor[2] := "DB_Inputs".Sensors["cInBG4411"];
	            
	            #TRO257.arInJamSensor[3] := "DB_Inputs".Sensors["cInBG4412"];
	            
	            #TRO257.arInJamSensor[4] := "DB_Inputs".Sensors["cInBG4413"];
	            
	            #TRO257.arInJamSensor[5] := "DB_Inputs".Sensors["cInBG4414"];
	            
	            #TRO257.arInJamSensor[6] := "DB_Inputs".Sensors["cInBG4415"];
	            
	            #TRO257.arInJamSensor[7] := "DB_Inputs".Sensors["cInBG4416"];
	            
	            #TRO257.arInJamSensor[8] := "DB_Inputs".Sensors["cInBG4417"];
	            
	            #TRO257.arInJamSensor[9] := "DB_Inputs".Sensors["cInBG4420"];
	            
	            #TRO257.arInJamSensor[10] := "DB_Inputs".Sensors["cInBG4421"];
	            
	            #TRO257.arInJamSensor[11] := "DB_Inputs".Sensors["cInBG4422"];
	            
	            #TRO257.arInJamSensor[12] := "DB_Inputs".Sensors["cInBG4423"];
	            
	            #TRO257.arInJamSensor[13] := "DB_Inputs".Sensors["cInBG4424"];
	            
	            
	            
	        END_REGION
	        
	        
	        REGION Aufruf: TRO257
	            #TRO257.stInPriorityManager.xReleaseOk := "cTodoTRUE";
	            
	            #TRO257(xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                    nInTestTarget := "IBN".nTestTarget134,
	                    xInAllRdyToStart := TRUE,
	                    xInCancel := "cTodoFalse",
	                    xInRelease := "DB_TRO_Test".TRO257,
	                    xInConveyorRunIn := #fbSortConv1304.xOutConveyorFullSpeed,
	                    xInConveyorRunOut := #fbExitConv1302.xOutConveyorFullSpeed,
	                    stInOutControlUnitCabinet := #stInOutControlUnitCabinetOF4,
	                    arInOutStorageLines := "DB_Storage1.3.4".arLine,
	                    arInOutJamEntr := "DB_JamArea1304".stJam1304_3.arCarrier,
	                    stInOutJamEntr := "DB_JamArea1304".stJam1304_3.stData,
	                    arInOutJamExit := "DB_JamArea1302".stJam1302_1.arCarrier,
	                    stInOutJamExit := "DB_JamArea1302".stJam1302_1.stData,
	                    arInOutJamBypass := #arCarrierPlaceHolder,
	                    stInOutJamBypass := #stJamDataPlaceHolder,
	                    stInOutHMI := "DB_Interface_HMI".stTRO.TRO257,
	                    stMFRStorageRemovalInterface := "DB_HandshakeStorage".Str_StorageRemoval.arrudt_StorageRemovalHandshakeTROsLvl1[12],
	                    xOutSeparatorPin => "MB4380",
	                    // nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTRO257"],
	                    stCognexInterfacePin := #arCognexInterface["cScannerBX2134"],
	                    stConveyorStations:="DB_ConveyorStations".stConveyorStations134);
	        END_REGION
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO257.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO257.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1304".stJam1304_3.arCarrier[1]);
	        END_REGION
	        
	        REGION Barcode Reader Out (BX2134)                
	            "bx2134-TriggerEnable" := #arCognexInterface["cScannerBX2134"].xOutCamTriggerEnable;
	            "bx2134-Trigger" := #arCognexInterface["cScannerBX2134"].xOutCamTrigger;
	            "bx2134-ResultsAck" := #arCognexInterface["cScannerBX2134"].xOutCamResultsAck;
	        END_REGION
	        
	        REGION Separator Store Out
	            "MB4170" := #TRO257.arOutSeparatorStore[1];
	            "MB4171" := #TRO257.arOutSeparatorStore[2];
	            "MB4172" := #TRO257.arOutSeparatorStore[3];
	            "MB4173" := #TRO257.arOutSeparatorStore[4];
	            "MB4174" := #TRO257.arOutSeparatorStore[5];
	            "MB4175" := #TRO257.arOutSeparatorStore[6];
	            "MB4176" := #TRO257.arOutSeparatorStore[7];
	            "MB4177" := #TRO257.arOutSeparatorStore[8];
	            "MB4180" := #TRO257.arOutSeparatorStore[9];
	            "MB4181" := #TRO257.arOutSeparatorStore[10];
	            "MB4182" := #TRO257.arOutSeparatorStore[11];
	            "MB4183" := #TRO257.arOutSeparatorStore[12];
	            "MB4184" := #TRO257.arOutSeparatorStore[13];
	            
	        END_REGION
	        
	        REGION Unloading Stations Out
	            "MB4410" := #TRO257.arOutSwitch[1];
	            "MB4411" := #TRO257.arOutSwitch[2];
	            "MB4412" := #TRO257.arOutSwitch[3];
	            "MB4413" := #TRO257.arOutSwitch[4];
	            "MB4414" := #TRO257.arOutSwitch[5];
	            "MB4415" := #TRO257.arOutSwitch[6];
	            "MB4416" := #TRO257.arOutSwitch[7];
	            "MB4417" := #TRO257.arOutSwitch[8];
	            "MB4420" := #TRO257.arOutSwitch[9];
	            "MB4421" := #TRO257.arOutSwitch[10];
	            "MB4422" := #TRO257.arOutSwitch[11];
	            "MB4423" := #TRO257.arOutSwitch[12];
	            "MB4424" := #TRO257.arOutSwitch[13];
	            
	        END_REGION
	        
	        REGION Send Container Store Response Message (CSRespM)
	            FOR #nIdxUnloading := 1 TO 13 DO
	                IF #TRO257.arfbStationUnloadPin[#nIdxUnloading].xOutUnloadingDone THEN //1 Zyklus
	                    "FC_Send_CSRespM"(sInPLCID := 'PLCID003',
	                                      nInBarcode := #TRO257.arfbStationUnloadPin[#nIdxUnloading].nOutBarcode,
	                                      nInLocation := "cDest13400" + #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 200 (Vario)  // Eingang von Level 2
	        #TRO200.stInSeparator1.Settings.nSeparatorNo := "cSep200.1";
	        #TRO200.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO200.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO200.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO200.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO200.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO200.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO200.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO200.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3143"];
	        
	        #TRO200.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO200.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO200.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3144"]; //Finger in Pos
	        #TRO200.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3145"]; //MT in Pos
	        #TRO200.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3136"]; // Conveyor full
	        #TRO200.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3135"]; // Jam detector
	        
	        #TRO200.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO200.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO200.stInVario.Settings.tConvEmpty := T#20000ms;
	        #TRO200.stInVario.Settings.nCountCarrier := 1;
	        #TRO200.stInVario.Settings.tWaitForStop := t#3s;
	        
	        #TRO200.stInPriorityManager.xReleaseOk := TRUE; //braucht keine Vorfahrtsregelung
	        
	        #TRO200.stInSettings.xIsBorner := TRUE;
	        #TRO200(nInMainTroNo := "cMainTro200",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO200,
	                xInAutomatic := #t_Automatik_OF2,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0146",
	                arInOutJamEntr := "DB_JamArea1109".stJam1109_1.arCarrier,//Todo
	                stInOutJamEntr := "DB_JamArea1109".stJam1109_1.stData,
	                arInOutJamFinger := "DB_JamArea1109".stJam1109_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1109".stJam1109_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO200,
	                xOutStopper => "MB3143",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro200"],
	                xOutVarioMotor => "MA0146");
	        
	        REGION Übernahme von Level 2
	            "FB_I-Device_Receive_J1109"(xInReq := "IO_Device_UH03_FROM_UH01".bCARRIER_CONTROL_1.%X0,
	                                        stInData := "IO_Device_UH03_FROM_UH01".stCarrierL2toL1[1],
	                                        xInOutAck := "IO_Device_UH02_TO_UH01".bCARRIER_CONTROL_1.%X0);
	            
	            
	            IF "FB_I-Device_Receive_J1109".xOutNewData THEN //1 Zyklus vom Baustein
	                //Daten von UH03 in UH02 Jam schieben
	                "FC_TSHR_AddAtEnd"(stInTrolley := "FB_I-Device_Receive_J1109".stOutData,
	                                   nOutCounter => #tmpTSHRCounter,
	                                   xOutResult => #tmpTSHRResult,
	                                   arTSHR := "DB_JamArea1109".stJam1109_1.arCarrier);
	            END_IF;
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 201 (1Sep)
	        #TRO201.stInSeparator1.Settings.nSeparatorNo := "cSep201.1";
	        #TRO201.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO201.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO201.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO201.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO201.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO201.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO201.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO201.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3134"];
	        #TRO201.stInSenJam2 := "DB_Inputs".Sensors["cInBG3141"];
	        
	        #TRO201.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO201.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO201.stInPriorityManager.xReleaseOk := TRUE; //braucht keine Vorfahrtsregelung
	        
	        #TRO201(nInMainTroNo := "cMainTro201",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO201,
	                xInCarouselRun := #fbSortConv1102.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1109".stJam1109_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1109".stJam1109_2.stData,
	                arInOutJamExit2 := "DB_JamArea1102".stJam1102_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1102".stJam1102_1.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO201,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro201"],
	                xOutStopper1 => "MB3134");
	    END_REGION
	    
	    REGION TRO 202 (1Sep1Switch)+Scanner(BX2103)
	        
	        #TRO202.stInSeparator1.Settings.nSeparatorNo := "cSep202.1";
	        #TRO202.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO202.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO202.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO202.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO202.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO202.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO202.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3137"];
	        #TRO202.stInSenJam2 := "DB_Inputs".Sensors["cInBG3123"];
	        #TRO202.stInSenJam3 := "DB_Inputs".Sensors["cInBG3063"];
	        
	        #TRO202.stInSwitch1.Settings.nSwitchNo := "cSwi202.1";
	        #TRO202.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO202.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO202.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO202.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO202.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO202.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2103"].xInCamTriggerReady := "bx2103-TriggerReady";
	        #arCognexInterface["cScannerBX2103"].xInCamTriggerAck := "bx2103-TriggerAck";
	        #arCognexInterface["cScannerBX2103"].xInCamResultsAvailable := "bx2103-Results Available";
	        #arCognexInterface["cScannerBX2103"].xInCamGeneralFault := "bx2103-General Fault";
	        #arCognexInterface["cScannerBX2103"].hwInCamInspectionResults := "=A01+UH02-BX2103~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO202.stInSettings.xCar2NecRight := TRUE;
	        #TRO202.stInSettings.xCar2NecLeft := TRUE;
	        #TRO202.stInSettings.xPrioDir1 := TRUE;
	        #TRO202.stInSettings.xPrioDir2 := TRUE;
	        
	        
	        #TRO202(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO202_3.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO202_3.TroOut,
	                stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO202_4.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO202_4.TroOut,
	                nInMainTroNo := "cMainTro202",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO202,
	                xInCarouselRun1 := #fbSortConv1102.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbSortConv1101.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO202,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2103"],
	                arInOutJamEntr1 := "DB_JamArea1102".stJam1102_1.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1102".stJam1102_1.stData,
	                arInOutJamExit2 := "DB_JamArea1102".stJam1102_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1102".stJam1102_2.stData,
	                arInOutJamExit3 := "DB_JamArea1101".stJam1101_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1101".stJam1101_1.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro202"],
	                xOutStopper1 => "MB3137",
	                xOutSw1ExTo3 => "MB3061");
	        
	        "bx2103-TriggerEnable" := #arCognexInterface["cScannerBX2103"].xOutCamTriggerEnable;
	        "bx2103-Trigger" := #arCognexInterface["cScannerBX2103"].xOutCamTrigger;
	        "bx2103-ResultsAck" := #arCognexInterface["cScannerBX2103"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO202.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO202.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1102".stJam1102_1.arCarrier[1]);
	        END_REGION
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi202.1",
	                           nOutDirection => #TRO202.nInDirection,
	                           InOutCarrier := "DB_JamArea1102".stJam1102_1.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 203 (1Sep1Switch) + Scanner (BX2111)        
	        #TRO203.stInSeparator1.Settings.nSeparatorNo := "cSep203.1";
	        #TRO203.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Long";
	        #TRO203.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO203.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO203.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO203.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO203.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO203.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3240"];
	        #TRO203.stInSenJam2 := "DB_Inputs".Sensors["cInBG3241"];
	        
	        #TRO203.stInSwitch1.Settings.nSwitchNo := "cSwi203.1";
	        #TRO203.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO203.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO203.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO203.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO203.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO203.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2111"].xInCamTriggerReady := "bx2111-TriggerReady";
	        #arCognexInterface["cScannerBX2111"].xInCamTriggerAck := "bx2111-TriggerAck";
	        #arCognexInterface["cScannerBX2111"].xInCamResultsAvailable := "bx2111-Results Available";
	        #arCognexInterface["cScannerBX2111"].xInCamGeneralFault := "bx2111-General Fault";
	        #arCognexInterface["cScannerBX2111"].hwInCamInspectionResults := "=A01+UH02-BX2111~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO203.stInSettings.xCar2NecRight := FALSE;
	        #TRO203.stInSettings.xCar2NecLeft := FALSE;
	        #TRO203.stInSettings.xPrioDir1 := FALSE;
	        #TRO203.stInSettings.xPrioDir2 := TRUE;
	        
	        // "DB_JamArea1103".stJam1103_1.arCarrier[1].nDestination := "cDestF2HLoaded";
	        
	        #TRO203(stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO203.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO203.TroOut,
	                nInMainTroNo := "cMainTro203",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO203,
	                xInCarouselRun1 := #fbExitConv1103.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv1103.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO203,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2111"],
	                arInOutJamEntr1 := "DB_JamArea1103".stJam1103_1.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1103".stJam1103_1.stData,
	                arInOutJamExit2 := "DB_JamArea1105".stJam1105_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1105".stJam1105_1.stData,
	                arInOutJamExit3 := "DB_JamArea1103".stJam1103_2.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1103".stJam1103_2.stData,
	                xOutStopper1 => "MB3240",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro203"],
	                xOutSw1ExTo3 => "MB3241");
	        
	        "bx2111-TriggerEnable" := #arCognexInterface["cScannerBX2111"].xOutCamTriggerEnable;
	        "bx2111-Trigger" := #arCognexInterface["cScannerBX2111"].xOutCamTrigger;
	        "bx2111-ResultsAck" := #arCognexInterface["cScannerBX2111"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO203.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO203.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1103".stJam1103_1.arCarrier[1]);
	        END_REGION
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi203.1",
	                           nOutDirection => #TRO203.nInDirection,
	                           InOutCarrier := "DB_JamArea1103".stJam1103_1.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    
	    REGION TRO 204(1Sep1Switch) + Scanner(BX2112)
	        #TRO204.stInSeparator1.Settings.nSeparatorNo := "cSep204.1";
	        #TRO204.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Long";
	        #TRO204.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO204.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO204.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO204.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO204.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO204.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3300"];
	        #TRO204.stInSenJam2 := "DB_Inputs".Sensors["cInBG3301"];
	        
	        #TRO204.stInSwitch1.Settings.nSwitchNo := "cSwi204.1";
	        #TRO204.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO204.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO204.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO204.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO204.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO204.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2112"].xInCamTriggerReady := "bx2112-TriggerReady";
	        #arCognexInterface["cScannerBX2112"].xInCamTriggerAck := "bx2112-TriggerAck";
	        #arCognexInterface["cScannerBX2112"].xInCamResultsAvailable := "bx2112-Results Available";
	        #arCognexInterface["cScannerBX2112"].xInCamGeneralFault := "bx2112-General Fault";
	        #arCognexInterface["cScannerBX2112"].hwInCamInspectionResults := "=A01+UH02-BX2112~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO204.stInSettings.xCar2NecLeft := FALSE;
	        #TRO204.stInSettings.xCar2NecRight := TRUE;
	        #TRO204.stInSettings.xPrioDir1 := FALSE;
	        #TRO204.stInSettings.xPrioDir2 := TRUE;
	        
	     //   "DB_JamArea1103".stJam1103_2.arCarrier[1].nDestination := "cDestF2HLoaded";
	        
	        #TRO204(stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO204.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO204.TroOut,
	                nInMainTroNo := "cMainTro204",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO204,
	                xInCarouselRun1 := #fbExitConv1103.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv1104.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO204,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2112"],
	                arInOutJamEntr1 := "DB_JamArea1103".stJam1103_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1103".stJam1103_2.stData,
	                arInOutJamExit2 := "DB_JamArea1106".stJam1106_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1106".stJam1106_1.stData,
	                arInOutJamExit3 := "DB_JamArea1104".stJam1104_3.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1104".stJam1104_3.stData,
	                xOutStopper1 => "MB3300",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro204"],
	                xOutSw1ExTo3 => "MB3301");
	        
	        "MB3306" := TRUE;
	        
	        "bx2112-TriggerEnable" := #arCognexInterface["cScannerBX2112"].xOutCamTriggerEnable;
	        "bx2112-Trigger" := #arCognexInterface["cScannerBX2112"].xOutCamTrigger;
	        "bx2112-ResultsAck" := #arCognexInterface["cScannerBX2112"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO204.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO204.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1103".stJam1103_2.arCarrier[1]);
	        END_REGION
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi204.1",
	                           nOutDirection => #TRO204.nInDirection,
	                           InOutCarrier := "DB_JamArea1103".stJam1103_2.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    
	    REGION TRO 205 (1Sep1Switch) + Scanner(BX2114)
	        #TRO205.stInSeparator1.Settings.nSeparatorNo := "cSep205.1";
	        #TRO205.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Long";
	        #TRO205.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO205.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO205.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO205.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO205.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO205.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3420"];
	        #TRO205.stInSenJam3 := "DB_Inputs".Sensors["cInBG3421"];
	        
	        #TRO205.stInSwitch1.Settings.nSwitchNo := "cSwi205.1";
	        #TRO205.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO205.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO205.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO205.stInSwitch1.Settings.nTo1Destinations := 4; //Info nötig für HMI
	        
	        #TRO205.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO205.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2114"].xInCamTriggerReady := "bx2114-TriggerReady";
	        #arCognexInterface["cScannerBX2114"].xInCamTriggerAck := "bx2114-TriggerAck";
	        #arCognexInterface["cScannerBX2114"].xInCamResultsAvailable := "bx2114-Results Available";
	        #arCognexInterface["cScannerBX2114"].xInCamGeneralFault := "bx2114-General Fault";
	        #arCognexInterface["cScannerBX2114"].hwInCamInspectionResults := "=A01+UH02-BX2114~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO205.stInSettings.xCar2NecLeft := FALSE;
	        #TRO205.stInSettings.xCar2NecRight := FALSE;
	        #TRO205.stInSettings.xPrioDir1 := TRUE;
	        #TRO205.stInSettings.xPrioDir2 := FALSE;
	        
	      //  "DB_JamArea1104".stJam1104_1.arCarrier[1].nDestination := 11402;
	        
	        #TRO205(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO205.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO205.TroOut,
	                nInMainTroNo := "cMainTro205",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO205,
	                xInCarouselRun1 := #fbExitConv1104.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv1104.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO205,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2114"],
	                arInOutJamEntr1 := "DB_JamArea1104".stJam1104_1.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1104".stJam1104_1.stData,
	                arInOutJamExit2 := "DB_JamArea1104".stJam1104_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1104".stJam1104_2.stData,
	                arInOutJamExit3 := "DB_JamArea1108".stJam1108_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1108".stJam1108_1.stData,
	                xOutStopper1 => "MB3420",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro205"],
	                xOutSw1ExTo4 => "MB3421");
	        
	        "bx2114-TriggerEnable" := #arCognexInterface["cScannerBX2114"].xOutCamTriggerEnable;
	        "bx2114-Trigger" := #arCognexInterface["cScannerBX2114"].xOutCamTrigger;
	        "bx2114-ResultsAck" := #arCognexInterface["cScannerBX2114"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO205.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO205.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1104".stJam1104_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi205.1",
	                           nOutDirection => #TRO205.nInDirection,
	                           InOutCarrier := "DB_JamArea1104".stJam1104_1.arCarrier[1]);
	            
	        END_REGION
	    END_REGION
	    
	    REGION TRO 206 (1Sep1Switch)+Scanner(BX2113)
	        #TRO206.stInSeparator1.Settings.nSeparatorNo := "cSep206.1";
	        #TRO206.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Long";
	        #TRO206.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO206.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO206.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO206.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO206.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO206.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3360"];
	        #TRO206.stInSenJam3 := "DB_Inputs".Sensors["cInBG3361"];
	        
	        #TRO206.stInSwitch1.Settings.nSwitchNo := "cSwi206.1";
	        #TRO206.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO206.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO206.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO206.stInSwitch1.Settings.nTo1Destinations := 4; //Info nötig für HMI
	        
	        #TRO206.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO206.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2113"].xInCamTriggerReady := "bx2113-TriggerReady";
	        #arCognexInterface["cScannerBX2113"].xInCamTriggerAck := "bx2113-TriggerAck";
	        #arCognexInterface["cScannerBX2113"].xInCamResultsAvailable := "bx2113-Results Available";
	        #arCognexInterface["cScannerBX2113"].xInCamGeneralFault := "bx2113-General Fault";
	        #arCognexInterface["cScannerBX2113"].hwInCamInspectionResults := "=A01+UH02-BX2113~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO206.stInSettings.xCar2NecLeft := TRUE;
	        #TRO206.stInSettings.xCar2NecRight := FALSE;
	        #TRO206.stInSettings.xPrioDir1 := TRUE;
	        #TRO206.stInSettings.xPrioDir2 := FALSE;
	        
	     //   "DB_JamArea1104".stJam1104_2.arCarrier[1].nDestination := 11302;
	        
	        #TRO206(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO206.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO206.TroOut,
	                nInMainTroNo := "cMainTro206",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO206,
	                xInCarouselRun1 := #fbExitConv1104.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv1103.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO206,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2113"],//Todo
	                arInOutJamEntr1 := "DB_JamArea1104".stJam1104_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1104".stJam1104_2.stData,
	                arInOutJamExit2 := "DB_JamArea1104".stJam1104_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1104".stJam1104_3.stData,
	                arInOutJamExit3 := "DB_JamArea1107".stJam1107_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1107".stJam1107_1.stData,
	                xOutStopper1 => "MB3360",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro206"],
	                xOutSw1ExTo4 => "MB3361");
	        
	        "bx2113-TriggerEnable" := #arCognexInterface["cScannerBX2113"].xOutCamTriggerEnable;
	        "bx2113-Trigger" := #arCognexInterface["cScannerBX2113"].xOutCamTrigger;
	        "bx2113-ResultsAck" := #arCognexInterface["cScannerBX2113"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO206.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO206.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1104".stJam1104_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi206.1",
	                           nOutDirection => #TRO206.nInDirection,
	                           InOutCarrier := "DB_JamArea1104".stJam1104_2.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 207(1Sep)       
	        #TRO207.stInSeparator1.Settings.nSeparatorNo := "cSep207.1";
	        #TRO207.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO207.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO207.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO207.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO207.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO207.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO207.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO207.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3425"];
	        #TRO207.stInSenJam2 := "DB_Inputs".Sensors["cInBG3431"];
	        
	        #TRO207.stInPriorityManager.xReleaseOk := TRUE; //braucht keine Vorfahrtsregelung
	        
	        #stJamDataHandoverJam2109.Config.nCapacitySet := 1; //
	        
	        #TRO207(nInMainTroNo := "cMainTro207",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO207 AND ("IO_Device_UH02_TO_UH01".stCARRIER_INFO[1].nBarcode = 0), //zwecks Übergabe warten bis UH03 Daten abgeholt hat
	                xInCarouselRun := #fbExitConv1104.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1104".stJam1104_3.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1104".stJam1104_3.stData,
	                arInOutJamExit2 := "IO_Device_UH02_TO_UH01".stCARRIER_INFO, //Daten#arCarrierHandoverJam2109,
	                stInOutJamExit2 := #stJamDataHandoverJam2109,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO207,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro207"],
	                xOutStopper1 => "MB3425");
	        
	        "MB3426" := True;
	        
	        REGION Übergabe an Level 2
	            //todo: sicherstellen das UH03 ready ist, ansonsten sollte UH02 warten... 
	            "FB_I-Device_SendCarrier_J2109"(xInTrigger := (#TRO207.nState = 2500) AND #TRO207.fbSeparator1.xOutTrolleyReleasedEdge, //Trigger
	                                            xInAck := "IO_Device_UH02_FROM_UH01".bCARRIER_CONTROL_1.%X3, //von Empfänger
	                                            stInOutData := "IO_Device_UH02_TO_UH01".stCARRIER_INFO[1], //Daten
	                                            xOutReq := "IO_Device_UH02_TO_UH01".bCARRIER_CONTROL_1.%X3); //an Empfänger
	        END_REGION
	        
	    END_REGION ;
	    
	    REGION TRO 209 (Vario)
	        
	        #TRO209.stInSeparator1.Settings.nSeparatorNo := "cSep209.1";
	        #TRO209.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO209.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO209.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO209.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO209.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO209.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO209.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO209.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3244"];
	        
	        #TRO209.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO209.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO209.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO209.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO209.stInVario.Settings.tConvEmpty := T#30000ms;
	        #TRO209.stInVario.Settings.nCountCarrier := 1;
	        #TRO209.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO209.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3243"]; //Pusher Dog in Pos
	        #TRO209.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3006"]; // Conveyor full
	        #TRO209.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3005"]; // Jam detector
	        #TRO209.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3247"]; // MT in Pos
	        
	        #TRO209.stInPriorityManager.xReleaseOk := TRUE; //braucht keine Vorfahrtsregelung
	        
	        #TRO209(nInMainTroNo := "cMainTro209",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF2 AND "SF0120" AND "SF0040",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0041" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0142",
	                xInRelease := "DB_TRO_Test".TRO209,
	                arInOutJamEntr := "DB_JamArea1105".stJam1105_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1105".stJam1105_1.stData,
	                arInOutJamFinger := "DB_JamArea1105".stJam1105_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1105".stJam1105_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO209,
	                xOutStopper => "MB3244",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro209"],
	                xOutVarioMotor => "MA0142");
	        
	    END_REGION
	    
	    
	    REGION TRO 210 (1Sep)
	        
	        #TRO210.stInSeparator1.Settings.nSeparatorNo := "cSep210.1";
	        #TRO210.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO210.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO210.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO210.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO210.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO210.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO210.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO210.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO210.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3004"];
	        #TRO210.stInSenJam2 := "DB_Inputs".Sensors["cInBG3003"];
	        
	        #TRO210.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO210.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO210(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO210.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO210.TroOut,
	                nInMainTroNo := "cMainTro210",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO210,
	                xInCarouselRun := #fbSortConv1101.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1105".stJam1105_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1105".stJam1105_2.stData,
	                arInOutJamExit2 := "DB_JamArea1101".stJam1101_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1101".stJam1101_2.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO210,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro210"],
	                xOutStopper1 => "MB3004");
	    END_REGION
	    
	    
	    REGION TRO 212 (Vario)
	        
	        #TRO212.stInSeparator1.Settings.nSeparatorNo := "cSep212.1";
	        #TRO212.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO212.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO212.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO212.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO212.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO212.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO212.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO212.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3304"];
	        
	        #TRO212.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO212.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO212.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3303"]; //Pusher Dog in Pos
	        #TRO212.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3066"]; // Conveyor full
	        #TRO212.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3065"]; // Jam detector
	        #TRO212.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3307"]; // MT in Pos
	        
	        #TRO212.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO212.stInVario.Settings.tWaitForJog := T#50ms;//T#400ms;
	        #TRO212.stInVario.Settings.tConvEmpty := T#30000ms;
	        #TRO212.stInVario.Settings.nCountCarrier := 1;
	        #TRO212.stInVario.Settings.tWaitForStop := T#3s; //NUR FÜR TESTMODUS, Im Normalbetrieb auskommentieren!
	        
	        #TRO212.stInPriorityManager.xReleaseOk := TRUE; //braucht keine Vorfahrtsregelung
	        
	        #TRO212(nInMainTroNo := "cMainTro212",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF2 AND "SF0122" AND "SF0042",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0043" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0143",
	                xInRelease := "DB_TRO_Test".TRO212,
	                arInOutJamEntr := "DB_JamArea1106".stJam1106_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1106".stJam1106_1.stData,
	                arInOutJamFinger := "DB_JamArea1106".stJam1106_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1106".stJam1106_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO212,
	                xOutStopper => "MB3304",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro212"],
	                xOutVarioMotor => "MA0143");
	        
	    END_REGION
	    
	    REGION TRO 213 (1Sep)
	        #TRO213.stInSeparator1.Settings.nSeparatorNo := "cSep213.1";
	        #TRO213.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO213.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO213.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO213.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO213.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO213.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO213.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO213.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO213.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3064"];
	        #TRO213.stInSenJam2 := "DB_Inputs".Sensors["cInBG3063"];
	        
	        #TRO213.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO213.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO213(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO213.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO213.TroOut,
	                nInMainTroNo := "cMainTro213",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO213,
	                xInCarouselRun := #fbSortConv1101.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1106".stJam1106_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1106".stJam1106_2.stData,
	                arInOutJamExit2 := "DB_JamArea1101".stJam1101_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1101".stJam1101_1.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO213,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro213"],
	                xOutStopper1 => "MB3064");
	    END_REGION
	    
	    REGION TRO 215 (Vario)
	        
	        #TRO215.stInSeparator1.Settings.nSeparatorNo := "cSep215.1";
	        #TRO215.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO215.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO215.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO215.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO215.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO215.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO215.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO215.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3364"];
	        
	        #TRO215.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO215.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO215.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3363"]; //Pusher Dog in Pos
	        #TRO215.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3126"]; // Conveyor full
	        #TRO215.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3125"]; // Jam detector
	        #TRO215.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3367"]; // MT in Pos
	        
	        #TRO215.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO215.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO215.stInVario.Settings.tConvEmpty := T#30000ms;
	        #TRO215.stInVario.Settings.nCountCarrier := 1;
	        #TRO215.stInVario.Settings.tWaitForStop := T#3s; //NUR FÜR TESTMODUS, Im Normalbetrieb auskommentieren!
	        
	        #TRO215.stInPriorityManager.xReleaseOk := TRUE; //braucht keine Vorfahrtsregelung
	        
	        #TRO215(nInMainTroNo := "cMainTro215",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF2 AND "SF0124" AND "SF0044",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0045" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0144",
	                xInRelease := "DB_TRO_Test".TRO215,
	                arInOutJamEntr := "DB_JamArea1107".stJam1107_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1107".stJam1107_1.stData,
	                arInOutJamFinger := "DB_JamArea1107".stJam1107_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1107".stJam1107_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO215,
	                xOutStopper => "MB3364",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro215"],
	                xOutVarioMotor => "MA0144");
	        
	    END_REGION
	    
	    REGION TRO 216 (1Sep)
	        #TRO216.stInSeparator1.Settings.nSeparatorNo := "cSep216.1";
	        #TRO216.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO216.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO216.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO216.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO216.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO216.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO216.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO216.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO216.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3124"];
	        #TRO216.stInSenJam2 := "DB_Inputs".Sensors["cInBG3123"];
	        
	        #TRO216.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO216.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO216(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO216.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO216.TroOut,
	                nInMainTroNo := "cMainTro216",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO216,
	                xInCarouselRun := #fbSortConv1102.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1107".stJam1107_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1107".stJam1107_2.stData,
	                arInOutJamExit2 := "DB_JamArea1102".stJam1102_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1102".stJam1102_2.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO216,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro216"],
	                xOutStopper1 => "MB3124");
	        
	    END_REGION
	    
	    REGION TRO 218 (Vario)
	        
	        #TRO218.stInSeparator1.Settings.nSeparatorNo := "cSep218.1";
	        #TRO218.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO218.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO218.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO218.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO218.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO218.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO218.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO218.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3424"];
	        
	        #TRO218.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO218.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO218.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3423"]; //Pusher Dog in Pos
	        #TRO218.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3186"]; // Conveyor full
	        #TRO218.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3185"]; // Jam detector
	        #TRO218.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3427"]; // MT in Pos
	        
	        #TRO218.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO218.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO218.stInVario.Settings.tConvEmpty := T#30000ms;
	        #TRO218.stInVario.Settings.nCountCarrier := 1;
	        #TRO218.stInVario.Settings.tWaitForStop := T#3s; //NUR FÜR TESTMODUS, 
	        
	        #TRO218.stInPriorityManager.xReleaseOk := TRUE; //braucht keine Vorfahrtsregelung
	        
	        #TRO218(nInMainTroNo := "cMainTro218",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF2 AND "SF0126" AND "SF0046",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0047" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0145",
	                xInRelease := "DB_TRO_Test".TRO218,
	                arInOutJamEntr := "DB_JamArea1108".stJam1108_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1108".stJam1108_1.stData,
	                arInOutJamFinger := "DB_JamArea1108".stJam1108_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1108".stJam1108_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO218,
	                xOutStopper => "MB3424",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro218"],
	                xOutVarioMotor => "MA0145");
	        
	    END_REGION
	    
	    REGION TRO 219(1Sep)
	        #TRO219.stInSeparator1.Settings.nSeparatorNo := "cSep219.1";
	        #TRO219.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO219.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO219.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO219.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO219.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO219.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO219.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO219.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO219.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3184"];
	        #TRO219.stInSenJam2 := "DB_Inputs".Sensors["cInBG3183"];
	        
	        #TRO219.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO219.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO219.stInSettings.bSepType.%X6 := TRUE;
	        
	        #TRO219(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO219.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO219.TroOut,
	                nInMainTroNo := "cMainTro219",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF2.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO219,
	                xInCarouselRun := #fbSortConv1102.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF2,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1108".stJam1108_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1108".stJam1108_2.stData,
	                arInOutJamExit2 := "DB_JamArea1102".stJam1102_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1102".stJam1102_3.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO219,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro219"],
	                xOutStopper1 => "MB3184");
	    END_REGION
	    
	    //Section 1.1 ENDE
	    
	    REGION TRO 220 (Vario)  // Eingang von Level 2
	        #TRO220.stInSeparator1.Settings.nSeparatorNo := "cSep220.1";
	        #TRO220.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO220.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO220.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO220.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO220.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO220.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO220.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO220.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3622"];
	        
	        #TRO220.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO220.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO220.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3623"]; //Finger in Pos
	        #TRO220.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3624"]; //MT in Pos
	        #TRO220.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3616"]; // Conveyor full
	        #TRO220.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3615"]; // Jam detector
	        
	        #TRO220.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO220.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO220.stInVario.Settings.tConvEmpty := T#20000ms;
	        #TRO220.stInVario.Settings.nCountCarrier := 1;
	        #TRO220.stInVario.Settings.tWaitForStop := t#3s;
	        
	        #TRO220.stInPriorityManager.xReleaseOk := TRUE; //braucht keine Vorfahrtsregelung
	        
	    //    #TRO220.stInSettings.xIsBorner := TRUE;
	        #TRO220(nInMainTroNo := "cMainTro220",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO220,
	                xInAutomatic := #t_Automatik_OF1,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0070",
	                arInOutJamEntr := "DB_JamArea1209".stJam1209_1.arCarrier,//Todo
	                stInOutJamEntr := "DB_JamArea1209".stJam1209_1.stData,
	                arInOutJamFinger := "DB_JamArea1209".stJam1209_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1209".stJam1209_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO220,
	                xOutStopper => "MB3622",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro220"],
	                xOutVarioMotor => "MA0070");
	        
	        REGION Übernahme von Level 2
	            "FB_I-Device_Receive_J1209"(xInReq := "IO_Device_UH03_FROM_UH01".bCARRIER_CONTROL_1.%X1,
	                                        stInData := "IO_Device_UH03_FROM_UH01".stCarrierL2toL1_2[1],
	                                        xInOutAck := "IO_Device_UH02_TO_UH01".bCARRIER_CONTROL_1.%X1);
	            
	            
	            IF "FB_I-Device_Receive_J1209".xOutNewData THEN //1 Zyklus vom Baustein
	                //Daten von UH03 in UH02 Jam schieben
	                "FC_TSHR_AddAtEnd"(stInTrolley := "FB_I-Device_Receive_J1209".stOutData,
	                                   nOutCounter => #tmpTSHRCounter,
	                                   xOutResult => #tmpTSHRResult,
	                                   arTSHR := "DB_JamArea1209".stJam1209_1.arCarrier);
	            END_IF;
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 221 (1Sep)
	        #TRO221.stInSeparator1.Settings.nSeparatorNo := "cSep221.1";
	        #TRO221.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO221.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO221.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO221.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO221.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO221.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO221.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO221.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3614"];
	        #TRO221.stInSenJam2 := "DB_Inputs".Sensors["cInBG3621"];
	
	        #TRO221.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO221.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO221.stInPriorityManager.xReleaseOk := TRUE; //braucht keine Vorfahrtsregelung
	        
	        #TRO221(nInMainTroNo := "cMainTro221",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO221,
	                xInCarouselRun := #fbSortConv1202.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1209".stJam1209_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1209".stJam1209_2.stData,
	                arInOutJamExit2 := "DB_JamArea1202".stJam1202_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1202".stJam1202_1.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO221,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro221"],
	                xOutStopper1 => "MB3614");
	    END_REGION
	    
	    REGION TRO 222 (1Sep1Switch)+Scanner(BX2121)
	        #TRO222.stInSeparator1.Settings.nSeparatorNo := "cSep222.1";
	        #TRO222.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO222.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO222.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO222.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO222.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO222.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO222.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3617"];
	        #TRO222.stInSenJam2 := "DB_Inputs".Sensors["cInBG3603"];
	        #TRO222.stInSenJam3 := "DB_Inputs".Sensors["cInBG3543"];
	        
	        #TRO222.stInSwitch1.Settings.nSwitchNo := "cSwi222.1";
	        #TRO222.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO222.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO222.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO222.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO222.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO222.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2121"].xInCamTriggerReady := "bx2121-TriggerReady";
	        #arCognexInterface["cScannerBX2121"].xInCamTriggerAck := "bx2121-TriggerAck";
	        #arCognexInterface["cScannerBX2121"].xInCamResultsAvailable := "bx2121-Results Available";
	        #arCognexInterface["cScannerBX2121"].xInCamGeneralFault := "bx2121-General Fault";
	        #arCognexInterface["cScannerBX2121"].hwInCamInspectionResults := "=A01+UH02-BX2121~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO222.stInSettings.xCar2NecRight := TRUE;
	        #TRO222.stInSettings.xCar2NecLeft := TRUE;
	        #TRO222.stInSettings.xPrioDir1 := TRUE;
	        #TRO222.stInSettings.xPrioDir2 := TRUE;
	        
	        #TRO222(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO222_3.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO222_3.TroOut,
	                stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO222_4.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO222_4.TroOut,
	                nInMainTroNo := "cMainTro222",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO222,
	                xInCarouselRun1 := #fbSortConv1202.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbSortConv1201.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO222,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2121"],
	                arInOutJamEntr1 := "DB_JamArea1202".stJam1202_1.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1202".stJam1202_1.stData,
	                arInOutJamExit2 := "DB_JamArea1202".stJam1202_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1202".stJam1202_2.stData,
	                arInOutJamExit3 := "DB_JamArea1201".stJam1201_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1201".stJam1201_1.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro222"],
	                xOutStopper1 => "MB3617",
	                xOutSw1ExTo3 => "MB3541");
	        
	        "bx2121-TriggerEnable" := #arCognexInterface["cScannerBX2121"].xOutCamTriggerEnable;
	        "bx2121-Trigger" := #arCognexInterface["cScannerBX2121"].xOutCamTrigger;
	        "bx2121-ResultsAck" := #arCognexInterface["cScannerBX2121"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO222.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO222.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1202".stJam1202_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi222.1",
	                           nOutDirection => #TRO222.nInDirection,
	                           InOutCarrier := "DB_JamArea1202".stJam1202_1.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 223 (1Sep1Switch)+Scanner(BX2126)
	        #TRO223.stInSeparator1.Settings.nSeparatorNo := "cSep223.1";
	        #TRO223.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Long";
	        #TRO223.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO223.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO223.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO223.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO223.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO223.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3720"];
	        #TRO223.stInSenJam2 := "DB_Inputs".Sensors["cInBG3721"];
	        
	        #TRO223.stInSwitch1.Settings.nSwitchNo := "cSwi223.1";
	        #TRO223.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO223.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO223.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO223.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO223.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO223.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2126"].xInCamTriggerReady := "bx2126-TriggerReady";
	        #arCognexInterface["cScannerBX2126"].xInCamTriggerAck := "bx2126-TriggerAck";
	        #arCognexInterface["cScannerBX2126"].xInCamResultsAvailable := "bx2126-Results Available";
	        #arCognexInterface["cScannerBX2126"].xInCamGeneralFault := "bx2126-General Fault";
	        #arCognexInterface["cScannerBX2126"].hwInCamInspectionResults := "=A01+UC022-BX2126~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO223.stInSettings.xCar2NecLeft := FALSE;
	        #TRO223.stInSettings.xCar2NecRight := FALSE;
	        #TRO223.stInSettings.xPrioDir1 := FALSE;
	        #TRO223.stInSettings.xPrioDir2 := TRUE;
	        
	     //   "DB_JamArea1203".stJam1203_1.arCarrier[1].nDestination := "cDestF2HLoaded";
	        
	        #TRO223(stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO223.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO223.TroOut,
	                nInMainTroNo := "cMainTro223",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO223,
	                xInCarouselRun1 := #fbExitConv1203.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv1203.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO223,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2126"],
	                arInOutJamEntr1 := "DB_JamArea1203".stJam1203_1.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1203".stJam1203_1.stData,
	                arInOutJamExit2 := "DB_JamArea1205".stJam1205_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1205".stJam1205_1.stData,
	                arInOutJamExit3 := "DB_JamArea1203".stJam1203_2.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1203".stJam1203_2.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro223"],
	                xOutStopper1 => "MB3720",
	                xOutSw1ExTo3 => "MB3721");
	        
	        "bx2126-TriggerEnable" := #arCognexInterface["cScannerBX2126"].xOutCamTriggerEnable;
	        "bx2126-Trigger" := #arCognexInterface["cScannerBX2126"].xOutCamTrigger;
	        "bx2126-ResultsAck" := #arCognexInterface["cScannerBX2126"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO223.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO223.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1203".stJam1203_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi223.1",
	                           nOutDirection => #TRO223.nInDirection,
	                           InOutCarrier := "DB_JamArea1203".stJam1203_1.arCarrier[1]);
	            
	        END_REGION
	        
	        
	    END_REGION
	    
	    REGION TRO 224 (1Sep1Switch)+Scanner(BX2127)
	        #TRO224.stInSeparator1.Settings.nSeparatorNo := "cSep224.1";
	        #TRO224.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Long";
	        #TRO224.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO224.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO224.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO224.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO224.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO224.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3780"];
	        #TRO224.stInSenJam2 := "DB_Inputs".Sensors["cInBG3781"];
	        #TRO224.stInSenJam3 := "DB_Inputs".Sensors["cInBG3847"];
	        
	        #TRO224.stInSwitch1.Settings.nSwitchNo := "cSwi224.1";
	        #TRO224.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO224.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO224.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO224.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO224.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO224.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2127"].xInCamTriggerReady := "bx2127-TriggerReady";
	        #arCognexInterface["cScannerBX2127"].xInCamTriggerAck := "bx2127-TriggerAck";
	        #arCognexInterface["cScannerBX2127"].xInCamResultsAvailable := "bx2127-Results Available";
	        #arCognexInterface["cScannerBX2127"].xInCamGeneralFault := "bx2127-General Fault";
	        #arCognexInterface["cScannerBX2127"].hwInCamInspectionResults := "=A01+UC022-BX2127~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO224.stInSettings.xCar2NecLeft := FALSE;
	        #TRO224.stInSettings.xCar2NecRight := TRUE;
	        #TRO224.stInSettings.xPrioDir1 := FALSE;
	        #TRO224.stInSettings.xPrioDir2 := TRUE;
	        
	     //   "DB_JamArea1203".stJam1203_2.arCarrier[1].nDestination := "cDestF2HLoaded";
	        
	        #TRO224(stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO224.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO224.TroOut,
	                nInMainTroNo := "cMainTro224",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO224,
	                xInCarouselRun1 := #fbExitConv1203.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv1204.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO224,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2127"],
	                arInOutJamEntr1 := "DB_JamArea1203".stJam1203_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1203".stJam1203_2.stData,
	                arInOutJamExit2 := "DB_JamArea1206".stJam1206_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1206".stJam1206_1.stData,
	                arInOutJamExit3 := "DB_JamArea1204".stJam1204_3.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1204".stJam1204_3.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro224"],
	                xOutStopper1 => "MB3780",
	                xOutSw1ExTo3 => "MB3781");
	        
	        "bx2127-TriggerEnable" := #arCognexInterface["cScannerBX2127"].xOutCamTriggerEnable;
	        "bx2127-Trigger" := #arCognexInterface["cScannerBX2127"].xOutCamTrigger;
	        "bx2127-ResultsAck" := #arCognexInterface["cScannerBX2127"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO224.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO224.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1203".stJam1203_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi224.1",
	                           nOutDirection => #TRO224.nInDirection,
	                           InOutCarrier := "DB_JamArea1203".stJam1203_2.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 225(1Sep1Switch)+Scanner(BX2129)
	        #TRO225.stInSeparator1.Settings.nSeparatorNo := "cSep225.1";
	        #TRO225.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Long";
	        #TRO225.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO225.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO225.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO225.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO225.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO225.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3900"];
	        #TRO225.stInSenJam3 := "DB_Inputs".Sensors["cInBG3901"];
	        
	        #TRO225.stInSwitch1.Settings.nSwitchNo := "cSwi225.1";
	        #TRO225.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO225.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO225.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO225.stInSwitch1.Settings.nTo1Destinations := 4; //Info nötig für HMI
	        
	        #TRO225.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO225.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2129"].xInCamTriggerReady := "bx2129-TriggerReady";
	        #arCognexInterface["cScannerBX2129"].xInCamTriggerAck := "bx2129-TriggerAck";
	        #arCognexInterface["cScannerBX2129"].xInCamResultsAvailable := "bx2129-Results Available";
	        #arCognexInterface["cScannerBX2129"].xInCamGeneralFault := "bx2129-General Fault";
	        #arCognexInterface["cScannerBX2129"].hwInCamInspectionResults := "=A01+UC022-BX2129~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO225.stInSettings.xCar2NecLeft := FALSE;
	        #TRO225.stInSettings.xCar2NecRight := FALSE;
	        #TRO225.stInSettings.xPrioDir1 := TRUE;
	        #TRO225.stInSettings.xPrioDir2 := FALSE;
	        
	     //   "DB_JamArea1204".stJam1204_1.arCarrier[1].nDestination := "cDestF2HLoaded";
	        
	        #TRO225(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO225.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO225.TroOut,
	                nInMainTroNo := "cMainTro225",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO225,
	                xInCarouselRun1 := #fbExitConv1204.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv1204.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO225,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2129"],
	                arInOutJamEntr1 := "DB_JamArea1204".stJam1204_1.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1204".stJam1204_1.stData,
	                arInOutJamExit2 := "DB_JamArea1204".stJam1204_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1204".stJam1204_2.stData,
	                arInOutJamExit3 := "DB_JamArea1208".stJam1208_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1208".stJam1208_1.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro225"],
	                xOutStopper1 => "MB3900",
	                xOutSw1ExTo4 => "MB3901");
	        
	        "bx2129-TriggerEnable" := #arCognexInterface["cScannerBX2129"].xOutCamTriggerEnable;
	        "bx2129-Trigger" := #arCognexInterface["cScannerBX2129"].xOutCamTrigger;
	        "bx2129-ResultsAck" := #arCognexInterface["cScannerBX2129"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO225.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO225.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1204".stJam1204_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi225.1",
	                           nOutDirection => #TRO225.nInDirection,
	                           InOutCarrier := "DB_JamArea1204".stJam1204_1.arCarrier[1]);
	            
	        END_REGION
	        
	        
	    END_REGION
	    
	    REGION TRO 226 (1Sep1Switch)+Scanner(BX2128)
	        #TRO226.stInSeparator1.Settings.nSeparatorNo := "cSep226.1";
	        #TRO226.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Long";
	        #TRO226.stInSeparator1.Settings.tTrailingTime := t#0ms;
	        #TRO226.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO226.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO226.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO226.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO226.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3840"];
	        #TRO226.stInSenJam2 := "DB_Inputs".Sensors["cInBG3847"];
	        #TRO226.stInSenJam3 := "DB_Inputs".Sensors["cInBG3841"];
	        
	        #TRO226.stInSwitch1.Settings.nSwitchNo := "cSwi226.1";
	        #TRO226.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO226.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO226.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO226.stInSwitch1.Settings.nTo1Destinations := 4; //Info nötig für HMI
	        
	        #TRO226.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO226.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2128"].xInCamTriggerReady := "bx2128-TriggerReady";
	        #arCognexInterface["cScannerBX2128"].xInCamTriggerAck := "bx2128-TriggerAck";
	        #arCognexInterface["cScannerBX2128"].xInCamResultsAvailable := "bx2128-Results Available";
	        #arCognexInterface["cScannerBX2128"].xInCamGeneralFault := "bx2128-General Fault";
	        #arCognexInterface["cScannerBX2128"].hwInCamInspectionResults := "=A01+UC022-BX2128~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO226.stInSettings.xCar2NecLeft := TRUE;
	        #TRO226.stInSettings.xCar2NecRight := FALSE;
	        #TRO226.stInSettings.xPrioDir1 := TRUE;
	        #TRO226.stInSettings.xPrioDir2 := FALSE;
	        
	     //   "DB_JamArea1204".stJam1204_2.arCarrier[1].nDestination := "cDestF2HLoaded";
	        
	        #TRO226(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO226.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO226.TroOut,
	                nInMainTroNo := "cMainTro226",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO226,
	                xInCarouselRun1 := #fbExitConv1204.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv1203.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO226,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2128"],
	                arInOutJamEntr1 := "DB_JamArea1204".stJam1204_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1204".stJam1204_2.stData,
	                arInOutJamExit2 := "DB_JamArea1204".stJam1204_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1204".stJam1204_3.stData,
	                arInOutJamExit3 := "DB_JamArea1207".stJam1207_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1207".stJam1207_1.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro226"],
	                xOutStopper1 => "MB3840",
	                xOutSw1ExTo4 => "MB3841");
	        
	        "MB3786" := TRUE;
	        
	        "bx2128-TriggerEnable" := #arCognexInterface["cScannerBX2128"].xOutCamTriggerEnable;
	        "bx2128-Trigger" := #arCognexInterface["cScannerBX2128"].xOutCamTrigger;
	        "bx2128-ResultsAck" := #arCognexInterface["cScannerBX2128"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO226.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO226.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1204".stJam1204_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi226.1",
	                           nOutDirection => #TRO226.nInDirection,
	                           InOutCarrier := "DB_JamArea1204".stJam1204_2.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 227 (1Sep)       
	        #TRO227.stInSeparator1.Settings.nSeparatorNo := "cSep227.1";
	        #TRO227.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO227.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO227.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO227.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO227.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO227.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO227.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO227.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3905"];
	        #TRO227.stInSenJam2 := "DB_Inputs".Sensors["cInBG3910"];
	        
	        #TRO227.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #stJamDataHandoverJam2209.Config.nCapacitySet := 1;
	        
	        #TRO227(nInMainTroNo := "cMainTro227",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO227 AND ("IO_Device_UH02_TO_UH01".stCARRIER_INFO_1[1].nBarcode = 0), //zwecks Übergabe warten bis UH03 Daten abgeholt hat
	                xInCarouselRun := #fbExitConv1204.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1204".stJam1204_3.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1204".stJam1204_3.stData,
	                arInOutJamExit2 := "IO_Device_UH02_TO_UH01".stCARRIER_INFO_1, //Daten#arCarrierHandoverJam2209,
	                stInOutJamExit2 := #stJamDataHandoverJam2209,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO227,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro227"],
	                xOutStopper1 => "MB3905");
	        
	        "MB3906" := TRUE;
	        
	        REGION Übergabe an Level 2
	            //todo: sicherstellen das UH03 ready ist, ansonsten sollte UH02 warten... 
	            "FB_I-Device_SendCarrier_J2209"(xInTrigger := (#TRO227.nState = 2500) AND #TRO227.fbSeparator1.xOutTrolleyReleasedEdge, //Trigger
	                                            xInAck := "IO_Device_UH02_FROM_UH01".bCARRIER_CONTROL_1.%X4, //von Empfänger
	                                            stInOutData := "IO_Device_UH02_TO_UH01".stCARRIER_INFO_1[1], //Daten
	                                            xOutReq := "IO_Device_UH02_TO_UH01".bCARRIER_CONTROL_1.%X4); //an Empfänger
	        END_REGION
	    END_REGION ;
	    
	    REGION TRO 229 (Vario)
	        
	        #TRO229.stInSeparator1.Settings.nSeparatorNo := "cSep229.1";
	        #TRO229.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO229.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO229.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO229.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO229.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO229.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO229.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO229.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3724"];
	        
	        #TRO229.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO229.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO229.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3723"]; // Finger in Pos
	        #TRO229.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3727"]; //Mt in Pos
	        #TRO229.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3486"]; // Conveyor full
	        #TRO229.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3485"]; // Jam detector
	        
	        #TRO229.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO229.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO229.stInVario.Settings.tConvEmpty := T#35000ms;
	        #TRO229.stInVario.Settings.nCountCarrier := 1;
	        #TRO229.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO229.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO229(nInMainTroNo := "cMainTro229",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO229,
	                xInAutomatic := #t_Automatik_OF1 AND "SF0180" AND "SF0050",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0181" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0064",
	                arInOutJamEntr := "DB_JamArea1205".stJam1205_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1205".stJam1205_1.stData,
	                arInOutJamFinger := "DB_JamArea1205".stJam1205_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1205".stJam1205_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO229,
	                xOutStopper => "MB3724",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro229"],
	                xOutVarioMotor => "MA0064");
	        
	    END_REGION
	    
	    REGION TRO 230 (1Sep)
	        #TRO230.stInSeparator1.Settings.nSeparatorNo := "cSep230.1";
	        #TRO230.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO230.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO230.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO230.stInSeparator1.Settings.tHandlingTime := t#400ms;
	        #TRO230.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO230.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO230.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO230.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO230.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3484"];
	        #TRO230.stInSenJam2 := "DB_Inputs".Sensors["cInBG3483"];
	        
	        #TRO230.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO230.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO230(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO230.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO230.TroOut,
	                nInMainTroNo := "cMainTro230",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO230,
	                xInCarouselRun := #fbSortConv1201.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1205".stJam1205_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1205".stJam1205_2.stData,
	                arInOutJamExit2 := "DB_JamArea1201".stJam1201_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1201".stJam1201_2.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO230,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro230"],
	                xOutStopper1 => "MB3484");
	        
	    END_REGION
	    REGION TRO 232 (Vario)
	        
	        #TRO232.stInSeparator1.Settings.nSeparatorNo := "cSep232.1";
	        #TRO232.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO232.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO232.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO232.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO232.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO232.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO232.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO232.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3784"];
	        
	        #TRO232.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO232.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO232.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3783"]; //Finger in Pos
	        #TRO232.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3787"];
	        #TRO232.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3546"]; // Conveyor full
	        #TRO232.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3545"]; // Jam detector
	        
	        #TRO232.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO232.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO232.stInVario.Settings.tConvEmpty := T#35000ms;
	        #TRO232.stInVario.Settings.nCountCarrier := 1;
	        #TRO232.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO232.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO232(nInMainTroNo := "cMainTro232",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO232,
	                xInAutomatic := #t_Automatik_OF1 AND "SF0182" AND "SF0052",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0183" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0065",
	                arInOutJamEntr := "DB_JamArea1206".stJam1206_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1206".stJam1206_1.stData,
	                arInOutJamFinger := "DB_JamArea1206".stJam1206_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1206".stJam1206_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO232,
	                xOutStopper => "MB3784",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro232"],
	                xOutVarioMotor => "MA0065");
	        
	    END_REGION
	    
	    REGION TRO 233 (1Sep)
	        #TRO233.stInSeparator1.Settings.nSeparatorNo := "cSep233.1";
	        #TRO233.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO233.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO233.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO233.stInSeparator1.Settings.tHandlingTime := t#400ms;
	        #TRO233.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO233.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO233.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO233.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO233.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3544"];
	        #TRO233.stInSenJam2 := "DB_Inputs".Sensors["cInBG3543"];
	        
	        #TRO233.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO233.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO233(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO233.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO233.TroOut,
	                nInMainTroNo := "cMainTro233",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO233,
	                xInCarouselRun := #fbSortConv1201.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1206".stJam1206_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1206".stJam1206_2.stData,
	                arInOutJamExit2 := "DB_JamArea1201".stJam1201_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1201".stJam1201_1.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO233,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro233"],
	                xOutStopper1 => "MB3544");
	        
	    END_REGION
	    
	    REGION TRO 235 (Vario)
	        
	        #TRO235.stInSeparator1.Settings.nSeparatorNo := "cSep235.1";
	        #TRO235.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO235.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO235.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO235.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO235.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO235.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO235.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO235.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3844"];
	        
	        #TRO235.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO235.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO235.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3843"]; // Finger in Pos
	        #TRO235.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3847"]; // MT in Pos
	        #TRO235.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3606"]; // Conveyor full
	        #TRO235.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3605"]; // Jam detector
	        
	        #TRO235.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO235.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO235.stInVario.Settings.tConvEmpty := T#35000ms;
	        #TRO235.stInVario.Settings.nCountCarrier := 1;
	        #TRO235.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO235.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO235(nInMainTroNo := "cMainTro235",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO235,
	                xInAutomatic := #t_Automatik_OF1 AND "SF0184" AND "SF0054",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0185" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0066",
	                arInOutJamEntr := "DB_JamArea1207".stJam1207_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1207".stJam1207_1.stData,
	                arInOutJamFinger := "DB_JamArea1207".stJam1207_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1207".stJam1207_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO235,
	                xOutStopper => "MB3844",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro235"],
	                xOutVarioMotor => "MA0066");
	        
	    END_REGION
	    
	    REGION TRO 236 (1Sep)
	        #TRO236.stInSeparator1.Settings.nSeparatorNo := "cSep236.1";
	        #TRO236.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO236.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO236.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO236.stInSeparator1.Settings.tHandlingTime := t#400ms;
	        #TRO236.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO236.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO236.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO236.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO236.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3604"];
	        #TRO236.stInSenJam2 := "DB_Inputs".Sensors["cInBG3603"];
	        
	        #TRO236.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO236.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO236(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO236.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO236.TroOut,
	                nInMainTroNo := "cMainTro236",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO236,
	                xInCancel := "cTodoFalse",
	                xInCarouselRun := #fbSortConv1202.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1207".stJam1207_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1207".stJam1207_2.stData,
	                arInOutJamExit2 := "DB_JamArea1202".stJam1202_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1202".stJam1202_2.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO236,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro236"],
	                xOutStopper1 => "MB3604");
	        
	    END_REGION
	    
	    REGION TRO 238 (Vario)
	        
	        #TRO238.stInSeparator1.Settings.nSeparatorNo := "cSep238.1";
	        #TRO238.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO238.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO238.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO238.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO238.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO238.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO238.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO238.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3904"];
	        
	        #TRO238.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO238.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO238.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3903"]; // Finger in Pos
	        #TRO238.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3907"]; // MT in Pos
	        #TRO238.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG3666"]; // Conveyor full
	        #TRO238.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG3665"]; // Jam detector
	        
	        #TRO238.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO238.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO238.stInVario.Settings.tConvEmpty := T#35000ms;
	        #TRO238.stInVario.Settings.nCountCarrier := 1;
	        #TRO238.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO238.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO238(nInMainTroNo := "cMainTro238",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO238,
	                xInAutomatic := #t_Automatik_OF1 AND "SF0186" AND "SF0056",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0187" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0067",
	                arInOutJamEntr := "DB_JamArea1208".stJam1208_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1208".stJam1208_1.stData,
	                arInOutJamFinger := "DB_JamArea1208".stJam1208_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1208".stJam1208_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO238,
	                xOutStopper => "MB3904",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro238"],
	                xOutVarioMotor => "MA0067");
	        
	    END_REGION
	    
	    REGION TRO 239 (1Sep)
	        #TRO239.stInSeparator1.Settings.nSeparatorNo := "cSep239.1";
	        #TRO239.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO239.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO239.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO239.stInSeparator1.Settings.tHandlingTime := t#400ms;
	        #TRO239.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO239.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO239.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO239.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO239.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3664"];
	        #TRO239.stInSenJam2 := "DB_Inputs".Sensors["cInBG3663"];
	        
	        
	        #TRO239.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO239.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO239(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO239.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO239.TroOut,
	                nInMainTroNo := "cMainTro239",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO239,
	                xInCancel := "cTodoFalse",
	                xInCarouselRun := #fbSortConv1202.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1208".stJam1208_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1208".stJam1208_2.stData,
	                arInOutJamExit2 := "DB_JamArea1202".stJam1202_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1202".stJam1202_3.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO239,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro239"],
	                xOutStopper1 => "MB3664");
	    END_REGION
	    
	    //Section 1.2 ENDE
	    
	    REGION TRO 240 (Vario)  // Eingang von Level 2
	        #TRO240.stInSeparator1.Settings.nSeparatorNo := "cSep240.1";
	        #TRO240.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO240.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO240.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO240.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO240.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO240.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO240.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO240.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4342"];
	        
	        #TRO240.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO240.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO240.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4343"]; //Finger in Pos
	        #TRO240.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4344"]; //MT in Pos
	        #TRO240.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4336"]; // Conveyor full
	        #TRO240.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4335"]; // Jam detector
	        
	        #TRO240.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO240.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO240.stInVario.Settings.tConvEmpty := T#20000ms;
	        #TRO240.stInVario.Settings.nCountCarrier := 1;
	        #TRO240.stInVario.Settings.tWaitForStop := t#3s;
	        
	        #TRO240.stInPriorityManager.xReleaseOk := TRUE; //braucht keine Vorfahrtsregelung
	        
	        #TRO240.stInSettings.xIsBorner := TRUE;
	        #TRO240(nInMainTroNo := "cMainTro240",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO240,
	                xInAutomatic := #t_Automatik_OF4,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0266",
	                arInOutJamEntr := "DB_JamArea1309".stJam1309_1.arCarrier,//Todo
	                stInOutJamEntr := "DB_JamArea1309".stJam1309_1.stData,
	                arInOutJamFinger := "DB_JamArea1309".stJam1309_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1309".stJam1309_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO240,
	                xOutStopper => "MB4342",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro240"],
	                xOutVarioMotor => "MA0266");
	        
	        REGION Übernahme von Level 2
	            "FB_I-Device_Receive_J1309"(xInReq := "IO_Device_UH03_FROM_UH01".bCARRIER_CONTROL_1.%X2,
	                                        stInData := "IO_Device_UH03_FROM_UH01".stCarrierL2toL1_3[1],
	                                        xInOutAck := "IO_Device_UH02_TO_UH01".bCARRIER_CONTROL_1.%X2);
	            
	            
	            IF "FB_I-Device_Receive_J1309".xOutNewData THEN //1 Zyklus vom Baustein
	                //Daten von UH03 in UH02 Jam schieben
	                "FC_TSHR_AddAtEnd"(stInTrolley := "FB_I-Device_Receive_J1309".stOutData,
	                                   nOutCounter => #tmpTSHRCounter,
	                                   xOutResult => #tmpTSHRResult,
	                                   arTSHR := "DB_JamArea1309".stJam1309_1.arCarrier);
	            END_IF;
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 241(1Sep)
	        #TRO241.stInSeparator1.Settings.nSeparatorNo := "cSep241.1";
	        #TRO241.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO241.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO241.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO241.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO241.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO241.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO241.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO241.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4334"];
	        #TRO241.stInSenJam2 := "DB_Inputs".Sensors["cInBG4340"];
	        
	        #TRO241.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO241.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO241.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO241(nInMainTroNo := "cMainTro241",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO241,
	                xInCarouselRun := #fbSortConv1304.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1309".stJam1309_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1309".stJam1309_2.stData,
	                arInOutJamExit2 := "DB_JamArea1304".stJam1304_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1304".stJam1304_1.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO241,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro241"],
	                xOutStopper1 => "MB4334");
	    END_REGION
	    
	    REGION TRO 242 (1Sep1Switch)+Scanner(BX2130)
	        #TRO242.stInSeparator1.Settings.nSeparatorNo := "cSep242.1";
	        #TRO242.stInSeparator1.Settings.SendOverJamTimeOut := TRUE; //true = alter Sep
	        #TRO242.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO242.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO242.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO242.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO242.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4337"];
	        #TRO242.stInSenJam2 := "DB_Inputs".Sensors["cInBG4263"];
	        #TRO242.stInSenJam3 := "DB_Inputs".Sensors["cInBG4323"];
	        
	        #TRO242.stInSwitch1.Settings.nSwitchNo := "cSwi242.1";
	        #TRO242.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO242.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO242.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO242.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO242.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO242.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2130"].xInCamTriggerReady := "bx2130-TriggerReady";
	        #arCognexInterface["cScannerBX2130"].xInCamTriggerAck := "bx2130-TriggerAck";
	        #arCognexInterface["cScannerBX2130"].xInCamResultsAvailable := "bx2130-Results Available";
	        #arCognexInterface["cScannerBX2130"].xInCamGeneralFault := "bx2130-General Fault";
	        #arCognexInterface["cScannerBX2130"].hwInCamInspectionResults := "=A01+UC022-BX2130~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO242.stInSettings.xCar2NecRight := TRUE;
	        #TRO242.stInSettings.xCar2NecLeft := TRUE;
	        #TRO242.stInSettings.xPrioDir1 := TRUE;
	        #TRO242.stInSettings.xPrioDir2 := TRUE;
	        
	        #TRO242(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO242_3.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO242_3.TroOut,
	                stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO242_4.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO242_4.TroOut,
	                nInMainTroNo := "cMainTro242",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO242,
	                xInCarouselRun1 := #fbSortConv1303.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbSortConv1304.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO242,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2130"],
	                arInOutJamEntr1 := "DB_JamArea1304".stJam1304_1.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1304".stJam1304_1.stData,
	                arInOutJamExit2 := "DB_JamArea1303".stJam1303_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1303".stJam1303_1.stData,
	                arInOutJamExit3 := "DB_JamArea1304".stJam1304_2.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1304".stJam1304_2.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro242"],
	                xOutStopper1 => "MB4337",
	                xOutSw1ExTo3 => "MB4261");
	        
	        "bx2130-TriggerEnable" := #arCognexInterface["cScannerBX2130"].xOutCamTriggerEnable;
	        "bx2130-Trigger" := #arCognexInterface["cScannerBX2130"].xOutCamTrigger;
	        "bx2130-ResultsAck" := #arCognexInterface["cScannerBX2130"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO242.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO242.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1304".stJam1304_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi242.1",
	                           nOutDirection => #TRO242.nInDirection,
	                           InOutCarrier := "DB_JamArea1304".stJam1304_1.arCarrier[1]);
	            
	        END_REGION
	        
	        
	    END_REGION
	    
	    REGION TRO 243 (1Sep1Switch)+Scanner(BX3137)
	        #TRO243.stInSeparator1.Settings.nSeparatorNo := "cSep243.1";
	        #TRO243.stInSeparator1.Settings.SendOverJamTimeOut := TRUE; //true = alter Sep
	        #TRO243.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Long";
	        #TRO243.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO243.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO243.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO243.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3960"];
	        #TRO243.stInSenJam3 := "DB_Inputs".Sensors["cInBG3961"];
	        
	        #TRO243.stInSwitch1.Settings.nSwitchNo := "cSwi243.1";
	        #TRO243.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO243.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO243.stInSwitch1.Settings.nTo1Destinations := 4; //Info nötig für HMI
	        
	        #TRO243.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO243.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2135"].xInCamTriggerReady := "bx2135-TriggerReady";
	        #arCognexInterface["cScannerBX2135"].xInCamTriggerAck := "bx2135-TriggerAck";
	        #arCognexInterface["cScannerBX2135"].xInCamResultsAvailable := "bx2135-Results Available";
	        #arCognexInterface["cScannerBX2135"].xInCamGeneralFault := "bx2135-General Fault";
	        #arCognexInterface["cScannerBX2135"].hwInCamInspectionResults := "=A01+UC023-BX2135~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO243.stInSettings.xCar2NecLeft := FALSE;
	        #TRO243.stInSettings.xCar2NecRight := FALSE;
	        #TRO243.stInSettings.xPrioDir1 := TRUE;
	        #TRO243.stInSettings.xPrioDir2 := FALSE;
	        
	        "DB_JamArea1301".stJam1301_1.arCarrier[1].nDestination := "cDestF2HLoaded";
	        
	        #TRO243(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO243.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO243.TroOut,
	                nInMainTroNo := "cMainTro243",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO243,
	                xInCarouselRun1 := #fbExitConv1301.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv1301.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO243,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2135"],
	                arInOutJamEntr1 := "DB_JamArea1301".stJam1301_1.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1301".stJam1301_1.stData,
	                arInOutJamExit2 := "DB_JamArea1301".stJam1301_2.arCarrier, 
	                stInOutJamExit2 := "DB_JamArea1301".stJam1301_2.stData,
	                arInOutJamExit3 := "DB_JamArea1305".stJam1305_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1305".stJam1305_1.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro243"],
	                xOutStopper1 => "MB3960",
	                xOutSw1ExTo4 => "MB3961");
	        
	        "bx2135-TriggerEnable" := #arCognexInterface["cScannerBX2135"].xOutCamTriggerEnable;
	        "bx2135-Trigger" := #arCognexInterface["cScannerBX2135"].xOutCamTrigger;
	        "bx2135-ResultsAck" := #arCognexInterface["cScannerBX2135"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO243.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO243.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1303".stJam1303_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi243.1",
	                           nOutDirection => #TRO243.nInDirection,
	                           InOutCarrier := "DB_JamArea1303".stJam1303_1.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 244 (1Sep1Switch)+Scanner(BX2136)
	        #TRO244.stInSeparator1.Settings.nSeparatorNo := "cSep244.1";
	        #TRO244.stInSeparator1.Settings.SendOverJamTimeOut := TRUE; //true = alter Sep
	        #TRO244.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Long";
	        #TRO244.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO244.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO244.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO244.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4020"];
	        #TRO244.stInSenJam2 := "DB_Inputs".Sensors["cInBG4021"];
	        
	        #TRO244.stInSwitch1.Settings.nSwitchNo := "cSwi244.1";
	        #TRO244.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO244.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO244.stInSwitch1.Settings.tTransitEx := T#5s;
	        #TRO244.stInSwitch1.Settings.nTo1Destinations := 4; //Info nötig für HMI
	        
	        #TRO244.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO244.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2136"].xInCamTriggerReady := "bx2136-TriggerReady";
	        #arCognexInterface["cScannerBX2136"].xInCamTriggerAck := "bx2136-TriggerAck";
	        #arCognexInterface["cScannerBX2136"].xInCamResultsAvailable := "bx2136-Results Available";
	        #arCognexInterface["cScannerBX2136"].xInCamGeneralFault := "bx2136-General Fault";
	        #arCognexInterface["cScannerBX2136"].hwInCamInspectionResults := "=A01+UC023-BX2136~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO244.stInSettings.xCar2NecLeft := TRUE;
	        
	        #TRO244.stInSettings.xCar2NecLeft := TRUE;
	        #TRO244.stInSettings.xCar2NecRight := FALSE;
	        #TRO244.stInSettings.xPrioDir1 := TRUE;
	        #TRO244.stInSettings.xPrioDir2 := FALSE;
	        
	        "DB_JamArea1301".stJam1301_2.arCarrier[1].nDestination := "cDestF2HLoaded";
	        
	        #TRO244(stInPriorityManagerDir1 := "DB_Prozessdaten".stPriorityManager.udt_TRO244.TroIn,
	                stOutPriorityManagerDir1 => "DB_Prozessdaten".stPriorityManager.udt_TRO244.TroOut,
	                nInMainTroNo := "cMainTro244",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO244,
	                xInCarouselRun1 := #fbExitConv1301.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv1302.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO244,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2136"],
	                arInOutJamEntr1 := "DB_JamArea1301".stJam1301_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1301".stJam1301_2.stData,
	                arInOutJamExit2 := "DB_JamArea1302".stJam1302_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1302".stJam1302_3.stData,
	                arInOutJamExit3 := "DB_JamArea1306".stJam1306_1.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1306".stJam1306_1.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro244"],
	                xOutStopper1 => "MB4020",
	                xOutSw1ExTo4 => "MB4021");
	        
	        "bx2136-TriggerEnable" := #arCognexInterface["cScannerBX2136"].xOutCamTriggerEnable;
	        "bx2136-Trigger" := #arCognexInterface["cScannerBX2136"].xOutCamTrigger;
	        "bx2136-ResultsAck" := #arCognexInterface["cScannerBX2136"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO244.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO244.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1301".stJam1301_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi244.1",
	                           nOutDirection => #TRO244.nInDirection,
	                           InOutCarrier := "DB_JamArea1301".stJam1301_2.arCarrier[1]);
	            
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 245 (1Sep1Switch)+Scanner(BX2138)
	        #TRO245.stInSeparator1.Settings.nSeparatorNo := "cSep245.1";
	        #TRO245.stInSeparator1.Settings.SendOverJamTimeOut := TRUE; //true = alter Sep
	        #TRO245.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Long";
	        #TRO245.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO245.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO245.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO245.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4140"];
	        #TRO245.stInSenJam2 := "DB_Inputs".Sensors["cInBG4141"];
	        
	        #TRO245.stInSwitch1.Settings.nSwitchNo := "cSwi245.1";
	        #TRO245.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO245.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO245.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO245.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO245.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2138"].xInCamTriggerReady := "bx2138-TriggerReady";
	        #arCognexInterface["cScannerBX2138"].xInCamTriggerAck := "bx2138-TriggerAck";
	        #arCognexInterface["cScannerBX2138"].xInCamResultsAvailable := "bx2138-Results Available";
	        #arCognexInterface["cScannerBX2138"].xInCamGeneralFault := "bx2138-General Fault";
	        #arCognexInterface["cScannerBX2138"].hwInCamInspectionResults := "=A01+UC022-BX2138~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO245.stInSettings.xCar2NecLeft := FALSE;
	        #TRO245.stInSettings.xCar2NecRight := FALSE;
	        #TRO245.stInSettings.xPrioDir1 := FALSE;
	        #TRO245.stInSettings.xPrioDir2 := TRUE;
	        
	        "DB_JamArea1302".stJam1302_1.arCarrier[1].nDestination := "cDestF2HLoaded";
	        
	        #TRO245(stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO245.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO245.TroOut,
	                nInMainTroNo := "cMainTro245",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO245,
	                xInCarouselRun1 := #fbExitConv1302.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv1302.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO245,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2138"],
	                arInOutJamEntr1 := "DB_JamArea1302".stJam1302_1.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1302".stJam1302_1.stData,
	                arInOutJamExit2 := "DB_JamArea1308".stJam1308_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1308".stJam1308_1.stData,
	                arInOutJamExit3 := "DB_JamArea1302".stJam1302_2.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1302".stJam1302_2.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro245"],
	                xOutStopper1 => "MB4140",
	                xOutSw1ExTo3 => "MB4141");
	        
	        "bx2138-TriggerEnable" := #arCognexInterface["cScannerBX2138"].xOutCamTriggerEnable;
	        "bx2138-Trigger" := #arCognexInterface["cScannerBX2138"].xOutCamTrigger;
	        "bx2138-ResultsAck" := #arCognexInterface["cScannerBX2138"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO245.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO245.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1302".stJam1302_1.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi245.1",
	                           nOutDirection => #TRO245.nInDirection,
	                           InOutCarrier := "DB_JamArea1302".stJam1302_1.arCarrier[1]);
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 246 (1Sep1Switch)+Scanner(BX2137)
	        #TRO246.stInSeparator1.Settings.nSeparatorNo := "cSep246.1";
	        #TRO246.stInSeparator1.Settings.SendOverJamTimeOut := TRUE; //true = alter Sep
	        #TRO246.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Long";
	        #TRO246.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO246.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO246.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO246.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4080"];
	        #TRO246.stInSenJam2 := "DB_Inputs".Sensors["cInBG4081"];
	        
	        #TRO246.stInSwitch1.Settings.nSwitchNo := "cSwi246.1";
	        #TRO246.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO246.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO246.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO246.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO246.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2137"].xInCamTriggerReady := "bx2137-TriggerReady";
	        #arCognexInterface["cScannerBX2137"].xInCamTriggerAck := "bx2137-TriggerAck";
	        #arCognexInterface["cScannerBX2137"].xInCamResultsAvailable := "bx2137-Results Available";
	        #arCognexInterface["cScannerBX2137"].xInCamGeneralFault := "bx2137-General Fault";
	        #arCognexInterface["cScannerBX2137"].hwInCamInspectionResults := "=A01+UC022-BX2137~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO246.stInSettings.xCar2NecLeft := FALSE;
	        #TRO246.stInSettings.xCar2NecRight := TRUE;
	        #TRO246.stInSettings.xPrioDir1 := FALSE;
	        #TRO246.stInSettings.xPrioDir2 := TRUE;
	        
	        "DB_JamArea1302".stJam1302_2.arCarrier[1].nDestination := "cDestF2HLoaded";
	        
	        #TRO246(stInPriorityManagerDir2 := "DB_Prozessdaten".stPriorityManager.udt_TRO246.TroIn,
	                stOutPriorityManagerDir2 => "DB_Prozessdaten".stPriorityManager.udt_TRO246.TroOut,
	                nInMainTroNo := "cMainTro246",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO246,
	                xInCarouselRun1 := #fbExitConv1302.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbExitConv1301.xOutConveyorFullSpeed,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO246,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2137"],
	                arInOutJamEntr1 := "DB_JamArea1302".stJam1302_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1302".stJam1302_2.stData,
	                arInOutJamExit2 := "DB_JamArea1307".stJam1307_1.arCarrier, //!
	                stInOutJamExit2 := "DB_JamArea1307".stJam1307_1.stData,
	                arInOutJamExit3 := "DB_JamArea1302".stJam1302_3.arCarrier,
	                stInOutJamExit3 := "DB_JamArea1302".stJam1302_3.stData,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro246"],
	                xOutStopper1 => "MB4080",
	                xOutSw1ExTo3 => "MB4081");
	        
	        "MB4026" := 0
	        ;
	        
	        "bx2137-TriggerEnable" := #arCognexInterface["cScannerBX2137"].xOutCamTriggerEnable;
	        "bx2137-Trigger" := #arCognexInterface["cScannerBX2137"].xOutCamTrigger;
	        "bx2137-ResultsAck" := #arCognexInterface["cScannerBX2137"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO246.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO246.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1302".stJam1302_2.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi246.1",
	                           nOutDirection => #TRO246.nInDirection,
	                           InOutCarrier := "DB_JamArea1302".stJam1302_2.arCarrier[1]);
	        END_REGION
	        
	    END_REGION
	    
	    
	    REGION TRO 247(1Sep)    // Ausgang zu Level 2   
	        #TRO247.stInSeparator1.Settings.nSeparatorNo := "cSep247.1";
	        #TRO247.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO247.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO247.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO247.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO247.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO247.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO247.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO247.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4085"];
	        #TRO247.stInSenJam2 := "DB_Inputs".Sensors["cInBG4091"];
	        
	        #TRO247.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #stJamDataHandoverJam2309.Config.nCapacitySet := 1; //
	        
	        #TRO247(nInMainTroNo := "cMainTro247",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF3.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO247 AND ("IO_Device_UH02_TO_UH01".stCARRIER_INFO_2[1].nBarcode = 0), //zwecks Übergabe warten bis UH03 Daten abgeholt hat
	                xInCarouselRun := #fbExitConv1302.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF3,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1302"."stJam1302_3".arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1302".stJam1302_3.stData,
	                arInOutJamExit2 := "IO_Device_UH02_TO_UH01".stCARRIER_INFO_2, //Daten #arCarrierHandoverJam2309,
	                stInOutJamExit2 := #stJamDataHandoverJam2309,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO247,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro247"],
	                xOutStopper1 => "MB4085");
	        
	        "MB4086" := TRUE;
	        
	        REGION Übergabe an Level 2
	            //todo: sicherstellen das UH03 ready ist, ansonsten sollte UH02 warten... 
	            "FB_I-Device_SendCarrier_J2309"(xInTrigger := (#TRO247.nState = 2500) AND #TRO247.fbSeparator1.xOutTrolleyReleasedEdge, //Trigger
	                                            xInAck := "IO_Device_UH02_FROM_UH01".bCARRIER_CONTROL_1.%X5, //von Empfänger
	                                            stInOutData := "IO_Device_UH02_TO_UH01".stCARRIER_INFO_2[1], //Daten
	                                            xOutReq := "IO_Device_UH02_TO_UH01".bCARRIER_CONTROL_1.%X5); //an Empfänger
	        END_REGION
	    END_REGION
	    
	    REGION TRO 249 (Vario)
	        
	        #TRO249.stInSeparator1.Settings.nSeparatorNo := "cSep249.1";
	        #TRO249.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO249.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO249.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO249.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO249.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO249.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO249.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO249.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG3964"];
	        
	        #TRO249.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO249.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO249.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG3963"]; //Finger in Pos
	        #TRO249.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG3967"];
	        #TRO249.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4206"]; // Conveyor full
	        #TRO249.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4205"]; // Jam detector
	        
	        #TRO249.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO249.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO249.stInVario.Settings.tConvEmpty := T#35000ms;
	        #TRO249.stInVario.Settings.nCountCarrier := 1;
	        #TRO249.stInVario.Settings.tWaitForStop := t#3s;
	        
	        #TRO249.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        // #TRO249.stInSettings.sJamSrc := 'xxx';
	        // #TRO249.stInSettings.sJamDest := 'yyy';
	        
	        #TRO249(nInMainTroNo := "cMainTro249",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO249,
	                xInAutomatic := #t_Automatik_OF4 AND "SF0190" AND "SF0240",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0191" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0262",
	                arInOutJamEntr := "DB_JamArea1305".stJam1305_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1305".stJam1305_1.stData,
	                arInOutJamFinger := "DB_JamArea1305".stJam1305_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1305".stJam1305_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO249,
	                xOutStopper => "MB3964",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro249"],
	                xOutVarioMotor => "MA0262");
	        
	    END_REGION
	    
	    REGION TRO 250 (1Sep)
	        #TRO250.stInSeparator1.Settings.nSeparatorNo := "cSep250.1";
	        #TRO250.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO250.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO250.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Medium";
	        #TRO250.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO250.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO250.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO250.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO250.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO250.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4204"];
	        #TRO250.stInSenJam2 := "DB_Inputs".Sensors["cInBG4203"];
	        
	        #TRO250.stInSeparator1.Settings.tSenFree := T#1500ms;
	        #TRO250.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO250(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO250.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO250.TroOut,
	                nInMainTroNo := "cMainTro250",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO250,
	                xInCarouselRun := #fbSortConv1303.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1305".stJam1305_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1305".stJam1305_2.stData,
	                arInOutJamExit2 := "DB_JamArea1303".stJam1303_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1303".stJam1303_2.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO250,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro250"],
	                xOutStopper1 => "MB4204");
	        
	        
	        
	    END_REGION
	    
	    REGION TRO 252 (Vario)
	        
	        #TRO252.stInSeparator1.Settings.nSeparatorNo := "cSep252.1";
	        #TRO252.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO252.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO252.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO252.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO252.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO252.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO252.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO252.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4024"];
	        
	        #TRO252.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO252.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO252.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4023"]; //Finger in Pos
	        #TRO252.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4027"];
	        #TRO252.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4266"]; // Conveyor full
	        #TRO252.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4265"]; // Jam detector
	        
	        #TRO252.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO252.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO252.stInVario.Settings.tConvEmpty := T#35000ms;
	        #TRO252.stInVario.Settings.nCountCarrier := 1;
	        #TRO252.stInVario.Settings.tWaitForStop := t#3s;
	        
	        #TRO252.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        // #TRO252.stInSettings.sJamSrc := 'xxx';
	        // #TRO252.stInSettings.sJamDest := 'yyy';
	        
	        #TRO252(nInMainTroNo := "cMainTro252",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO252,
	                xInAutomatic := #t_Automatik_OF4 AND "SF0192" AND "SF0242",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0193" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0263",
	                arInOutJamEntr := "DB_JamArea1306".stJam1306_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1306".stJam1306_1.stData,
	                arInOutJamFinger := "DB_JamArea1306".stJam1306_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1306".stJam1306_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO252,
	                xOutStopper => "MB4024",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro252"],
	                xOutVarioMotor => "MA0263");
	        
	    END_REGION
	    
	    REGION TRO 253 (1Sep)
	        #TRO253.stInSeparator1.Settings.nSeparatorNo := "cSep253.1";
	        #TRO253.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO253.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO253.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO253.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO253.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO253.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO253.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO253.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO253.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4264"];
	        #TRO253.stInSenJam2 := "DB_Inputs".Sensors["cInBG4263"];
	        
	        #TRO253.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO253.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO253(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO253.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO253.TroOut,
	                nInMainTroNo := "cMainTro253",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO253,
	                xInCarouselRun := #fbSortConv1303.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1306".stJam1306_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1306".stJam1306_2.stData,
	                arInOutJamExit2 := "DB_JamArea1303".stJam1303_1.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1303".stJam1303_1.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO253,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro253"],
	                xOutStopper1 => "MB4264");
	        
	    END_REGION
	    
	    REGION TRO 255 (Vario)
	        
	        #TRO255.stInSeparator1.Settings.nSeparatorNo := "cSep255.1";
	        #TRO255.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO255.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO255.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO255.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO255.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO255.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO255.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO255.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4084"];
	        
	        #TRO255.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO255.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO255.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4083"]; //Finger in Pos
	        #TRO255.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4087"];
	        #TRO255.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4326"]; // Conveyor full
	        #TRO255.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4325"]; // Jam detector
	        
	        #TRO255.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO255.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO255.stInVario.Settings.tConvEmpty := T#35000ms;
	        #TRO255.stInVario.Settings.nCountCarrier := 1;
	        #TRO255.stInVario.Settings.tWaitForStop := t#3s;
	        
	        #TRO255.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        // #TRO255.stInSettings.sJamSrc := 'xxx';
	        // #TRO255.stInSettings.sJamDest := 'yyy';
	        
	        #TRO255(nInMainTroNo := "cMainTro255",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInRelease := "DB_TRO_Test".TRO255,
	                xInAutomatic := #t_Automatik_OF4 AND "SF0194" AND "SF0244",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0195" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0264",
	                arInOutJamEntr := "DB_JamArea1307".stJam1307_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1307".stJam1307_1.stData,
	                arInOutJamFinger := "DB_JamArea1307".stJam1307_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1307".stJam1307_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO255,
	                xOutStopper => "MB4084",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro255"],
	                xOutVarioMotor => "MA0264");
	        
	    END_REGION
	    
	    REGION TRO 256 (1Sep)
	        #TRO256.stInSeparator1.Settings.nSeparatorNo := "cSep256.1";
	        #TRO256.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO256.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO256.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO256.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO256.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO256.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO256.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO256.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO256.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4324"];
	        #TRO256.stInSenJam2 := "DB_Inputs".Sensors["cInBG4323"];
	        
	        #TRO256.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO256.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO256(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO256.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO256.TroOut,
	                nInMainTroNo := "cMainTro256",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO256,
	                xInCarouselRun := #fbSortConv1304.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1307".stJam1307_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1307".stJam1307_2.stData,
	                arInOutJamExit2 := "DB_JamArea1304".stJam1304_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1304".stJam1304_2.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO256,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro256"],
	                xOutStopper1 => "MB4324");
	        
	    END_REGION
	    
	    REGION TRO 258 (Vario)
	        
	        #TRO258.stInSeparator1.Settings.nSeparatorNo := "cSep258.1";
	        #TRO258.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO258.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO258.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO258.stInSeparator1.Settings.tSenWait := T#4300ms;
	        #TRO258.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO258.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO258.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO258.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO258.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO258.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4144"];
	        
	        #TRO258.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO258.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO258.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4143"]; //Pusher Dog in Pos
	        #TRO258.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4147"];
	        #TRO258.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4386"]; // Conveyor full
	        #TRO258.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4385"]; // Jam detector
	        
	        #TRO258.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO258.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO258.stInVario.Settings.tConvEmpty := T#35000ms;
	        #TRO258.stInVario.Settings.nCountCarrier := 1;
	        #TRO258.stInVario.Settings.tWaitForStop := t#3s;
	        
	        // #TRO258.stInSettings.sJamSrc := 'xxx';
	        // #TRO258.stInSettings.sJamDest := 'yyy';
	        #TRO258.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO258(nInMainTroNo := "cMainTro258",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF4 AND "SF0196" AND "SF0246",
	                xInReset := "cTodoFalse",
	                xInErrorQuit := "SF0197" OR "SF0002" OR "IBN".xQuitGlob,
	                xInMotorProtection := "FC0265",
	                xInRelease := "DB_TRO_Test".TRO258,
	                arInOutJamEntr := "DB_JamArea1308".stJam1308_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1308".stJam1308_1.stData,
	                arInOutJamFinger := "DB_JamArea1308".stJam1308_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1308".stJam1308_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO258,
	                xOutStopper => "MB4144",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro258"],
	                xOutVarioMotor => "MA0265");
	        
	    END_REGION
	    
	    REGION TRO 259 (1Sep)
	        #TRO259.stInSeparator1.Settings.nSeparatorNo := "cSep259.1";
	        #TRO259.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO259.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO259.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO259.stInSeparator1.Settings.DoNotDeleteOnScanCorrection := TRUE; //unterdrückt den Fehler "Carrier kommt nicht an", weil Sep nach Vario
	        #TRO259.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO259.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO259.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO259.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO259.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4384"];
	        #TRO259.stInSenJam2 := "DB_Inputs".Sensors["cInBG4383"];
	        
	        #TRO259.stInSeparator1.Settings.tSenFree := T#2500ms;
	        #TRO259.stInSeparator1.Settings.tSenWait := T#2500ms;
	        
	        #TRO259(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO259.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO259.TroOut,
	                nInMainTroNo := "cMainTro259",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF4.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO259,
	                xInCarouselRun := #fbSortConv1304.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF4,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1308".stJam1308_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1308".stJam1308_2.stData,
	                arInOutJamExit2 := "DB_JamArea1304".stJam1304_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1304".stJam1304_3.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO259,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro259"],
	                xOutStopper1 => "MB4384");
	        
	    END_REGION
	    
	    // Ende Section 1.3
	    
	    
	    REGION TRO 260 (Vario) + Scanner (BX2115)
	        
	        REGION Übernahme von Level 2
	            "FB_I-Device_Receive_J1601"(xInReq := "IO_Device_UH03_FROM_UH01".bCARRIER_CONTROL.%X2,
	                                        stInData := "IO_Device_UH03_FROM_UH01".stCARRIER_INFO_2[1],
	                                        xInOutAck := "IO_Device_UH02_TO_UH01".bCARRIER_CONTROL.%X2);
	            
	            IF "FB_I-Device_Receive_J1601".xOutNewData THEN //1 Zyklus vom Baustein
	                //Daten von UH03 in UH02 Jam schieben
	                "FC_TSHR_AddAtEnd"(stInTrolley := "FB_I-Device_Receive_J1601".stOutData,
	                                   nOutCounter => #tmpTSHRCounter,
	                                   xOutResult => #tmpTSHRResult,
	                                   arTSHR := "DB_JamArea1601".stJam1601_1.arCarrier);
	            END_IF;
	        END_REGION
	        
	        
	        #TRO260.stInSeparator1.Settings.nSeparatorNo := "cSep260.1";
	        #TRO200.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO200.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO260.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO260.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO260.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO260.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO260.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO260.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4543"];
	        
	        #TRO260.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO260.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO260.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4544"]; //Pusher Dog in Pos
	        #TRO260.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4545"];
	        #TRO260.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4524"]; // Conveyor full
	        #TRO260.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4525"]; // Jam detector
	        
	        #TRO260.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO260.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO260.stInVario.Settings.tWaitForStop := T#3s;
	        #TRO260.stInVario.Settings.tConvEmpty := T#15000ms;
	        #TRO260.stInVario.Settings.nCountCarrier := 1;
	        
	        #TRO260.stInVario.Settings.xJamSenDelayActive := true;
	        #TRO260.stInVario.Settings.tJamSenDelay := t#1s;
	        
	        #TRO260.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO260.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2115"].xInCamTriggerReady := "bx2115-TriggerReady";
	        #arCognexInterface["cScannerBX2115"].xInCamTriggerAck := "bx2115-TriggerAck";
	        #arCognexInterface["cScannerBX2115"].xInCamResultsAvailable := "bx2115-Results Available";
	        #arCognexInterface["cScannerBX2115"].xInCamGeneralFault := "bx2115-General Fault";
	        #arCognexInterface["cScannerBX2115"].hwInCamInspectionResults := "=A01+UH02-BX2115~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO260.stInPriorityManager.xReleaseOk := TRUE; //braucht keine Vorfahrtsregelung
	        
	        #TRO260(nInMainTroNo := "cMainTro260",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0073",
	                xInRelease := "DB_TRO_Test".TRO260,
	                arInOutJamEntr := "DB_JamArea1601".stJam1601_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1601".stJam1601_1.stData,
	                arInOutJamFinger := "DB_JamArea1601".stJam1601_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1601".stJam1601_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2115"],
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO260,
	                xOutStopper => "MB4543",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro260"],
	                xOutVarioMotor => "MA0073");
	        
	        "bx2115-TriggerEnable" := #arCognexInterface["cScannerBX2115"].xOutCamTriggerEnable;
	        "bx2115-Trigger" := #arCognexInterface["cScannerBX2115"].xOutCamTrigger;
	        "bx2115-ResultsAck" := #arCognexInterface["cScannerBX2115"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO260.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO260.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1601".stJam1601_1.arCarrier[1]);
	        END_REGION ;
	        
	    END_REGION
	    
	    REGION TRO 261 (1Sep)
	        #TRO261.stInSeparator1.Settings.nSeparatorNo := "cSep261.1";
	        #TRO261.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO261.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO261.stInSeparator1.Settings.tHandlingTime := t#400ms;
	        #TRO261.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO261.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO261.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO261.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO261.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4526"];
	        #TRO261.stInSenJam2 := "DB_Inputs".Sensors["cInBG4507"];
	        
	        #TRO261.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO261.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	       (* REGION ZIEL FÜR LEERE ANGEBEN
	            IF "DB_JamArea1601".stJam1601_2.arCarrier[1].bStatus.%X0 THEN
	                "DB_JamArea1601".stJam1601_2.arCarrier[1].nDestination := "cDestF2HEmpty";//"cDestInboundEmpty";
	            END_IF;
	        END_REGION *)
	
	        
	        #TRO261.stInPriorityManager.xReleaseOk := "cTodoTRUE";
	        
	        #TRO261(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO261.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO261.TroOut,
	                nInMainTroNo := "cMainTro261",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO261,
	                xInCarouselRun := #fbCarousel1110.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1601".stJam1601_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1601".stJam1601_2.stData,
	                arInOutJamExit2 := "DB_JamArea1110".stJam1110_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1110".stJam1110_2.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO261,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro261"],
	                xOutStopper1 => "MB4526");
	        
	    END_REGION
	    
	    
	    REGION TRO 262 (Vario) + Scanner (BX2109)
	        
	        REGION Übernahme von Level 2
	            "FB_I-Device_Receive_J1501"(xInReq := "IO_Device_UH03_FROM_UH01".bCARRIER_CONTROL.%X1,
	                                        stInData := "IO_Device_UH03_FROM_UH01".stCARRIER_INFO_1[1],
	                                        xInOutAck := "IO_Device_UH02_TO_UH01".bCARRIER_CONTROL.%X1);
	            
	            IF "FB_I-Device_Receive_J1501".xOutNewData THEN //1 Zyklus vom Baustein
	                //Daten von UH03 in UH02 Jam schieben
	                "FC_TSHR_AddAtEnd"(stInTrolley := "FB_I-Device_Receive_J1501".stOutData,
	                                   nOutCounter => #tmpTSHRCounter,
	                                   xOutResult => #tmpTSHRResult,
	                                   arTSHR := "DB_JamArea1501".stJam1501_1.arCarrier);
	            END_IF;
	        END_REGION
	        
	        #TRO262.stInSeparator1.Settings.nSeparatorNo := "cSep262.1";
	        #TRO262.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO262.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO262.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO262.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO262.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO262.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO262.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO262.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4540"];
	        
	        #TRO262.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO262.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO262.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4541"]; //Pusher Dog in Pos
	        #TRO262.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4542"];
	        #TRO262.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4520"]; // Conveyor full
	        #TRO262.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4521"]; // Jam detector
	        
	        #TRO262.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO262.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO262.stInVario.Settings.tConvEmpty := T#15000ms;
	        #TRO262.stInVario.Settings.tWaitForStop := t#3s;
	        #TRO262.stInVario.Settings.nCountCarrier := 1;
	        
	        #TRO262.stInVario.Settings.tCarrierInPosDelay := t#1200ms;
	        #TRO262.stInVario.Settings.tCarrierInPosEdgeDelay := t#100ms;
	        
	        #TRO262.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO262.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2109"].xInCamTriggerReady := "bx2109-TriggerReady";
	        #arCognexInterface["cScannerBX2109"].xInCamTriggerAck := "bx2109-TriggerAck";
	        #arCognexInterface["cScannerBX2109"].xInCamResultsAvailable := "bx2109-Results Available";
	        #arCognexInterface["cScannerBX2109"].xInCamGeneralFault := "bx2109-General Fault";
	        #arCognexInterface["cScannerBX2109"].hwInCamInspectionResults := "=A01+UH02-BX2109~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO262.stInPriorityManager.xReleaseOk := TRUE; //braucht keine Vorfahrtsregelung
	        
	        #TRO262(nInMainTroNo := "cMainTro262",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0072",
	                xInRelease := "DB_TRO_Test".TRO262,
	                arInOutJamEntr := "DB_JamArea1501".stJam1501_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1501".stJam1501_1.stData,
	                arInOutJamFinger := "DB_JamArea1501".stJam1501_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1501".stJam1501_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2109"],
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO262,
	                xOutStopper => "MB4540",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro262"],
	                xOutVarioMotor => "MA0072");
	        
	        "bx2109-TriggerEnable" := #arCognexInterface["cScannerBX2109"].xOutCamTriggerEnable;
	        "bx2109-Trigger" := #arCognexInterface["cScannerBX2109"].xOutCamTrigger;
	        "bx2109-ResultsAck" := #arCognexInterface["cScannerBX2109"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO262.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO262.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1501".stJam1501_1.arCarrier[1]);
	        END_REGION ;
	        
	    END_REGION
	    
	    REGION TRO 263 (1Sep)
	        #TRO263.stInSeparator1.Settings.nSeparatorNo := "cSep263.1";
	        #TRO263.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO263.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO263.stInSeparator1.Settings.tHandlingTime := t#400ms;
	        #TRO263.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO263.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO263.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO263.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO263.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4522"];
	        #TRO263.stInSenJam2 := "DB_Inputs".Sensors["cInBG4514"];
	        
	        #TRO263.stInSeparator1.Settings.tSenFree := t#2000ms;
	        #TRO263.stInSeparator1.Settings.tSenWait := t#6000ms;
	        
	        REGION ZIEL FÜR BELADENE ANGEBEN
	            IF "DB_JamArea1501".stJam1501_2.arCarrier[1].bStatus.%X0 THEN
	                "DB_JamArea1501".stJam1501_2.arCarrier[1].nDestination := "cDestAMRLoaded";
	            END_IF;
	        END_REGION
	
	        
	        #TRO263(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO263.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO263.TroOut,
	                nInMainTroNo := "cMainTro263",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO263,
	                xInCarouselRun := #fbCarousel1110.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1501".stJam1501_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1501".stJam1501_2.stData,
	                arInOutJamExit2 := "DB_JamArea1110".stJam1110_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1110".stJam1110_3.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO263,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro263"],
	                xOutStopper1 => "MB4522");
	        
	    END_REGION
	    
	    REGION TRO 264 (Vario) + Scanner (BX2108)
	        
	        REGION Übernahme von Level 2
	            "FB_I-Device_Receive_J1401"(xInReq:="IO_Device_UH03_FROM_UH01".bCARRIER_CONTROL.%X0,
	                                     stInData:="IO_Device_UH03_FROM_UH01".stCARRIER_INFO[1],
	                                     xInOutAck:="IO_Device_UH02_TO_UH01".bCARRIER_CONTROL.%X0);
	            
	            IF "FB_I-Device_Receive_J1401".xOutNewData THEN //1 Zyklus vom Baustein
	                //Daten von UH03 in UH02 Jam schieben
	                "FC_TSHR_AddAtEnd"(stInTrolley := "FB_I-Device_Receive_J1401".stOutData,
	                                   nOutCounter => #tmpTSHRCounter,
	                                   xOutResult => #tmpTSHRResult,
	                                   arTSHR := "DB_JamArea1401".stJam1401_1.arCarrier);
	            END_IF;
	        END_REGION
	        
	        #TRO264.stInSeparator1.Settings.nSeparatorNo := "cSep264.1";
	        #TRO264.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO264.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO264.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO264.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO264.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO264.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO264.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO264.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4460"];
	        
	        #TRO264.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO264.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO264.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4462"]; //Finger in Pos
	        #TRO264.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4461"]; // MT in Pos
	        #TRO264.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4446"]; // Conveyor full
	        #TRO264.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4447"]; // Jam detector
	        
	        #TRO264.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO264.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO264.stInVario.Settings.tConvEmpty := T#8000ms;
	        #TRO264.stInVario.Settings.nCountCarrier := 1;
	        #TRO264.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO264.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO264.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2108"].xInCamTriggerReady := "bx2108-TriggerReady";
	        #arCognexInterface["cScannerBX2108"].xInCamTriggerAck := "bx2108-TriggerAck";
	        #arCognexInterface["cScannerBX2108"].xInCamResultsAvailable := "bx2108-Results Available";
	        #arCognexInterface["cScannerBX2108"].xInCamGeneralFault := "bx2108-General Fault";
	        #arCognexInterface["cScannerBX2108"].hwInCamInspectionResults := "=A01+UH02-BX2108~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO264.stInPriorityManager.xReleaseOk := TRUE; //braucht keine Vorfahrtsregelung
	        
	        #TRO264(nInMainTroNo := "cMainTro264",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0071",
	                xInRelease := "DB_TRO_Test".#TRO264,
	                arInOutJamEntr := "DB_JamArea1401".stJam1401_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1401".stJam1401_1.stData,
	                arInOutJamFinger := "DB_JamArea1401".stJam1401_2.arCarrier,
	                stInOutJamFinger := "DB_JamArea1401".stJam1401_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2108"],
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO264,
	                xOutStopper => "MB4460",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro264"],
	                xOutVarioMotor => "MA0071");
	        
	        "bx2108-TriggerEnable" := #arCognexInterface["cScannerBX2108"].xOutCamTriggerEnable;
	        "bx2108-Trigger" := #arCognexInterface["cScannerBX2108"].xOutCamTrigger;
	        "bx2108-ResultsAck" := #arCognexInterface["cScannerBX2108"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO264.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO264.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1401".stJam1401_1.arCarrier[1]);
	        END_REGION ;
	        
	    END_REGION
	    
	    
	    REGION TRO 265 (1Sep)
	        #TRO265.stInSeparator1.Settings.nSeparatorNo := "cSep265.1";
	        #TRO265.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO265.stInSeparator1.Settings.tHandlingTime := t#400ms;
	        #TRO265.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO265.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO265.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO265.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO265.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO265.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4445"];
	        #TRO265.stInSenJam2 := "DB_Inputs".Sensors["cInBG4443"];
	        
	        #TRO265.stInSeparator1.Settings.tSenFree := t#1200ms;
	        #TRO265.stInSeparator1.Settings.tSenWait := t#4300ms;
	        
	        #TRO265(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO265.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO265.TroOut,
	                nInMainTroNo := "cMainTro265",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO265,
	                xInCarouselRun := #fbCarousel1110.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1401".stJam1401_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1401".stJam1401_2.stData,
	                arInOutJamExit2 := "DB_JamArea1110".stJam1110_4.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1110".stJam1110_4.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO265,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro265"],
	                xOutStopper1 => "MB4445");
	        
	    END_REGION
	    
	    REGION TRO 266(1Sep)
	        #TRO266.stInSeparator1.Settings.nSeparatorNo := "cSep266.1";
	        #TRO266.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO266.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO266.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO266.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO266.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO266.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4451"];
	        #TRO266.stInSenJam2 := "DB_Inputs".Sensors["cInBG4453"];
	        
	        #TRO266(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO266.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO266.TroOut,
	                nInMainTroNo := "cMainTro266",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO266,
	                xInCarouselRun := #fbCarousel1110.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1110".stJam1110_3.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1110".stJam1110_3.stData,
	                arInOutJamExit2 := "DB_JamArea1110".stJam1110_4.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1110".stJam1110_4.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO266,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro266"],
	                xOutStopper1 => "MB4451");
	        
	    END_REGION
	    
	    REGION TRO 267 (1Sep2Switch)+Scanner(BX2100) 
	        #TRO267.stInSeparator1.Settings.nSeparatorNo := "cSep267.1";
	        #TRO267.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO267.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO267.stInSeparator1.Settings.xPluggedPart := TRUE;
	        #TRO267.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO267.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4440"];
	        #TRO267.stInSeparator1.stSenPart := "DB_Inputs".Sensors["cInBG4465"];
	        #TRO267.stInSenJam2 := "DB_Inputs".Sensors["cInBG4444"];
	        #TRO267.stInSenJam3 := "DB_Inputs".Sensors["cInBG4455"];
	        #TRO267.stInSenJam4 := "DB_Inputs".Sensors["cInBG4454"];
	        
	        #TRO267.stInSwitch1.Settings.nSwitchNo := "cSwi267.1";
	        #TRO267.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO267.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO267.stInSwitch1.Settings.xNewSwitch := TRUE;
	        #TRO267.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	     //   #TRO267.stInSwitch2.Settings.nSwitchNo := "cSwi267.2"; todo
	        #TRO267.stInSwitch2.Settings.xPluggedExSen3 := FALSE;
	        #TRO267.stInSwitch2.Settings.xPluggedExSen4 := FALSE;
	        #TRO267.stInSwitch2.Settings.xNewSwitch := TRUE;
	        #TRO267.stInSwitch2.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO267.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO267.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2100"].xInCamTriggerReady := "bx2100-TriggerReady";
	        #arCognexInterface["cScannerBX2100"].xInCamTriggerAck := "bx2100-TriggerAck";
	        #arCognexInterface["cScannerBX2100"].xInCamResultsAvailable := "bx2100-Results Available";
	        #arCognexInterface["cScannerBX2100"].xInCamGeneralFault := "bx2100-General Fault";
	        #arCognexInterface["cScannerBX2100"].hwInCamInspectionResults := "=A01+UC021-BX2100~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO267.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #stJamDataHandoverJam5000.Config.nCapacitySet := 1;
	        #stJamDataHandoverJam5001.Config.nCapacitySet := 1;
	        
	        #TRO267.stInSettings.bSepType.%X2 := TRUE;
	        
	        REGION !!!NUR PROVISORISCH!!!
	            // Statement section REGION
	       //     "DB_JamArea1110".stJam1110_4.arCarrier[1].nDestination := "cDestF2HLoaded";//"cDestAMRLoaded";//"cDestInboundEmpty";//"cDestF2HEmpty";//2;
	        END_REGION ;
	        
	        #TRO267(nInMainTroNo := "cMainTro267",
	                xInSftyOk := "cTodoTRUE",
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO267,
	                xInCarouselRun1 := #fbCarousel1110.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbCarousel1110.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2100"],
	                arInOutJamEntr1 := "DB_JamArea1110".stJam1110_4.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1110".stJam1110_4.stData,
	                arInOutJamExit2 := #arCarrierHandoverJam5001,
	                stInOutJamExit2 := #stJamDataHandoverJam5001,
	                arInOutJamExit3 := #arCarrierHandoverJam5000,
	                stInOutJamExit3 := #stJamDataHandoverJam5000,
	                arInOutJamExit4 := "DB_JamArea1110".stJam1110_5.arCarrier,
	                stInOutJamExit4 := "DB_JamArea1110".stJam1110_5.stData,
	                xOutStopper1 => "MB4440",
	                xOutSw1ExTo3 => "MB4444",
	                xOutSw2ExTo3 => "MB4455",
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO267);
	        
	        "bx2100-TriggerEnable" := #arCognexInterface["cScannerBX2100"].xOutCamTriggerEnable;
	        "bx2100-Trigger" := #arCognexInterface["cScannerBX2100"].xOutCamTrigger;
	        "bx2100-ResultsAck" := #arCognexInterface["cScannerBX2100"].xOutCamResultsAck;
	        
	        IF #TRO267.xOutNewScan THEN
	            "FC_Send_GOHDReqM"(sInPLCID := "cPLCID",
	                               xInSSCCReq := FALSE,
	                               xInLengthReq := FALSE,
	                               xInDockDoorReq := FALSE,
	                               xInLaneStatusReq := FALSE,
	                               nInBarcode := "DB_JamArea1110".stJam1110_4.arCarrier[1].nBarcode,
	                               sInSSCC := '',//#TRO110.fbBarcodeReaderSSCC.sOutBarcode,//DELETE(IN := LINT_TO_STRING(#TRO110.nOutScanResultSSCC), L := 1, P := 1),
	                               sInDecisionPoint := 'GOH.Route.01',//"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;
	        
	        
	        
	        REGION Kontrolle
	            (* IF #TRO267.nState = 1400 THEN
	                IF #TRO267.xTrolleyWithPart (* AND "DB_JamArea1110".stJam1110_4.arCarrier[1].nDestination = "cDestLeaveAmr" *) THEN
	                   // "DB_JamArea1110".stJam1110_4.arCarrier[1].bStatus.%X1 := TRUE;
	                    "DB_JamArea1110".stJam1110_4.arCarrier[1].nDestination := 0;
	                ELSIF #TRO267.xTrolleyWoPart THEN
	                   // "DB_JamArea1110".stJam1110_4.arCarrier[1].bStatus.%X1 := FALSE;
	                    "DB_JamArea1110".stJam1110_4.arCarrier[1].nDestination := 0;
	                END_IF;
	            END_IF; *)
	        END_REGION
	
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO267.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO267.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1110".stJam1110_4.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi267.1",
	                           nOutDirection => #TRO267.nInDirection,
	                           InOutCarrier := "DB_JamArea1110".stJam1110_4.arCarrier[1]);
	            
	        END_REGION
	        
	        REGION Send DUM to Fortna WCS
	(*            IF #TRO267.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 268 (1Sep2Switch)+Scanner(BX2101) // TODO
	        #TRO268.stInSeparator1.Settings.nSeparatorNo := "cSep270.1";
	        #TRO268.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO268.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO268.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO268.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO268.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4500"];
	        #TRO268.stInSenJam2 := "DB_Inputs".Sensors["cInBG4532"];
	        #TRO268.stInSenJam3 := "DB_Inputs".Sensors["cInBG4534"];
	        #TRO268.stInSenJam4 := "DB_Inputs".Sensors["cInBG4504"];
	        
	        #TRO268.stInSwitch1.Settings.nSwitchNo := "cSwi268.1";
	        #TRO268.stInSwitch1.Settings.xPluggedExSen3 := FALSE;
	        #TRO268.stInSwitch1.Settings.xPluggedExSen4 := FALSE;
	        #TRO268.stInSwitch1.Settings.xNewSwitch := TRUE;
	        #TRO268.stInSwitch1.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	       // #TRO268.stInSwitch2.Settings.nSwitchNo := "cSwi268.2"; todo
	        #TRO268.stInSwitch2.Settings.xPluggedExSen3 := FALSE;
	        #TRO268.stInSwitch2.Settings.xPluggedExSen4 := FALSE;
	        #TRO268.stInSwitch2.Settings.xNewSwitch := TRUE;
	        #TRO268.stInSwitch2.Settings.nTo1Destinations := 3; //Info nötig für HMI
	        
	        #TRO268.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO268.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2101"].xInCamTriggerReady := "bx2101-TriggerReady";
	        #arCognexInterface["cScannerBX2101"].xInCamTriggerAck := "bx2101-TriggerAck";
	        #arCognexInterface["cScannerBX2101"].xInCamResultsAvailable := "bx2101-Results Available";
	        #arCognexInterface["cScannerBX2101"].xInCamGeneralFault := "bx2101-General Fault";
	        #arCognexInterface["cScannerBX2101"].hwInCamInspectionResults := "=A01+UC021-BX2101~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO268.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #stJamDataHandoverJam4701.Config.nCapacitySet := 1;
	        #stJamDataHandoverJam1801.Config.nCapacitySet := 1;
	        
	        REGION nur füt test
	        //    "DB_JamArea1110".stJam1110_6.arCarrier[1].nDestination := 4; // 4=empty, 1=loaded, 0=kreisen, 3=F2H
	            
	        END_REGION
	        
	        #TRO268(nInMainTroNo := "cMainTro268",
	                xInSftyOk := "cTodoTRUE",
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO268,
	                xInCarouselRun1 := #fbCarousel1110.xOutConveyorFullSpeed,
	                xInCarouselRun2 := #fbCarousel1110.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2101"],
	                arInOutJamEntr1 := "DB_JamArea1110".stJam1110_6.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1110".stJam1110_6.stData,
	                arInOutJamExit2 := #arCarrierHandoverJam4701, //"DB_JamArea4701".stJam4701_1.arCarrier,
	                stInOutJamExit2 := #stJamDataHandoverJam4701, //"DB_JamArea4701".stJam4701_1.stData,
	                arInOutJamExit3 := #arCarrierHandoverJam1801, //"DB_JamArea1801".stJam1801_1.arCarrier,
	                stInOutJamExit3 := #stJamDataHandoverJam1801, //"DB_JamArea1801".stJam1801_1.stData,
	                arInOutJamExit4 := "DB_JamArea1110".stJam1110_1.arCarrier,
	                stInOutJamExit4 := "DB_JamArea1110".stJam1110_1.stData,
	                xOutStopper1 => "MB4500",
	                xOutSw1ExTo3 => "MB4503",
	                xOutSw2ExTo3 => "MB4504",
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO268);
	        
	        
	        "bx2101-TriggerEnable" := #arCognexInterface["cScannerBX2101"].xOutCamTriggerEnable;
	        "bx2101-Trigger" := #arCognexInterface["cScannerBX2101"].xOutCamTrigger;
	        "bx2101-ResultsAck" := #arCognexInterface["cScannerBX2101"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO268.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO268.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1110".stJam1110_6.arCarrier[1]);
	        END_REGION ;
	        
	        REGION Direction
	            "FC_Direction"(nInSwitchNo := "cSwi268.1",
	                           nOutDirection => #TRO268.nInDirection,
	                           InOutCarrier := "DB_JamArea1110".stJam1110_6.arCarrier[1]);
	            
	        END_REGION
	        
	        IF #TRO268.xOutNewScan THEN
	            "FC_Send_GOHDReqM"(sInPLCID := "cPLCID",
	                               xInSSCCReq := FALSE,
	                               xInLengthReq := FALSE,
	                               xInDockDoorReq := FALSE,
	                               xInLaneStatusReq := FALSE,
	                               nInBarcode := "DB_JamArea1110".stJam1110_6.arCarrier[1].nBarcode,
	                               sInSSCC := '',//#TRO110.fbBarcodeReaderSSCC.sOutBarcode,//DELETE(IN := LINT_TO_STRING(#TRO110.nOutScanResultSSCC), L := 1, P := 1),
	                               sInDecisionPoint := 'GOH.Route.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
	    
	    REGION TRO 269 (1Sep)+Scanner (BX2102)        
	        #TRO269.stInSeparator1.Settings.nSeparatorNo := "cSep269.1";
	        #TRO269.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO269.stInSeparator1.Settings.tTrailingTime := t#300ms;
	        #TRO269.stInSeparator1.Settings.tHandlingTime := t#0ms;
	        #TRO269.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO269.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO269.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO269.stInSeparator1.Settings.xPluggedScanner := TRUE;
	        #TRO269.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4505"];
	        #TRO269.stInSenJam2 := "DB_Inputs".Sensors["cInBG4507"];
	        
	        #TRO269.stInBarcodeReader.Settings.xActivateCheckASCI := TRUE;
	        #TRO269.stInBarcodeReader.Settings.tTimeout := T#5s;
	        
	        #arCognexInterface["cScannerBX2102"].xInCamTriggerReady := "bx2102-TriggerReady";
	        #arCognexInterface["cScannerBX2102"].xInCamTriggerAck := "bx2102-TriggerAck";
	        #arCognexInterface["cScannerBX2102"].xInCamResultsAvailable := "bx2102-Results Available";
	        #arCognexInterface["cScannerBX2102"].xInCamGeneralFault := "bx2102-General Fault";
	        #arCognexInterface["cScannerBX2102"].hwInCamInspectionResults := "=A01+UH02-BX2102~Ergebnisse_–_64_Bytes_1";
	        
	        #TRO269(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO269.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO269.TroOut,
	                nInMainTroNo := "cMainTro269",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO269,
	                xInCarouselRun := #fbCarousel1110.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #arCognexInterface["cScannerBX2102"],
	                arInOutJamEntr1 := "DB_JamArea1110".stJam1110_1.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1110".stJam1110_1.stData,
	                arInOutJamExit2 := "DB_JamArea1110".stJam1110_2.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1110".stJam1110_2.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO269,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro269"],
	                xOutStopper1 => "MB4505");
	        
	        "bx2102-TriggerEnable" := #arCognexInterface["cScannerBX2102"].xOutCamTriggerEnable;
	        "bx2102-Trigger" := #arCognexInterface["cScannerBX2102"].xOutCamTrigger;
	        "bx2102-ResultsAck" := #arCognexInterface["cScannerBX2102"].xOutCamResultsAck;
	        
	        REGION CARR_GLOB_CORRECTION
	            "FC_CARR_GLOB_CORRECTION"(xInStart := #TRO269.xOutCorrection, //Führe Korrektur aus
	                                      nInBarcodeScan := #TRO269.nBarcodeResult,
	                                      nInStation := 1,
	                                      arOutEventLogInfo => #arDummyEventCorrectionInfo,
	                                      InOutCarrierExpect := "DB_JamArea1110".stJam1110_1.arCarrier[1]);
	        END_REGION
	        
	        
	    END_REGION
	    
	    REGION TRO 270 (Vario)
	        
	        #TRO270.stInSeparator1.Settings.nSeparatorNo := "cSep270.1";
	        #TRO270.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO270.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO270.stInSeparator1.Settings.tHandlingTime := t#400ms;
	        #TRO270.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO270.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO270.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO270.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO270.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4530"];
	        
	        #TRO270.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO270.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO270.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4531"]; //Finger in Pos
	        #TRO270.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4533"]; // mT in Pos
	        #TRO270.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4553"]; // Conveyor full
	        #TRO270.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4554"]; // Jam detector
	        
	        #TRO270.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO270.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO270.stInVario.Settings.tConvEmpty := T#45000ms;
	        #TRO270.stInVario.Settings.nCountCarrier := 1;
	        #TRO270.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO270.stInVario.Settings.tRasterHigh := t#5s;
	        #TRO270.stInVario.Settings.tRasterLow := t#5s;
	        
	        #TRO270.stInVario.Settings.xJamSenDelayActive := true;
	        #TRO270.stInVario.Settings.tJamSenDelay := t#1s;
	        
	        #TRO270.stInVario.Settings.tCarrierInPosDelay := t#1200ms;
	        #TRO270.stInVario.Settings.tCarrierInPosEdgeDelay := t#100ms;
	        
	        #TRO270.stInVario.Settings.xLongSlope := TRUE;
	        
	        #TRO270.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #stJamDataHandoverJam4701_2.Config.nCapacitySet := 1;
	        
	        #TRO270.stInSettings.xIsBorner := TRUE;
	        
	        #TRO270(nInMainTroNo := "cMainTro270",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0074",
	                xInRelease := "DB_TRO_Test".TRO270,
	                arInOutJamEntr := "DB_JamArea4701".stJam4701_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea4701".stJam4701_1.stData,
	                arInOutJamFinger := #arCarrierHandoverJam4701_2, //"DB_JamArea4701".stJam4701_2.arCarrier,
	                stInOutJamFinger := #stJamDataHandoverJam4701_2, //"DB_JamArea4701".stJam4701_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO270,
	                xOutStopper => "MB4530",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro270"],
	                xOutVarioMotor => "MA0074");
	        
	        
	        
	    END_REGION
	    
	    REGION TRO 271 (1Sep)
	      (*  #TRO271.stInSeparator1.Settings.nSeparatorNo := "cSep271.1";
	        #TRO271.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO271.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO271.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO271.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO271.stInSeparator1.Settings.xPluggedJam := true;
	        #TRO271.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO271.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO271.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4555"];
	        #TRO271.stInSenJam2 := "DB_Inputs".Sensors["cInBG4546"];
	        
	        #TRO271.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO271.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO271.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #stJamDataHandoverJam4301.Config.nCapacitySet := 1; //
	        
	        #TRO271(nInMainTroNo := "cMainTro271",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInCarouselRun := TRUE,
	                xInRelease := true,
	                // "IO_Device_UH03_FROM_UH01".bCARRIER_CONTROL.%X3 AND //Ready von UH03
	                // NOT "IO_Device_UH03_FROM_UH01".bCARRIER_CONTROL.%X4 AND  //Busy von UH03
	                // NOT "IO_Device_UH02_TO_UH01".bCARRIER_CONTROL.%X3, //Release aktiv
	                stInOutMachineState := #stInOutControlUnitCabinet,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea4701".stJam4701_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea4701".stJam4701_2.stData,
	                arInOutJamExit2 := #arCarrierHandoverJam4301,//Jam Übergabe zu Highway Empty
	                stInOutJamExit2 := #stJamDataHandoverJam4301,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO271,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro271"],
	                xOutStopper1 => "MB4555"); *)
	        
	        "MB4555" := "IO_Device_UH03_FROM_UH01".xJAM_3;
	        
	        
	        REGION UH02 <-> UH03
	            
	            (* #fTrig_TRO271_TRO306(CLK := "IO_Device_UH03_FROM_UH01".bCARRIER_CONTROL.%X4);
	            
	            IF #TRO271.nState = 2500 AND #TRO271.fbSeparator1.xOutTrolleyReleasedEdge THEN
	                "IO_Device_UH02_TO_UH01".bCARRIER_CONTROL.%X3 := TRUE; //Release von UH02 zu UH03
	            ELSIF #fTrig_TRO271_TRO306.Q THEN
	                "IO_Device_UH02_TO_UH01".bCARRIER_CONTROL.%X3 := FALSE; //Release von UH02 zu UH03
	            END_IF; *)
	        END_REGION
	       
	    END_REGION
	    
	    REGION TRO 272 (Vario)
	        
	        #TRO272.stInSeparator1.Settings.nSeparatorNo := "cSep272.1";
	        #TRO272.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO272.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO272.stInSeparator1.Settings.tHandlingTime := t#400ms;
	        #TRO272.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO272.stInSeparator1.Settings.xPluggedJam := FALSE;
	        #TRO272.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO272.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO272.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4535"];
	        
	        #TRO272.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO272.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO272.stInVario.stSenFinger := "DB_Inputs".Sensors["cInBG4536"]; //Finger in Pos
	        #TRO272.stInVario.stSenCarrInPos := "DB_Inputs".Sensors["cInBG4537"]; // MT in Pos
	        #TRO272.stInVario.stSenLastPos := "DB_Inputs".Sensors["cInBG4550"]; // Conveyor full
	        #TRO272.stInVario.stSenJam := "DB_Inputs".Sensors["cInBG4551"]; // Jam detector
	        
	        #TRO272.stInVario.Settings.xContinousEmptying := FALSE;
	        #TRO272.stInVario.Settings.tWaitForJog := T#400ms;
	        #TRO272.stInVario.Settings.tConvEmpty := T#30000ms;
	        #TRO272.stInVario.Settings.nCountCarrier := 1;
	        #TRO272.stInVario.Settings.tWaitForStop := T#3s;
	        
	        #TRO272.stInVario.Settings.tRasterHigh := t#5s;
	        #TRO272.stInVario.Settings.tRasterLow := t#5s;
	        
	        #TRO272.stInVario.Settings.xJamSenDelayActive := true;
	        #TRO272.stInVario.Settings.tJamSenDelay := t#1s;
	        
	        #TRO272.stInVario.Settings.tCarrierInPosDelay := t#1200ms;
	        #TRO272.stInVario.Settings.tCarrierInPosEdgeDelay := t#100ms;
	        
	        #TRO272.stInVario.Settings.xLongSlope := TRUE;
	        
	        #TRO272.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #stJamDataHandoverJam1801_2.Config.nCapacitySet := 1;
	        
	        #TRO272.stInSettings.xIsBorner := TRUE;
	        #TRO272(nInMainTroNo := "cMainTro272",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInAutomatic := #t_Automatik_OF1,
	                xInReset := "cTodoFalse",
	                xInMotorProtection := "FC0076",
	                xInRelease := "DB_TRO_Test".TRO272,
	                arInOutJamEntr := "DB_JamArea1801".stJam1801_1.arCarrier,
	                stInOutJamEntr := "DB_JamArea1801".stJam1801_1.stData,
	                arInOutJamFinger := #arCarrierHandoverJam1801_2,//"DB_JamArea1801".stJam1801_2.arCarrier,
	                stInOutJamFinger := #stJamDataHandoverJam1801_2,//"DB_JamArea1801".stJam1801_2.stData,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO272,
	                xOutStopper => "MB4535",
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro272"],
	                xOutVarioMotor => "MA0076");
	        
	    END_REGION
	    
	    REGION TRO 273 (1Sep)
	  (*   #TRO273.stInSeparator1.Settings.nSeparatorNo := "cSep273.1";
	        #TRO273.stInSeparator1.Settings.tTrailingTime := "cTimeSepTrailing";
	        #TRO273.stInSeparator1.Settings.tHandlingTime := T#400ms;
	        #TRO273.stInSeparator1.Settings.tDelayToNextItem := "TimeForSepWaiting_Short";
	        #TRO273.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO273.stInSeparator1.Settings.xPluggedJam := TRUE; //FALSE;
	        #TRO273.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO273.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO273.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4552"];
	        #TRO273.stInSenJam2 := "DB_Inputs".Sensors["cInBG4547"];
	        
	        #TRO273.stInSeparator1.Settings.tSenFree := T#1200ms;
	        #TRO273.stInSeparator1.Settings.tSenWait := T#4300ms;
	        
	        #TRO273.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #stJamDataHandoverJam4401.Config.nCapacitySet := 1; //
	        
	        #TRO273(nInMainTroNo := "cMainTro273",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInCarouselRun := TRUE,
	                xInRelease := true,
	                // "IO_Device_UH03_FROM_UH01".bCARRIER_CONTROL.%X5 AND //Ready von UH03
	                // NOT "IO_Device_UH03_FROM_UH01".bCARRIER_CONTROL.%X6 AND  //Busy von UH03
	                // NOT "IO_Device_UH02_TO_UH01".bCARRIER_CONTROL.%X4, //Release aktiv
	                stInOutMachineState := #stInOutControlUnitCabinet,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1801".stJam1801_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1801".stJam1801_2.stData,
	                arInOutJamExit2 := #arCarrierHandoverJam4401,//Jam Übergabe zu Highway Loaded
	                stInOutJamExit2 := #stJamDataHandoverJam4401,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO273,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro273"],
	                xOutStopper1 => "MB4552"); *)
	        
	        "MB4552" := "IO_Device_UH03_FROM_UH01".xJAM_2; 
	        
	        REGION UH02 <-> UH03
	            
	            // #fTrig_TRO273_TRO307(CLK := "IO_Device_UH03_FROM_UH01".bCARRIER_CONTROL.%X6); //flanke Busy
	            
	            // IF #TRO273.nState = 2500 AND #TRO273.fbSeparator1.xOutTrolleyReleasedEdge THEN //Release von TRO
	            //     "IO_Device_UH02_TO_UH01".bCARRIER_CONTROL.%X4 := TRUE; //Release von UH02 zu UH03
	            // ELSIF #fTrig_TRO273_TRO307.Q THEN //Busy fällt ab
	            //     "IO_Device_UH02_TO_UH01".bCARRIER_CONTROL.%X4 := FALSE; //Release von UH02 zu UH03
	            // END_IF;
	        END_REGION
	        
	    END_REGION
	    
	    REGION TRO 274 (1Sep)
	        #TRO274.stInSeparator1.Settings.nSeparatorNo := "cSep274.1";
	        #TRO274.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO274.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO274.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO274.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO274.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO274.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4512"];
	        #TRO274.stInSenJam2 := "DB_Inputs".Sensors["cInBG4514"];
	        
	        #TRO274(stInPriorityManager := "DB_Prozessdaten".stPriorityManager.udt_TRO274.TroIn,
	                stOutPriorityManager => "DB_Prozessdaten".stPriorityManager.udt_TRO274.TroOut,
	                nInMainTroNo := "cMainTro274",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO274,
	                xInCarouselRun := #fbCarousel1110.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1110".stJam1110_2.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1110".stJam1110_2.stData,
	                arInOutJamExit2 := "DB_JamArea1110".stJam1110_3.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1110".stJam1110_3.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO274,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro274"],
	                xOutStopper1 => "MB4512");
	        
	    END_REGION
	    
	    REGION TRO 275 (1Sep)
	        #TRO275.stInSeparator1.Settings.nSeparatorNo := "cSep275.1";
	        #TRO275.stInSeparator1.Settings.tDelayToNextItem :=  "TimeForSepWaiting_Medium";
	        #TRO275.stInSeparator1.Settings.tJam := "TimeForSepJam";
	        #TRO275.stInSeparator1.Settings.xPluggedJam := TRUE;
	        #TRO275.stInSeparator1.Settings.xPluggedPart := FALSE;
	        #TRO275.stInSeparator1.Settings.xPluggedScanner := FALSE;
	        #TRO275.stInSeparator1.stSenInSep := "DB_Inputs".Sensors["cInBG4456"];
	        #TRO275.stInSenJam2 := "DB_Inputs".Sensors["cInBG4457"];
	        
	        #TRO275.stInPriorityManager.xReleaseOk := TRUE; // braucht keine Vorfahrtsregelung
	        
	        #TRO275(nInMainTroNo := "cMainTro275",
	                xInSftyOk := "DB_InterfaceSafety".stFromSafety.EStopMainOF1.Q,
	                xInAllRdyToStart := TRUE,
	                xInCancel := "cTodoFalse",
	                xInRelease := "DB_TRO_Test".TRO275,
	                xInCarouselRun := #fbCarousel1110.xOutConveyorFullSpeed,
	                stInOutMachineState := #stInOutControlUnitCabinetOF1,
	                stInOutCognexInterface := #stCognexInterfaceDummy,
	                arInOutJamEntr1 := "DB_JamArea1110".stJam1110_5.arCarrier,
	                stInOutJamEntr1 := "DB_JamArea1110".stJam1110_5.stData,
	                arInOutJamExit2 := "DB_JamArea1110".stJam1110_6.arCarrier,
	                stInOutJamExit2 := "DB_JamArea1110".stJam1110_6.stData,
	                stInOutHMI := "DB_Interface_HMI".stTRO.TRO275,
	                nOutStateLast => "DB_GLOB_TroState".arTroState["cMainTro275"],
	                xOutStopper1 => "MB4456");
	        
	    END_REGION
	    
	END_REGION
	
	REGION TCP Communication
	    "FB_CommunicationWCSBL_DB"(fbInOutSendFIFO := "DB_LGF_FIFO_CommWCSBL",
	                               arFifoSendBuffer := "DB_Buffer_CommunicationWCSBL".BUFFER);
	    
	      "FB_CommunicationWES_ASRS_DB"(fbInOutSendFIFO := "DB_LGF_FIFO_CommWES_ASRS",
	                                   arFifoSendBuffer := "DB_Buffer_CommunicationWES_ASRS".BUFFER); 
	END_REGION
	
	REGION StorageManagement
	    "FB_StorageManagementCall_DB"();
	END_REGION
	
	// "DB_JamArea1102".stJam1102_1.arCarrier[1].nDestination := "cDest11100";
	// //"DB_JamArea1102".stJam1102_1.arCarrier[1].bStatus.%X5 := TRUE;
	 "DB_JamArea1202".stJam1202_1.arCarrier[1].nDestination := 12400;
END_FUNCTION_BLOCK

