FUNCTION "FC_GetStationIndex" : Int
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
   VAR_INPUT 
      nInStation : Int;
   END_VAR

   VAR CONSTANT 
      c011Workstation11 : USInt := 11;   // Workstation 1.1
      c010Workstation1 : USInt := 10;   // Workstation 1.0
      c020Workstation2 : USInt := 20;   // Workstation 2.0
      c030Workstation3 : USInt := 30;   // Workstation 3.0
      c040Workstation4 : USInt := 40;   // Workstation 4.0
      c011Wo : Bool;
   END_VAR


BEGIN
	CASE #nInStation OF
	    #c011Workstation11:
	        #FC_GetStationIndex := 0;
	    #c010Workstation1:
	        #FC_GetStationIndex := 1;
	    #c020Workstation2:
	        #FC_GetStationIndex := 2;
	    #c030Workstation3:
	        #FC_GetStationIndex := 3;
	    #c040Workstation4:
	        #FC_GetStationIndex := 4;
	    ELSE
	        #FC_GetStationIndex := 99;
	END_CASE;
END_FUNCTION

