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.
 
 
 
 
 
 

78 lines
1.2 KiB

FUNCTION_BLOCK BS_FEC
VAR_EXTERNAL
END_VAR
VAR_INPUT
RUN : BOOL ; (* PID功能块启用 *)
SET : REAL ; (* *)
FB : REAL ; (* *)
Dead_Band : REAL :=10.0 ; (* *)
Delay : TIME :=t#300s;(* *)
END_VAR
VAR_OUTPUT
DevC : BOOL ; (* *)
END_VAR
VAR
ton1 : TON ;
ton2 : TON ;
END_VAR
(*
20200220
1.0
RUN : BOOL ; PID功能块启用
SET : REAL ; 调节目标值
FB : REAL ; 调节目标值的反馈值
Dead_Band : REAL ; 死区,10
Delay : TIME ; 延时时间,300S
DevC : BOOL ; 设备控制输出
*)
(*
FB>SET DevC:=1
FB-(SET-D)<0 DevC:=0
*)
ton1(pt:=Delay);
ton2(pt:=Delay);
if RUN =1 then
if FB-SET>=0.0 then
DevC:=1;
ton1.in:=1;
else
ton1.in:=0;
end_if;
if ton1.q=1 then
DevC:=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
DevC:=0;
end_if;
end_if;
END_FUNCTION_BLOCK