Files

32 lines
970 B
Smalltalk
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(*
===============================================================================
Project : PLC_Library
Device : -
Path : Общие
Name : Status_SU_Connect
Type : FUNCTION_BLOCK
===============================================================================
*)
FUNCTION_BLOCK Status_SU_Connect
(*
Статус связи с СВУ по серцебиению
*)
VAR_INPUT
HeartBit: BOOL; (* Сигнал "сердцебиения" от СВУ *)
T_Pulse: TIME; (* Максимально допустимая длительность одного состояния HeartBit *)
END_VAR
VAR_OUTPUT
ERROR_CONNECT: BOOL; (* Флаг ошибки связи: HeartBit не меняется дольше T_Pulse *)
END_VAR
VAR
TON_SU_1: TON;
TON_SU_2: TON;
END_VAR
(*----- IMPLEMENTATION -----*)
TON_SU_1(IN:=HeartBit, PT:=T_Pulse);
TON_SU_2(IN:=NOT HeartBit, PT:=T_Pulse);
ERROR_CONNECT:=TON_SU_1.Q OR TON_SU_2.Q;
END_FUNCTION_BLOCK