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.
 
 
 
 
 
 

111 lines
2.9 KiB

FUNCTION_BLOCK IJ_EAF
VAR_EXTERNAL
END_VAR
VAR_INPUT
EAF_STRUCT_IN :EAF_IN;
END_VAR
VAR_OUTPUT
EAF_STRUCT_OUT :EAF_OUT;
END_VAR
VAR
EAF_RunTime :BS_Runtime;
EAF_DevC :BS_DevC;
EAF_WVCTEMP :REAL;
RunTon1 :TON;
RunTof1 :TOF;
DevCheck1_time :TIME :=t#15s; (**)
Status0 :INT;
Status1 :INT;
END_VAR
(*
20200220
1.0
EAF_STRUCT_IN.
CM :BOOL; 运行模式 0手动 1联动
Run :BOOL; 运行状态
Auto :BOOL; 自动状态
Fault :BOOL; 故障状态
Control :BOOL; 程序控制
COSET :REAL; CO设定
COES :REAL; 车库CO值
ISO1 :BOOL; 运行故障反馈隔离
RST :BOOL; 运行时间累计重置
RSTV :REAL; 运行时间累计重置值
EAF_STRUCT_OUT.
Control :BOOL; 启停控制
RH :REAL; 运行小时
SN :INT ; 设备状态代码
1.,
2./
3.
BS_Runtime;
BS_DevC;
*)
(************************************************************************************************************)
RunTon1( IN:=EAF_STRUCT_IN.Control , PT:=DevCheck1_time);
RunTof1( IN:=EAF_STRUCT_IN.Control , PT:=DevCheck1_time);
(*Status0*);
if EAF_STRUCT_IN.ISO1=0 then
if RunTon1.q or not RunTof1.q then
if EAF_STRUCT_OUT.Control<>EAF_STRUCT_IN.Run then
Status0:=1;
else
Status0:=0;
end_if;
if EAF_STRUCT_IN.Fault=1 then
Status1:=1;
else
Status1:=0;
end_if;
end_if;
else
Status0:=0;
Status1:=0;
end_if;
(**)
if EAF_STRUCT_OUT.Control<>0 then
EAF_STRUCT_OUT.SN := Status0*1 + Status1*4 ;
else
EAF_STRUCT_OUT.SN := 0 ;
end_if;
(************************************************************************************************************)
if EAF_STRUCT_IN.CM=0 then
if EAF_STRUCT_IN.Control=1 then
EAF_STRUCT_OUT.Control:=1;
else EAF_STRUCT_OUT.Control:=0;
end_if;
end_if;
(************************************************************************************************************)
if EAF_STRUCT_IN.CM=1 then
EAF_DevC(RUN :=EAF_STRUCT_IN.CM , SET :=EAF_STRUCT_IN.COSET , FB :=EAF_STRUCT_IN.COES , DEAD_BAND :=10.0 , DELAY :=t#20s | EAF_STRUCT_OUT.Control:= DevC);
end_if;
(************************************************************************************************************)
EAF_RunTime(RUN :=EAF_STRUCT_IN.Run , RUNTIMESET :=EAF_STRUCT_IN.RSTV , RUNTIMERST :=EAF_STRUCT_IN.RST | EAF_STRUCT_OUT.RH:= RUNTIME);
END_FUNCTION_BLOCK