Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
21
Добавлен:
11.10.2020
Размер:
3.39 Mб
Скачать

Standard Library Elements

325

Trigger

 

 

 

BUSY = SEMA(CLAIM, RELEASE) means:

BUSY := X;

IF CLAIM THEN X:=TRUE;

ELSE IF RELEASE THEN BUSY := FALSE; X:= FALSE;

END_IF

X is an internal BOOL variable that is FALSE when it is initialized.

The input variables CLAIM and RELEASE as well as the output variable

BUSY are type BOOL.

If BUSY is TRUE when SEMA is called up, this means that a value has already been assigned to SEMA (SEMA was called up with CLAIM = TRUE). If BUSY is FALSE, SEMA has not yet been called up or it has been released (called up with RELEASE = TRUE).

Declaration example:

SEMAInst : SEMA ;

Example in IL:

CAL SEMAInst(CLAIM := VarBOOL1, RELEASE := VarBOOL2)

LD SEMAInst.BUSY

ST VarBOOL3

Example in FBD:

Example in ST:

SEMAInst(CLAIM:= VarBOOL1 , RELEASE:=VarBOOL2 );

VarBOOL3 := SEMAInst.BUSY;

13.3 Trigger

13.3.1R_TRIG

The function block R_TRIG detects a rising edge.

FUNCTION_BLOCK R_TRIG

VAR_INPUT

WAGO-I/O-SYSTEM 759 WAGO-I/O-PRO 32

326 Standard Library Elements

Trigger

CLK : BOOL;

END_VAR

VAR_OUTPUT

Q : BOOL;

END_VAR

VAR

M : BOOL := FALSE;

END_VAR

Q0 := CLK AND NOT M;

M := CLK;

END_FUNCTION_BLOCK

The output Q0 and the help variable M will remain FALSE as long as the input variable CLK is FALSE. As soon as S1 returns TRUE, Q will first return TRUE, then M will be set to TRUE. This means each time the function is called up, Q will return FALSE until CLK has falling edge followed by an rising edge.

Declaration example:

RTRIGInst : R_TRIG ;

Example in IL:

CAL RTRIGInst(CLK := VarBOOL1)

LD RTRIGInst.Q

ST VarBOOL2

Example in FBD:

Example in ST:

RTRIGInst(CLK:= VarBOOL1);

VarBOOL2 := RTRIGInst.Q;

WAGO-I/O-SYSTEM 759 WAGO-I/O-PRO 32

Standard Library Elements

327

Trigger

 

 

 

13.3.2F_TRIG

The function block F_TRIG a falling edge.

FUNCTION_BLOCK F_TRIG

VAR_INPUT

CLK: BOOL;

END_VAR

VAR_OUTPUT

Q: BOOL;

END_VAR

VAR

M: BOOL := FALSE;

END_VAR

Q := NOT CLK AND NOT M;

M := NOT CLK;

END_FUNCTION_BLOCK

The output Q and the help variable M will remain FALSE as long as the input variable CLK returns TRUE. As soon as CLK returns FALSE, Q will first return TRUE, then M will be set to TRUE. This means each time the function is called up, Q will return FALSE until CLK has a rising followed by a falling edge.

Declaration example:

FTRIGInst : F_TRIG ;

Example in IL:

CAL FTRIGInst(CLK := VarBOOL1)

LD FTRIGInst.Q

ST VarBOOL2

Example in FBD:

WAGO-I/O-SYSTEM 759 WAGO-I/O-PRO 32

Соседние файлы в папке 759-332