diff -r 169d552a345c -r 7a09e12267a9 pous.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pous.xml Thu Jun 14 15:24:12 2012 +0200 @@ -0,0 +1,551 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100.0 then + RH := 100.0; + end_if; + DEW_POINT:=sqrt(sqrt(sqrt(RH/100.0)))*(112.0+(0.9*TEMP))+(0.1*TEMP)-112.0;]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +,WORD1,__GetRetainData(__GET_VAR(data__->READ),__GET_VAR(data__->INDEX),0)); +__SET_VAR(data__->,WORD2,__GetRetainData(__GET_VAR(data__->READ),__GET_VAR(data__->INDEX),1)); +__SET_VAR(data__->,WORD3,__GetRetainData(__GET_VAR(data__->READ),__GET_VAR(data__->INDEX),2)); +__SET_VAR(data__->,RD_OK,__GetReadStatus(0)); +}]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +,WR_OK,__SetRetainData(__GET_VAR(data__->WRITE),__GET_VAR(data__->INDEX),__GET_VAR(data__->WORD1),__GET_VAR(data__->WORD2),__GET_VAR(data__->WORD3))); +}]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +,FOUND,__FindRetainData(__GET_VAR(data__->SEARCH),__GET_VAR(data__->START_IDX),__GET_VAR(data__->END_IDX),__GET_VAR(data__->WORD1),__GET_VAR(data__->WORD2),__GET_VAR(data__->WORD3))); +__SET_VAR(data__->,INDEX,__GetFoundIndex(0)); +}]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TON_1_Q, + ET => ET1 + ); +if TON_1_Q then + if REVERSE then + Error_n := SET_POINT - ACTUAL_VALUE; + else + Error_n := ACTUAL_VALUE - SET_POINT; + end_if; + if Td_FADEOUT <= T#0.05s then + Td_FADEOUT := t#0.05s; + end_if; + CTr := TIME_TO_REAL (CYCLE_TIME); + FTr := TIME_TO_REAL (Td_FADEOUT); + power := CTr / FTr; + D_Fadeout := EXPT( 0.04979 , power ); (*time to reach 5% = e^(-3) *) + Dout := Kd_GAIN * (Error_n - 2.0 * Error_n1 + Error_n2); + Dout_n := Dout + Dout_1 * D_Fadeout; + Dout_int := Dout_int + Dout_n; + OUTchk := OUTchk + Kp_GAIN * (Error_n - Error_n1) + Ki_GAIN * Error_n * CTr; + R_chk:= bool_to_int(REVERSE) + bool_to_int(Reverse_1); + if (Soft_t or R_chk=1) then + Dout_int := 0.0; + Dout_n := 0.0; + Dout_1:= 0.0; + Dout:= 0.0; + OUTchk:= OUT; + Error_n1:=Error_n; + Error_n2:=Error_n; + Soft_t := 0; + end_if; + if R_chk =1 then + Error_n:=0.0; + Soft_t := True; + end_if; + + if OUTchk > OUT_MAX then + OUTchk := OUT_MAX; + end_if; + + if OUTchk < OUT_MIN then + OUTchk := OUT_MIN; + end_if; + + if MANUAL then + OUT := MANUAL_REF; + OUTchk:= OUT; + Dout_int := 0.0; + Dout_n := 0.0; + Dout_1:= 0.0; + else + if abs(Error_n) < DEAD_BAND or HOLD then + OUT := OUT; + OUTchk:= OUT; + Dout_int := 0.0; + Dout_n := 0.0; + Dout_1:= 0.0; + else + OUT := OUTchk + Dout_int; + end_if; + end_if; + + if OUT > OUT_MAX then + OUT := OUT_MAX; + end_if; + + if OUT < OUT_MIN then + OUT := OUT_MIN; + end_if; + + Error_n2 := Error_n1; + Error_n1 := Error_n; + Dout_1:=Dout_n; + Reverse_1 := REVERSE; +else + OUT:=OUT; +end_if;]]> + + + + + + + + +