FUNCTION_BLOCK "FB_PriorityLogic"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
   VAR 
      fbPrioTRO404_TRO417 { S7_SetPoint := 'False'} : "Fb_PriorityManagerV2";
      fbPrioTRO407_TRO409 : "Fb_PriorityManagerV2";
      fbPrioTRO410_TRO412 : "Fb_PriorityManagerV2";
      fbPrioTRO413_TRO415 : "Fb_PriorityManagerV2";
   END_VAR

   VAR_TEMP 
      todo : "udt_InterruptParameter";
   END_VAR


BEGIN
	REGION Priority-Manager 
	    REGION Kreuzung TRO404/TRO417
	        #fbPrioTRO404_TRO417(xInQuit := "cTodoFalse",
	                             tIn_ReleaseTime1 := T#45s,
	                             tIn_ReleaseTime2 := t#15s,
	                             xInClearJam := FALSE,
	                             udtIn_Source1Req := "DB_Prozessdaten".stPriorityManager.udt_TRO404.TroOut,
	                             udtIn_Source2Req := "DB_Prozessdaten".stPriorityManager.udt_TRO417.TroOut,
	                             udtOut_Source1Resp => "DB_Prozessdaten".stPriorityManager.udt_TRO404.TroIn,
	                             udtOut_Source2Resp => "DB_Prozessdaten".stPriorityManager.udt_TRO417.TroIn,
	                             udt_PrioParameter := "DB_Prozessdaten".stPriorityParameter.udt_TRO404_TRO417,
	                             udt_InterruptParameter := #todo);
	    END_REGION
	    
	    REGION Kreuzung TRO407/TRO409
	        #fbPrioTRO407_TRO409(xInQuit := "cTodoFalse",
	                             tIn_ReleaseTime1 := T#10s,
	                             tIn_ReleaseTime2 := t#10s,
	                             xInClearJam := FALSE,
	                             udtIn_Source1Req := "DB_Prozessdaten".stPriorityManager.udt_TRO409.TroOut,
	                             udtIn_Source2Req := "DB_Prozessdaten".stPriorityManager.udt_TRO407.TroOut,
	                             udtOut_Source1Resp => "DB_Prozessdaten".stPriorityManager.udt_TRO409.TroIn,
	                             udtOut_Source2Resp => "DB_Prozessdaten".stPriorityManager.udt_TRO407.TroIn,
	                             udt_PrioParameter := "DB_Prozessdaten".stPriorityParameter.udt_TRO407_TRO409,
	                             udt_InterruptParameter := #todo);
	    END_REGION
	    
	    
	    REGION Kreuzung TRO410/TRO412
	        #fbPrioTRO410_TRO412(xInQuit := "cTodoFalse",
	                             tIn_ReleaseTime1 := T#10s,
	                             tIn_ReleaseTime2 := t#10s,
	                             xInClearJam := FALSE,
	                             udtIn_Source1Req := "DB_Prozessdaten".stPriorityManager.udt_TRO412.TroOut,
	                             udtIn_Source2Req := "DB_Prozessdaten".stPriorityManager.udt_TRO410.TroOut,
	                             udtOut_Source1Resp => "DB_Prozessdaten".stPriorityManager.udt_TRO412.TroIn,
	                             udtOut_Source2Resp => "DB_Prozessdaten".stPriorityManager.udt_TRO410.TroIn,
	                             udt_PrioParameter := "DB_Prozessdaten".stPriorityParameter.udt_TRO410_TRO412,
	                             udt_InterruptParameter := #todo);
	    END_REGION
	    
	    REGION Kreuzung TRO413/TRO415
	        #fbPrioTRO413_TRO415(xInQuit := "cTodoFalse",
	                             tIn_ReleaseTime1 := T#10s,
	                             tIn_ReleaseTime2 := t#10s,
	                             xInClearJam := FALSE,
	                             udtIn_Source1Req := "DB_Prozessdaten".stPriorityManager.udt_TRO415.TroOut,
	                             udtIn_Source2Req := "DB_Prozessdaten".stPriorityManager.udt_TRO413.TroOut,
	                             udtOut_Source1Resp => "DB_Prozessdaten".stPriorityManager.udt_TRO415.TroIn,
	                             udtOut_Source2Resp => "DB_Prozessdaten".stPriorityManager.udt_TRO413.TroIn,
	                             udt_PrioParameter := "DB_Prozessdaten".stPriorityParameter.udt_TRO413_TRO415,
	                             udt_InterruptParameter := #todo);
	    END_REGION
	END_REGION ;
END_FUNCTION_BLOCK

