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.
 
 
 
 
 
 

97 lines
1.4 KiB

FUNCTION_BLOCK BS_DevHeart
VAR_EXTERNAL
END_VAR
VAR_INPUT
END_VAR
VAR_OUTPUT
HeartVavle :int;
END_VAR
VAR
ton1 :ton;
END_VAR
(*Automatically declared*)
VAR_EXTERNAL
END_VAR
(** **)
(** {* **)
(** **)
(** 时 间:20191003 **)
(** 版 本:1.0 **)
(** 作 者:姚立 **)
(** 名 称:设备心跳存活程序 **)
(** 说 明:用于判断设备是否存活的心跳程序 **)
(** 备 注: **)
(** 依赖块:无 **)
(** **)
(** *} **)
(** **)
(** {* **)
(** **)
(** Output_Type 输出 **)
(** 心跳数据0-99 **)
(** **)
(** *} **)
(** ton1(pt:=t#2s); **)
(* call - Stmt *)
CAL ton1 (
pt := t#2s
)
(** ton1.in:=not ton1.q; **)
(* assign - Stmt *)
LD ton1.q
NOT
ST ton1.in
(** if ton1.q=1 then **)
(* if - Cond *)
LD ton1.q
EQ 1
JMPCN ODK_SKIP_000000000000001_000000000000001
(* then - Stmts *)
(** HeartVavle :=HeartVavle+1; **)
(* assign - Stmt *)
LD HeartVavle
ADD 1
ST HeartVavle
JMP ODK_END_IF_000000000000001
(** end_if; **)
(* if - End *)
ODK_SKIP_000000000000001_000000000000001:
ODK_END_IF_000000000000001:
(** if HeartVavle =99 then **)
(* if - Cond *)
LD HeartVavle
EQ 99
JMPCN ODK_SKIP_000000000000002_000000000000001
(* then - Stmts *)
(** HeartVavle:=0; **)
(* assign - Stmt *)
LD 0
ST HeartVavle
JMP ODK_END_IF_000000000000002
(** end_if; **)
(* if - End *)
ODK_SKIP_000000000000002_000000000000001:
ODK_END_IF_000000000000002:
(** **)
(** **)
(** **)
END_FUNCTION_BLOCK