FUNCTION "FC_Call_Jams" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
   VAR_TEMP 
      nIdx : Int;
   END_VAR


BEGIN
	REGION HyperJam
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikHyperJam"],
	             arInOutJamCarrier := "DB_HyperJam".stHyperJam.arCarrier,
	             stInOutData := "DB_HyperJam".stHyperJam.stData);
	    
	    "DB_Statistics".nJamCount := "DB_HyperJam".stHyperJam.stData.Status.nCount;
	END_REGION
	
	REGION JamArea0100
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam0100_1"],
	             arInOutJamCarrier := "DB_JamArea0100".stJam0100_1.arCarrier,
	             stInOutData := "DB_JamArea0100".stJam0100_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0100".stJam0100_1.stData.Status.nCount;
	END_REGION
	
	REGION JamArea0101   
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam0101_1"],
	             arInOutJamCarrier := "DB_JamArea0101".stJam0101_1.arCarrier,
	             stInOutData := "DB_JamArea0101".stJam0101_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0101".stJam0101_1.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam0101_2"],
	             arInOutJamCarrier := "DB_JamArea0101".stJam0101_2.arCarrier,
	             stInOutData := "DB_JamArea0101".stJam0101_2.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0101".stJam0101_2.stData.Status.nCount;
	END_REGION
	
	REGION JamArea0102
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam0102_1"],
	             arInOutJamCarrier := "DB_JamArea0102".stJam0102_1.arCarrier,
	             stInOutData := "DB_JamArea0102".stJam0102_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0102".stJam0102_1.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam0102_2"],
	             arInOutJamCarrier := "DB_JamArea0102".stJam0102_2.arCarrier,
	             stInOutData := "DB_JamArea0102".stJam0102_2.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0102".stJam0102_2.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam0102_3"],
	             arInOutJamCarrier := "DB_JamArea0102".stJam0102_3.arCarrier,
	             stInOutData := "DB_JamArea0102".stJam0102_3.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0102".stJam0102_3.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam0102_4"],
	             arInOutJamCarrier := "DB_JamArea0102".stJam0102_4.arCarrier,
	             stInOutData := "DB_JamArea0102".stJam0102_4.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0102".stJam0102_4.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam0102_5"],
	             arInOutJamCarrier := "DB_JamArea0102".stJam0102_5.arCarrier,
	             stInOutData := "DB_JamArea0102".stJam0102_5.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0102".stJam0102_5.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam0102_6"],
	             arInOutJamCarrier := "DB_JamArea0102".stJam0102_6.arCarrier,
	             stInOutData := "DB_JamArea0102".stJam0102_6.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0102".stJam0102_6.stData.Status.nCount;
	    
	END_REGION
	
	REGION JamArea0103
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam0103_1"],
	             arInOutJamCarrier := "DB_JamArea0103".stJam0103_1.arCarrier,
	             stInOutData := "DB_JamArea0103".stJam0103_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0103".stJam0103_1.stData.Status.nCount;
	END_REGION
	
	REGION JamArea0104
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam0104_1"],
	             arInOutJamCarrier := "DB_JamArea0104".stJam0104_1.arCarrier,
	             stInOutData := "DB_JamArea0104".stJam0104_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0104".stJam0104_1.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam0104_2"],
	             arInOutJamCarrier := "DB_JamArea0104".stJam0104_2.arCarrier,
	             stInOutData := "DB_JamArea0104".stJam0104_2.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0104".stJam0104_2.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam0104_3"],
	             arInOutJamCarrier := "DB_JamArea0104".stJam0104_3.arCarrier,
	             stInOutData := "DB_JamArea0104".stJam0104_3.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0104".stJam0104_3.stData.Status.nCount;
	    
	END_REGION
	
	REGION JamArea0106
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam0106_1"],
	             arInOutJamCarrier := "DB_JamArea0106".stJam0106_1.arCarrier,
	             stInOutData := "DB_JamArea0106".stJam0106_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0106".stJam0106_1.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam0106_2"],
	             arInOutJamCarrier := "DB_JamArea0106".stJam0106_2.arCarrier,
	             stInOutData := "DB_JamArea0106".stJam0106_2.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0106".stJam0106_2.stData.Status.nCount;
	    
	END_REGION
	
	REGION JamArea0107
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam0107_1"],
	             arInOutJamCarrier := "DB_JamArea0107".stJam0107_1.arCarrier,
	             stInOutData := "DB_JamArea0107".stJam0107_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0107".stJam0107_1.stData.Status.nCount;
	    
	END_REGION
	
	REGION JamArea0108
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam0108_1"],
	             arInOutJamCarrier := "DB_JamArea0108".stJam0108_1.arCarrier,
	             stInOutData := "DB_JamArea0108".stJam0108_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0108".stJam0108_1.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam0108_2"],
	             arInOutJamCarrier := "DB_JamArea0108".stJam0108_2.arCarrier,
	             stInOutData := "DB_JamArea0108".stJam0108_2.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0108".stJam0108_2.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam0108_3"],
	             arInOutJamCarrier := "DB_JamArea0108".stJam0108_3.arCarrier,
	             stInOutData := "DB_JamArea0108".stJam0108_3.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0108".stJam0108_3.stData.Status.nCount;
	    
	END_REGION
	
	REGION JamArea0110
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam0110_1"],
	             arInOutJamCarrier := "DB_JamArea0110".stJam0110_1.arCarrier,
	             stInOutData := "DB_JamArea0110".stJam0110_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0110".stJam0110_1.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam0110_2"],
	             arInOutJamCarrier := "DB_JamArea0110".stJam0110_2.arCarrier,
	             stInOutData := "DB_JamArea0110".stJam0110_2.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea0110".stJam0110_2.stData.Status.nCount;
	    
	END_REGION
	
	REGION JamArea4103
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam4103_1"],
	             arInOutJamCarrier := "DB_JamArea4103".stJam4103_1.arCarrier,
	             stInOutData := "DB_JamArea4103".stJam4103_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4103".stJam4103_1.stData.Status.nCount;
	    
	    // "FC_Jam"(arInOutJamCarrier := "DB_JamArea4103".stJam4103_2.arCarrier,
	    //          stInOutData := "DB_JamArea4103".stJam4103_2.stData);
	END_REGION
	
	REGION JamArea4104
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam4104_1"],
	             arInOutJamCarrier := "DB_JamArea4104".stJam4104_1.arCarrier,
	             stInOutData := "DB_JamArea4104".stJam4104_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4104".stJam4104_1.stData.Status.nCount;
	    
	END_REGION
	
	REGION JamArea4203
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam4203_1"],
	             arInOutJamCarrier := "DB_JamArea4203".stJam4203_1.arCarrier,
	             stInOutData := "DB_JamArea4203".stJam4203_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4203".stJam4203_1.stData.Status.nCount;
	END_REGION
	
	REGION JamArea4204
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam4204_1"],
	             arInOutJamCarrier := "DB_JamArea4204".stJam4204_1.arCarrier,
	             stInOutData := "DB_JamArea4204".stJam4204_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4204".stJam4204_1.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam4204_2"],
	             arInOutJamCarrier := "DB_JamArea4204".stJam4204_2.arCarrier,
	             stInOutData := "DB_JamArea4204".stJam4204_2.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4204".stJam4204_2.stData.Status.nCount;
	    
	END_REGION
	
	REGION JamArea4302
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam4302_1"],
	             arInOutJamCarrier := "DB_JamArea4302".stJam4302_1.arCarrier,
	             stInOutData := "DB_JamArea4302".stJam4302_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4302".stJam4302_1.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam4302_2"],
	             arInOutJamCarrier := "DB_JamArea4302".stJam4302_2.arCarrier,
	             stInOutData := "DB_JamArea4302".stJam4302_2.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4302".stJam4302_2.stData.Status.nCount;
	    
	END_REGION
	
	REGION JamArea4402
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam4402_1"],
	             arInOutJamCarrier := "DB_JamArea4402".stJam4402_1.arCarrier,
	             stInOutData := "DB_JamArea4402".stJam4402_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4402".stJam4402_1.stData.Status.nCount;
	    
	END_REGION
	
	REGION JamArea4403
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam4403_1"],
	             arInOutJamCarrier := "DB_JamArea4403".stJam4403_1.arCarrier,
	             stInOutData := "DB_JamArea4403".stJam4403_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4403".stJam4403_1.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam4403_2"],
	             arInOutJamCarrier := "DB_JamArea4403".stJam4403_2.arCarrier,
	             stInOutData := "DB_JamArea4403".stJam4403_2.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4403".stJam4403_2.stData.Status.nCount;
	    
	END_REGION
	
	REGION JamArea4501
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam4501_1"],
	             arInOutJamCarrier := "DB_JamArea4501".stJam4501_1.arCarrier,
	             stInOutData := "DB_JamArea4501".stJam4501_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4501".stJam4501_1.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam4501_2"],
	             arInOutJamCarrier := "DB_JamArea4501".stJam4501_2.arCarrier,
	             stInOutData := "DB_JamArea4501".stJam4501_2.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4501".stJam4501_2.stData.Status.nCount;
	    
	END_REGION
	
	REGION JamArea4502
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam4502_1"],
	             arInOutJamCarrier := "DB_JamArea4502".stJam4502_1.arCarrier,
	             stInOutData := "DB_JamArea4502".stJam4502_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4502".stJam4502_1.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam4502_2"],
	             arInOutJamCarrier := "DB_JamArea4502".stJam4502_2.arCarrier,
	             stInOutData := "DB_JamArea4502".stJam4502_2.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4502".stJam4502_2.stData.Status.nCount;
	    
	END_REGION
	
	REGION JamArea4503
	    "FC_Jam"(stOutCarrierStatsStandard=>"DB_Statistics".arJamStatisticsStandard["cStatistikJam4503_1"],
	             arInOutJamCarrier := "DB_JamArea4503".stJam4503_1.arCarrier,
	             stInOutData := "DB_JamArea4503".stJam4503_1.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4503".stJam4503_1.stData.Status.nCount;
	    
	    "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam4503_2"],
	             arInOutJamCarrier := "DB_JamArea4503".stJam4503_2.arCarrier,
	             stInOutData := "DB_JamArea4503".stJam4503_2.stData);
	    
	    "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea4503".stJam4503_2.stData.Status.nCount;
	    
	END_REGION
	
	    REGION Auswertung
	        REGION Leere Carrier
	            "DB_Statistics".nEmptyCarrierCount := 0;
	            FOR #nIdx := 0 TO "cNoStatistikJam" DO
	                "DB_Statistics".nEmptyCarrierCount := "DB_Statistics".nEmptyCarrierCount + "DB_Statistics".arJamStatisticsStandard[#nIdx].nEmptyCarrier;
	            END_FOR;
	            
	        END_REGION
	        
	        REGION Beladene Carrier
	            "DB_Statistics".nLoadedCarrierCount := 0;
	            FOR #nIdx := 0 TO "cNoStatistikJam" DO
	                "DB_Statistics".nLoadedCarrierCount := "DB_Statistics".nLoadedCarrierCount + "DB_Statistics".arJamStatisticsStandard[#nIdx].nLoadedCarrier;
	            END_FOR;
	        END_REGION
	        
	        REGION Dummy
	            "DB_Statistics".nDummyCount := 0;
	            FOR #nIdx := 0 TO "cNoStatistikJam" DO
	                "DB_Statistics".nDummyCount := "DB_Statistics".nDummyCount + "DB_Statistics".arJamStatisticsStandard[#nIdx].nDummyCarrier;
	            END_FOR;
	        END_REGION
	        
	    END_REGION
	    
	    REGION HMI
	        "DB_Interface_HMI".stStatistics.nJamCount := "DB_Statistics".nJamCount;
	        "DB_Interface_HMI".stStatistics.nLoadedCount := "DB_Statistics".nLoadedCarrierCount;
	        "DB_Interface_HMI".stStatistics.nEmptyCount := "DB_Statistics".nEmptyCarrierCount + "DB_Statistics".nStorageCount; //In diesem Fall sind im Storage nur Leercarrier!
	        "DB_Interface_HMI".stStatistics.nDummyCount := "DB_Statistics".nDummyCount;
	        
	        "DB_Interface_HMI".stStatistics.nStorageCount101 := "DB_Statistics".nStorageCount101;
	        "DB_Interface_HMI".stStatistics.nStorageCount102 := "DB_Statistics".nStorageCount102;
	        "DB_Interface_HMI".stStatistics.nStorageTotalCount := "DB_Statistics".nStorageCount;
	        
	        "DB_Interface_HMI".stStatistics.nTotalCount := "DB_Statistics".nJamCount + "DB_Statistics".nStorageCount;
	        
	    END_REGION
	    
END_FUNCTION

