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"],
	                 stOutCarrierStatsAdv=>"DB_Statistics".arJamStatisticsAdvanced["cStatistikHyperJam"],
	                 arInOutJamCarrier := "DB_HyperJam".stHyperJam.arCarrier,
	                 stInOutData := "DB_HyperJam".stHyperJam.stData);
	        
	        "DB_Statistics".nJamCount := "DB_HyperJam".stHyperJam.stData.Status.nCount;
	    END_REGION
	    
	    REGION JamArea5000
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5000_1"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5000_1"],
	                 arInOutJamCarrier := "DB_JamArea5000".stJam5000_1.arCarrier,
	                 stInOutData := "DB_JamArea5000".stJam5000_1.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5000".stJam5000_1.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5000_2"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5000_2"],
	                 arInOutJamCarrier := "DB_JamArea5000".stJam5000_2.arCarrier,
	                 stInOutData := "DB_JamArea5000".stJam5000_2.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5000".stJam5000_2.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5000_3"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5000_3"],
	                 arInOutJamCarrier := "DB_JamArea5000".stJam5000_3.arCarrier,
	                 stInOutData := "DB_JamArea5000".stJam5000_3.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5000".stJam5000_3.stData.Status.nCount;
	        
	        
	    END_REGION
	    
	    REGION JamArea5001        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5001_1"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5001_1"],
	                 arInOutJamCarrier := "DB_JamArea5001".stJam5001_1.arCarrier,
	                 stInOutData := "DB_JamArea5001".stJam5001_1.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5001".stJam5001_1.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5001_2"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5001_2"],
	                 arInOutJamCarrier := "DB_JamArea5001".stJam5001_2.arCarrier,
	                 stInOutData := "DB_JamArea5001".stJam5001_2.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5001".stJam5001_2.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5001_3"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5001_3"],
	                 arInOutJamCarrier := "DB_JamArea5001".stJam5001_3.arCarrier,
	                 stInOutData := "DB_JamArea5001".stJam5001_3.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5001".stJam5001_3.stData.Status.nCount;
	        
	    END_REGION
	    
	    REGION JamArea5002
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5002_1"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5002_1"],
	                 arInOutJamCarrier := "DB_JamArea5002".stJam5002_1.arCarrier,
	                 stInOutData := "DB_JamArea5002".stJam5002_1.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5002".stJam5002_1.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5002_2"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5002_2"],
	                 arInOutJamCarrier := "DB_JamArea5002".stJam5002_2.arCarrier,
	                 stInOutData := "DB_JamArea5002".stJam5002_2.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5002".stJam5002_2.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5002_3"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5002_3"],
	                 arInOutJamCarrier := "DB_JamArea5002".stJam5002_3.arCarrier,
	                 stInOutData := "DB_JamArea5002".stJam5002_3.stData);
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5002".stJam5002_3.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5002_4"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5002_4"],
	                 arInOutJamCarrier := "DB_JamArea5002".stJam5002_4.arCarrier,
	                 stInOutData := "DB_JamArea5002".stJam5002_4.stData);
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5002".stJam5002_4.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5002_5"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5002_5"],
	                 arInOutJamCarrier := "DB_JamArea5002".stJam5002_5.arCarrier,
	                 stInOutData := "DB_JamArea5002".stJam5002_5.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5002".stJam5002_5.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5002_6"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5002_6"],
	                 arInOutJamCarrier := "DB_JamArea5002".stJam5002_6.arCarrier,
	                 stInOutData := "DB_JamArea5002".stJam5002_6.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5002".stJam5002_6.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5002_7"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5002_7"],
	                 arInOutJamCarrier := "DB_JamArea5002".stJam5002_7.arCarrier,
	                 stInOutData := "DB_JamArea5002".stJam5002_7.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5002".stJam5002_7.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5002_8"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5002_8"],
	                 arInOutJamCarrier := "DB_JamArea5002".stJam5002_8.arCarrier,
	                 stInOutData := "DB_JamArea5002".stJam5002_8.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5002".stJam5002_8.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5002_9"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5002_9"],
	                 arInOutJamCarrier := "DB_JamArea5002".stJam5002_9.arCarrier,
	                 stInOutData := "DB_JamArea5002".stJam5002_9.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5002".stJam5002_9.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5002_10"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5002_10"],
	                 arInOutJamCarrier := "DB_JamArea5002".stJam5002_10.arCarrier,
	                 stInOutData := "DB_JamArea5002".stJam5002_10.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5002".stJam5002_10.stData.Status.nCount;
	    END_REGION
	    
	    REGION JamArea5003
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5003_1"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5003_1"],
	                 arInOutJamCarrier := "DB_JamArea5003".stJam5003_1.arCarrier,
	                 stInOutData := "DB_JamArea5003".stJam5003_1.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5003".stJam5003_1.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5003_2"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5003_2"],
	                 arInOutJamCarrier := "DB_JamArea5003".stJam5003_2.arCarrier,
	                 stInOutData := "DB_JamArea5003".stJam5003_2.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5003".stJam5003_2.stData.Status.nCount;
	        
	    END_REGION
	    
	    REGION JamArea5004
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5004_1"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5004_1"],
	                 arInOutJamCarrier := "DB_JamArea5004".stJam5004_1.arCarrier,
	                 stInOutData := "DB_JamArea5004".stJam5004_1.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5004".stJam5004_1.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5004_2"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5004_2"],
	                 arInOutJamCarrier := "DB_JamArea5004".stJam5004_2.arCarrier,
	                 stInOutData := "DB_JamArea5004".stJam5004_2.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5004".stJam5004_2.stData.Status.nCount;
	    END_REGION
	    
	    REGION JamArea5005
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5005_1"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5005_1"],
	                 arInOutJamCarrier := "DB_JamArea5005".stJam5005_1.arCarrier,
	                 stInOutData := "DB_JamArea5005".stJam5005_1.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5005".stJam5005_1.stData.Status.nCount;
	        
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5005_2"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5005_2"],
	                 arInOutJamCarrier := "DB_JamArea5005".stJam5005_2.arCarrier,
	                 stInOutData := "DB_JamArea5005".stJam5005_2.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5005".stJam5005_2.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5005_3"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5005_3"],
	                 arInOutJamCarrier := "DB_JamArea5005".stJam5005_3.arCarrier,
	                 stInOutData := "DB_JamArea5005".stJam5005_3.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5005".stJam5005_3.stData.Status.nCount;
	        
	    END_REGION
	    
	    REGION JamArea5006
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5006_1"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5006_1"],
	                 arInOutJamCarrier := "DB_JamArea5006".stJam5006_1.arCarrier,
	                 stInOutData := "DB_JamArea5006".stJam5006_1.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5006".stJam5006_1.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5006_2"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5006_2"],
	                 arInOutJamCarrier := "DB_JamArea5006".stJam5006_2.arCarrier,
	                 stInOutData := "DB_JamArea5006".stJam5006_2.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5006".stJam5006_2.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5006_3"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5006_3"],
	                 arInOutJamCarrier := "DB_JamArea5006".stJam5006_3.arCarrier,
	                 stInOutData := "DB_JamArea5006".stJam5006_3.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5006".stJam5006_3.stData.Status.nCount;
	    END_REGION
	    
	    REGION JamArea5007
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5007_1"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5007_1"],
	                 arInOutJamCarrier := "DB_JamArea5007".stJam5007_1.arCarrier,
	                 stInOutData := "DB_JamArea5007".stJam5007_1.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5007".stJam5007_1.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5007_2"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5007_2"],
	                 arInOutJamCarrier := "DB_JamArea5007".stJam5007_2.arCarrier,
	                 stInOutData := "DB_JamArea5007".stJam5007_2.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5007".stJam5007_2.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5007_3"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5007_3"],
	                 arInOutJamCarrier := "DB_JamArea5007".stJam5007_3.arCarrier,
	                 stInOutData := "DB_JamArea5007".stJam5007_3.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5007".stJam5007_3.stData.Status.nCount;
	        
	    END_REGION
	    
	    REGION JamArea5008
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5008_1"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5008_1"],
	                 arInOutJamCarrier := "DB_JamArea5008".stJam5008_1.arCarrier,
	                 stInOutData := "DB_JamArea5008".stJam5008_1.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5008".stJam5008_1.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5008_2"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5008_2"],
	                 arInOutJamCarrier := "DB_JamArea5008".stJam5008_2.arCarrier,
	                 stInOutData := "DB_JamArea5008".stJam5008_2.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5008".stJam5008_2.stData.Status.nCount;
	        
	        "FC_Jam"(stOutCarrierStatsStandard => "DB_Statistics".arJamStatisticsStandard["cStatistikJam5008_3"],
	                 stOutCarrierStatsAdv => "DB_Statistics".arJamStatisticsAdvanced["cStatistikJam5008_3"],
	                 arInOutJamCarrier := "DB_JamArea5008".stJam5008_3.arCarrier,
	                 stInOutData := "DB_JamArea5008".stJam5008_3.stData);
	        
	        "DB_Statistics".nJamCount := "DB_Statistics".nJamCount + "DB_JamArea5008".stJam5008_3.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
	        
	        REGION Advanced
	            //Info bei "RealCount" geht es um den Vorstau der Station, da wir diesen befüllen
	            
	            REGION Workstation 1.0
	                "DB_Statistics".stWorkstations.WS1_0.nRealCount := "DB_JamArea5005".stJam5005_1.stData.Status.nCount;
	                
	                "DB_Statistics".stWorkstations.WS1_0.nReservedCount := 0;
	                FOR #nIdx := 0 TO "cNoStatistikJam" DO
	                    IF (#nIdx <> "cStatistikJam5005_1") AND (#nIdx <> "cStatistikJam5005_2") AND (#nIdx <> "cStatistikJam5005_3") THEN //eigene Station nicht mitzählen...oder Destination bei Einfahrt in Station ändern, dann wäre es egal
	                        "DB_Statistics".stWorkstations.WS1_0.nReservedCount := "DB_Statistics".stWorkstations.WS1_0.nReservedCount + "DB_Statistics".arJamStatisticsAdvanced[#nIdx].nDestWS1_0;
	                    END_IF;
	                END_FOR;
	                
	                "DB_Statistics".stWorkstations.WS1_0.nTotalCount := "DB_Statistics".stWorkstations.WS1_0.nRealCount + "DB_Statistics".stWorkstations.WS1_0.nReservedCount;
	            END_REGION
	            
	            REGION Workstation 1.1
	                "DB_Statistics".stWorkstations.WS1_1.nRealCount := "DB_JamArea5003".stJam5003_1.stData.Status.nCount + "DB_JamArea5003".stJam5003_2.stData.Status.nCount; //beide?...
	                
	                "DB_Statistics".stWorkstations.WS1_1.nReservedCount := 0;
	                FOR #nIdx := 0 TO "cNoStatistikJam" DO
	                    IF (#nIdx <> "cStatistikJam5003_1") AND (#nIdx <> "cStatistikJam5003_2") AND (#nIdx <> "cStatistikJam5004_1") AND (#nIdx <> "cStatistikJam5004_2") THEN //eigene Station nicht mitzählen...oder Destination bei Einfahrt in Station ändern, dann wäre es egal
	                        "DB_Statistics".stWorkstations.WS1_1.nReservedCount := "DB_Statistics".stWorkstations.WS1_1.nReservedCount + "DB_Statistics".arJamStatisticsAdvanced[#nIdx].nDestWS1_1;
	                    END_IF;
	                END_FOR;
	                
	                "DB_Statistics".stWorkstations.WS1_1.nTotalCount := "DB_Statistics".stWorkstations.WS1_1.nRealCount + "DB_Statistics".stWorkstations.WS1_1.nReservedCount;
	            END_REGION
	            
	            REGION Workstation 2.0
	                "DB_Statistics".stWorkstations.WS2_0.nRealCount := "DB_JamArea5006".stJam5006_1.stData.Status.nCount;
	                
	                "DB_Statistics".stWorkstations.WS2_0.nReservedCount := 0;
	                FOR #nIdx := 0 TO "cNoStatistikJam" DO
	                    IF (#nIdx <> "cStatistikJam5006_1") AND (#nIdx <> "cStatistikJam5006_2") AND (#nIdx <> "cStatistikJam5006_3") THEN //eigene Station nicht mitzählen...oder Destination bei Einfahrt in Station ändern, dann wäre es egal
	                        "DB_Statistics".stWorkstations.WS2_0.nReservedCount := "DB_Statistics".stWorkstations.WS2_0.nReservedCount + "DB_Statistics".arJamStatisticsAdvanced[#nIdx].nDestWS2_0;
	                    END_IF;
	                END_FOR;
	                
	                "DB_Statistics".stWorkstations.WS2_0.nTotalCount := "DB_Statistics".stWorkstations.WS2_0.nRealCount + "DB_Statistics".stWorkstations.WS2_0.nReservedCount;
	            END_REGION
	            
	            REGION Workstation 3.0
	                "DB_Statistics".stWorkstations.WS3_0.nRealCount := "DB_JamArea5007".stJam5007_1.stData.Status.nCount;
	                
	                "DB_Statistics".stWorkstations.WS3_0.nReservedCount := 0;
	                FOR #nIdx := 0 TO "cNoStatistikJam" DO
	                    IF (#nIdx <> "cStatistikJam5007_1") AND (#nIdx <> "cStatistikJam5007_2") AND (#nIdx <> "cStatistikJam5007_3") THEN //eigene Station nicht mitzählen...oder Destination bei Einfahrt in Station ändern, dann wäre es egal
	                        "DB_Statistics".stWorkstations.WS3_0.nReservedCount := "DB_Statistics".stWorkstations.WS3_0.nReservedCount + "DB_Statistics".arJamStatisticsAdvanced[#nIdx].nDestWS3_0;
	                    END_IF;
	                END_FOR;
	                
	                "DB_Statistics".stWorkstations.WS3_0.nTotalCount := "DB_Statistics".stWorkstations.WS3_0.nRealCount + "DB_Statistics".stWorkstations.WS3_0.nReservedCount;
	            END_REGION
	            
	            REGION Workstation 4.0
	                "DB_Statistics".stWorkstations.WS4_0.nRealCount := "DB_JamArea5008".stJam5008_1.stData.Status.nCount;
	                
	                "DB_Statistics".stWorkstations.WS4_0.nReservedCount := 0;
	                FOR #nIdx := 0 TO "cNoStatistikJam" DO
	                    IF (#nIdx <> "cStatistikJam5008_1") AND (#nIdx <> "cStatistikJam5008_2") AND (#nIdx <> "cStatistikJam5008_3") THEN //eigene Station nicht mitzählen...oder Destination bei Einfahrt in Station ändern, dann wäre es egal
	                        "DB_Statistics".stWorkstations.WS4_0.nReservedCount := "DB_Statistics".stWorkstations.WS4_0.nReservedCount + "DB_Statistics".arJamStatisticsAdvanced[#nIdx].nDestWS4_0;
	                    END_IF;
	                END_FOR;
	                
	                "DB_Statistics".stWorkstations.WS4_0.nTotalCount := "DB_Statistics".stWorkstations.WS4_0.nRealCount + "DB_Statistics".stWorkstations.WS4_0.nReservedCount;
	            END_REGION
	
	        END_REGION
	        
	    END_REGION
	    
	    REGION Prozessdaten
	        "DB_Prozessdaten".stWorkStations.arWorkStations[1].nCountReal := UINT_TO_INT("DB_Statistics".stWorkstations.WS1_0.nRealCount);
	        "DB_Prozessdaten".stWorkStations.arWorkStations[1].nCountReserved := UINT_TO_INT("DB_Statistics".stWorkstations.WS1_0.nReservedCount);
	        "DB_Prozessdaten".stWorkStations.arWorkStations[1].nCountTotal := UINT_TO_INT("DB_Statistics".stWorkstations.WS1_0.nTotalCount);
	        
	        "DB_Prozessdaten".stWorkStations.arWorkStations[0].nCountReal := UINT_TO_INT("DB_Statistics".stWorkstations.WS1_1.nRealCount);
	        "DB_Prozessdaten".stWorkStations.arWorkStations[0].nCountReserved := UINT_TO_INT("DB_Statistics".stWorkstations.WS1_1.nReservedCount);
	        "DB_Prozessdaten".stWorkStations.arWorkStations[0].nCountTotal := UINT_TO_INT("DB_Statistics".stWorkstations.WS1_1.nTotalCount);
	        
	        "DB_Prozessdaten".stWorkStations.arWorkStations[2].nCountReal := UINT_TO_INT("DB_Statistics".stWorkstations.WS2_0.nRealCount);
	        "DB_Prozessdaten".stWorkStations.arWorkStations[2].nCountReserved := UINT_TO_INT("DB_Statistics".stWorkstations.WS2_0.nReservedCount);
	        "DB_Prozessdaten".stWorkStations.arWorkStations[2].nCountTotal := UINT_TO_INT("DB_Statistics".stWorkstations.WS2_0.nTotalCount);
	        
	        "DB_Prozessdaten".stWorkStations.arWorkStations[3].nCountReal := UINT_TO_INT("DB_Statistics".stWorkstations.WS3_0.nRealCount);
	        "DB_Prozessdaten".stWorkStations.arWorkStations[3].nCountReserved := UINT_TO_INT("DB_Statistics".stWorkstations.WS3_0.nReservedCount);
	        "DB_Prozessdaten".stWorkStations.arWorkStations[3].nCountTotal := UINT_TO_INT("DB_Statistics".stWorkstations.WS3_0.nTotalCount);
	        
	        "DB_Prozessdaten".stWorkStations.arWorkStations[4].nCountReal := UINT_TO_INT("DB_Statistics".stWorkstations.WS4_0.nRealCount);
	        "DB_Prozessdaten".stWorkStations.arWorkStations[4].nCountReserved := UINT_TO_INT("DB_Statistics".stWorkstations.WS4_0.nReservedCount);
	        "DB_Prozessdaten".stWorkStations.arWorkStations[4].nCountTotal := UINT_TO_INT("DB_Statistics".stWorkstations.WS4_0.nTotalCount);
	    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_Interface_HMI".stStatistics.nDummyCount := "DB_Statistics".nDummyCount;
	        
	    END_REGION
END_FUNCTION

