You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

96 lines
1.7 KiB

FUNCTION_BLOCK IJ_EVC
VAR_EXTERNAL
END_VAR
VAR_INPUT
RUN : BOOL ; (* PID功能块启用 *)
SET : REAL ; (* *)
FB : REAL ; (* *)
Dead_Band : REAL :=0.5 ; (* *)
Delay : TIME :=t#30s;(* *)
SW : INT ; (* 0夏季 1冬季 2过渡 *)
END_VAR
VAR_OUTPUT
EVC : BOOL ; (* *)
END_VAR
VAR
ton1 : TON ;
ton2 : TON ;
END_VAR
(*
20191003
1.0
/
/
湿
RUN : BOOL ; PID功能块启用
SET : REAL ; 调节目标值
FB : REAL ; 调节目标值的反馈值
Dead_Band : REAL ; 死区,0.5
Delay : TIME ; 延时时间,30S
SW : INT ; 季节模式 0夏季 1冬季
EVC : BOOL ; 电磁阀/
*)
(*
FB>SET EVC:=1
FB-(SET+D)>=0 EVC:=1
FB-(SET-D)<0 EVC:=0
冬季SET>FB EVC:=1
(SET-D)-FB>=0 EVC:=1
(SET+D)-FB<0 EVC:=0
*)
ton1(pt:=Delay);
ton2(pt:=Delay);
if RUN =1 then
if SW=0 then
if FB-SET>=0.0 then
ton1.in:=1;
else
ton1.in:=0;
end_if;
if ton1.q=1 then
EVC:=1;
end_if;
if FB-(SET-Dead_Band)<0.0 then
ton2.in:=1;
else
ton2.in:=0;
end_if;
if ton2.q=1 then
EVC:=0;
end_if;
else
if SET-FB>=0.0 then
ton1.in:=1;
else
ton1.in:=0;
end_if;
if ton1.q=1 then
EVC:=1;
end_if;
if (SET+Dead_Band)-FB<0.0 then
ton2.in:=1;
else
ton2.in:=0;
end_if;
if ton2.q=1 then
EVC:=0;
end_if;
end_if;
end_if;
END_FUNCTION_BLOCK