KEEP

用作带有置位和复位输入的继电器

KEEP用作带有置位和复位点的触发器。

SetTrigger变为TRUE时,指定的标志变为TRUE且保持其状态。当ResetTrigger变为TRUE时,标志变为FALSE。无论SetTrigger的状态为TRUE还是FALSE,都会保持标志的TRUE状态,直到ResetTrigger变为TRUE。如果SetTriggerResetTrigger同时变为TRUE,则ResetTrigger具有优先级。

参数

输入

Set Trigger (BOOL)

Address变为TRUE

Reset Trigger (BOOL)

Address变为FALSE

输出

Address (BOOL)

此标志的状态(TRUEFALSE)保持不变。

示例

POU头

所有用于编程此函数的输入和输出变量已在POU头中声明。 所有编程语言使用相同的POU头。

	VAR
		SetTrigger1: BOOL:=FALSE;
			(*if SetTrigger1 is ON, the output  Address1 will turn ON*)
		ResetTrigger1: BOOL:=FALSE;
			(*if reset_trigger is ON, the
Address1 will turn OFF*)
		Address1: BOOL:=FALSE;
	END_VAR

LD本体

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 5 ;
        NETWORK_BODY
B(B_F,KEEP!,Instance,13,1,23,5,,?DSetTrigger?DResetTrigger?CAddress);
B(B_VAROUT,,Address1,23,2,25,4,);
B(B_CONTACT,,ResetTrigger1,5,3,7,5,);
B(B_CONTACT,,SetTrigger1,5,1,7,3,);
L(1,4,5,4);
L(1,2,5,2);
L(7,2,12,2);
L(12,2,12,3);
L(7,4,13,4);
L(12,3,13,3);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST本体

Address1:=KEEP(SetTrigger1, ResetTrigger1);

IL本体

LD

SetTrigger1

(* load the value for the SetTrigger-Input *)

KEEP

ResetTrigger1

(* load the value for the ResetTrigger-Input and execute KEEP *)

ST

Address1

(* store the Address-Output value *)

最后更新日期: 此页面上的反馈松下热线