图片:
图片:
这段功能块FB谁能帮忙解释功能作用
IN_PLS_UP :=IN_ENCODER AND NOT SYS_STATUS;
IN_PLS_DOWN := NOT IN_ENCODER AND SYS_STATUS;
SYS_STATUS := IN_ENCODER;
IF AVG_CYCLE < IN_AVG_CYCLE THEN;
IF IN_PLS_UP = TRUE THEN;
AVG_CYCLE := AVG_CYCLE+1;
END_IF;
END_IF;
IF AVG_CYCLE >= IN_AVG_CYCLE THEN;
VALUE1 := VALUE;
VALUE := 0;
AVG_CYCLE := 0;
END_IF;
SYS_PLS := P_0_1s AND NOT STATUS;
STATUS := P_0_1s;
IF AVG_CYCLE < IN_AVG_CYCLE THEN;
IF SYS_PLS = TRUE THEN;
VALUE := VALUE+1;
END_IF;
END_IF;
REAL_TOTAL_CYCLE := INT_TO_REAL (IN_TOTAL_CYCLE);
REAL_VALUE1 := INT_TO_REAL (VALUE1);
REAL_AVG_CYCLE := INT_TO_REAL (IN_AVG_CYCLE);
IF VALUE1 > 0 AND AVG_CYCLE >= (IN_AVG_CYCLE - 1) THEN;
REAL_VALUE2 := (REAL_TOTAL_CYCLE * 100.0) / ((REAL_TOTAL_CYCLE / REAL_AVG_CYCLE) * REAL_VALUE1);
RPM := REAL_TO_INT (REAL_VALUE2);
END_IF;
[ 此帖被sunnykmc在2019-03-18 16:18重新编辑 ]