FUNCTION "FC_Get_LaneStatus" : String
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
   VAR_IN_OUT 
      stInOutJamData : "stJamData";   // Staubereichs info
      stInOutWorkStation : "UDT_Workstation";   // Workstation info
   END_VAR


BEGIN
	IF #stInOutWorkStation.nCountTotal >= #stInOutJamData.Config.nCapacitySet OR //voll 
	  //  (#stInOutWorkStation.nActivationStatus = 0) OR auch berücksichtigen?!
	    #stInOutJamData.Status.nCount >= #stInOutJamData.Config.nCapacitySet OR //voll
	    #stInOutJamData.Status.bByte.%X1 OR //Stau
	    #stInOutJamData.Status.bByte.%X2 OR //Einfahrt gesperrt
	    #stInOutJamData.Status.bByte.%X4 // Error
	THEN
	    #FC_Get_LaneStatus := '0';
	ELSE
	    #FC_Get_LaneStatus := '1';
	END_IF;
END_FUNCTION

