浮点数四舍五入算法
FUNCTION FC_REAL_DEAL : LREAL
VAR_INPUT
In_lreal: LREAL;
In_usint: USINT;
END_VAR
In_usint:=LIMIT(0,In_usint,5); (*精确到小数点后面第几位*)
FC_REAL_DEAL:=LREAL_TO_DINT(In_lreal*EXPT(10,In_usint) )/EXPT(10,In_usint);
TC2_real_deal.pro
TC3_REAL_DEAL.tnzip