Obsidean_VM/04-SIDEL/06 - E5.007363 - Modifica O.../Source/source/FeedForward.md

583 B

FUNCTION "FeedForward" : Real
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : 'Function'
NAME : 'Name'
VERSION : 1.0
   VAR_INPUT 
      i_Flow : Real;   // Liquid Flow in l/min
      i_KFF : Real;   // Adjusting parameter
      i_Delta_P : Real;   // Delta Pressure: Friction Losses Across the Valve
   END_VAR


BEGIN
	
	
	(* classic code: IF #i_Delta_P > 0.0 THEN*)
	IF #i_Delta_P > REAL#0.0 THEN
	    #FeedForward := LIMIT (MN:=0, IN:= #i_Flow * #i_KFF / SQRT(#i_Delta_P), MX:= 100) ;
	  ELSE
	    #FeedForward := -1 ;
	END_IF;
	 
	
END_FUNCTION