FUNCTION_BLOCK FB 100
VAR_INPUT
VALUE : REAL ; // Measured value per time interval
INTERVAL : TIME ; // Time interval unit of measurement
CYCLE : TIME ; // Sampling time
COM_RST : BOOL ; // Clear accumulated total
END_VAR
VAR_OUTPUT
TOTAL : REAL ; // Accumulated total value
END_VAR
VAR
ACCUM : REAL ; // Accumulated total value (static storage)
END_VAR
VAR_TEMP
tINTERVAL : REAL ; // Temp. time INTERVAL in REAL format
tCYCLE : REAL ; // Temp. CYCLE time in REAL format
END_VAR
BEGIN
NETWORK
TITLE =check for a complete reset
u #COM_RST;错误
spbn nw2;错误
L 0.000000e+000;
T #ACCUM;
T #TOTAL;
SET ;
SAVE ;
BEa ; 错误
NETWORK
TITLE =convert INTERVAL and CYCLE to REAL numbers
nw2: NOP 0;
L #INTERVAL;
DTR ;
T #tINTERVAL;
L #CYCLE;
DTR ;
T #tCYCLE;
NETWORK
TITLE =add incremental value to accumulated and total values
L #VALUE;
L #tCYCLE;
*R ;
L #tINTERVAL;
/R ;
// now that incremental value is calculated,
// add this to the accumulated value
// and send it to the output TOTAL
L #ACCUM;
+R ;
T #ACCUM;
T #TOTAL;
NETWORK
TITLE =exit
SET ;
SAVE ;
Bea ; 错误
END_FUNCTION_BLOCK
上面有四个错误,编译通不过,不知道要怎么改?但是下装时却能用?