FP_INTERRUPT_CLEAR_REQUESTS

한 유닛에 대한 인터럽트 프로그램 지우기

이 FP 명령은 s_Control에서 지정한 데이터에 따라, d_Slot에서 지정한 슬롯에 설치된 유닛에 대한 인터럽트 프로그램을 지웁니다.

파라미터

입력

d_Slot (WORD, INT, UINT)

슬롯 번호: 1-16

s_Control (WORD)

지정된 슬롯에 설치된 유닛의 인터럽트 번호를 지우는 제어 워드: 16#0–FF

  1.  (1) 상위 8비트: 1으로 고정
  2.  (2) 0: 인터럽트가 지워짐
  3.  (3) 1: 인터럽트가 지워지지 않음

에러 플래그

sys_bIsOperationErrorHold(TRUE로 전환되어 TRUE로 유지됨)

인덱스 한정자를 사용하여 지정한 영역이 제한을 초과하는 경우.

sys_bIsOperationErrorNonHold(스캔 1회에 대해 TRUE로 전환)

인덱스 한정자를 사용하여 지정한 영역이 제한을 초과하는 경우.

글로벌 변수

글로벌 변수 리스트에서 프로젝트의 모든 POU에서 액세스할 수 있는 변수를 정의합니다.

POU 헤더

이 펑션 프로그램 시 사용한 모든 입력과 출력 변수는 POU 헤더에서 선언되었습니다. 모든 프로그래밍 언어에 같은 POU 헤더를 사용합니다.

	VAR
		bComparisonMatchMonitor_0: BOOL:=FALSE;
		bComparisonMatchMonitor_1: BOOL:=FALSE;
		bComparisonMatchMonitor_2: BOOL:=FALSE;
		bComparisonMatchMonitor_3: BOOL:=FALSE;
		bDisable_Interrupt: BOOL:=FALSE;
		bDisableHscUnit: BOOL:=FALSE;
		bEnable_Interrupt: 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 := 6 ;
        NETWORK_BODY
B(B_CONTACT,,sys_bIsFirstScan,6,1,8,3,F);
B(B_COIL,,g_bHscUnitEnable_Ch0,29,1,31,3,);
B(B_CONTACT,,g_bHscUnitEnable_Ch0,6,4,8,6,);
B(B_CONTACT,,bDisableHscUnit,16,1,18,3,N);
B(B_COIL,,g_bHscUnitEnable_Ch1,29,3,31,5,);
L(18,2,29,2);
L(13,2,16,2);
L(8,2,13,2);
L(1,2,6,2);
L(1,5,6,5);
L(13,2,13,5);
L(8,5,13,5);
L(23,2,23,4);
L(23,4,29,4);
L(1,0,1,6);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 6 ;
        NETWORK_BODY
B(B_CONTACT,,g_bHscUnitEnable_Ch0,6,1,8,3,R);
B(B_COIL,,g_bHscUnitEnableCounting_Ch0,29,1,31,3,);
B(B_CONTACT,,g_bHscUnitEnableCounting_Ch0,6,4,8,6,);
B(B_CONTACT,,bDisableHscUnit,16,1,18,3,N);
B(B_COIL,,g_bHscUnitEnableCounting_Ch1,29,3,31,5,);
L(18,2,29,2);
L(1,5,6,5);
L(13,2,13,5);
L(8,5,13,5);
L(13,2,16,2);
L(8,2,13,2);
L(1,2,6,2);
L(19,4,29,4);
L(19,2,19,4);
L(1,0,1,6);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 3 ;
        NETWORK_BODY
B(B_CONTACT,,g_bHscUnitComparisonMatchFlag_Ch0_0,7,1,9,3,);
B(B_COIL,,bComparisonMatchMonitor_0,29,1,31,3,);
B(B_COMMENT,,-- Only for monitoring,49,0,73,2,);
L(9,2,29,2);
L(1,2,7,2);
L(1,0,1,3);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 3 ;
        NETWORK_BODY
B(B_CONTACT,,g_bHscUnitComparisonMatchFlag_Ch0_1,7,1,9,3,);
B(B_COIL,,bComparisonMatchMonitor_1,29,1,31,3,);
B(B_COMMENT,,-- Only for monitoring,49,0,73,2,);
L(9,2,29,2);
L(1,2,7,2);
L(1,0,1,3);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 3 ;
        NETWORK_BODY
B(B_CONTACT,,g_bHscUnitComparisonMatchFlag_Ch1_0,7,1,9,3,);
B(B_COIL,,bComparisonMatchMonitor_2,29,1,31,3,);
B(B_COMMENT,,-- Only for monitoring,49,0,73,2,);
L(9,2,29,2);
L(1,2,7,2);
L(1,0,1,3);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 3 ;
        NETWORK_BODY
B(B_CONTACT,,g_bHscUnitComparisonMatchFlag_Ch1_1,7,1,9,3,);
B(B_COIL,,bComparisonMatchMonitor_3,29,1,31,3,);
B(B_COMMENT,,-- Only for monitoring,49,0,73,2,);
L(9,2,29,2);
L(1,2,7,2);
L(1,0,1,3);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 5 ;
        NETWORK_BODY
B(B_F,FP_INTERRUPT_DISABLE!,,12,0,24,3,,?DEN?AENO);
B(B_CONTACT,,sys_bIsFirstScan,4,1,6,3,);
B(B_COIL,,bEnable_Interrupt,29,1,31,3,E);
B(B_CONTACT,,bDisable_Interrupt,4,3,6,5,);
B(B_COMMENT,,Disable all Interrupts hard: no activation with the FB- FP_INTERRUPT_ACTIVATE possible,43,0,67,2,);
L(1,2,4,2);
L(6,2,12,2);
L(1,4,4,4);
L(6,4,11,4);
L(11,2,11,4);
L(24,2,29,2);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 2 ;
        NETWORK_BODY
B(B_VAROUT,,g_iCount_up,16,0,18,2,);
B(B_VARIN,,g_iCount_up,14,0,16,2,);
B(B_COMMENT,,-- Only for monitoring,49,0,73,2,);
L(1,0,1,2);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 2 ;
        NETWORK_BODY
B(B_VAROUT,,g_iCount_I1_0,16,0,18,2,);
B(B_VARIN,,g_iCount_I1_0,14,0,16,2,);
B(B_COMMENT,,For monitoring the counter variable in the interrupt 1_0,49,0,73,2,);
L(1,0,1,2);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 2 ;
        NETWORK_BODY
B(B_VAROUT,,g_iCount_I1_1,16,0,18,2,);
B(B_VARIN,,g_iCount_I1_1,14,0,16,2,);
B(B_COMMENT,,For monitoring the counter variable in the interrupt 1_1,49,0,73,2,);
L(1,0,1,2);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 2 ;
        NETWORK_BODY
B(B_VAROUT,,g_iCount_I1_2,16,0,18,2,);
B(B_VARIN,,g_iCount_I1_2,14,0,16,2,);
B(B_COMMENT,,For monitoring the counter variable in the interrupt 1_2,49,0,73,2,);
L(1,0,1,2);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 2 ;
        NETWORK_BODY
B(B_VAROUT,,g_iCount_I1_3,16,0,18,2,);
B(B_VARIN,,g_iCount_I1_3,14,0,16,2,);
B(B_COMMENT,,For monitoring the counter variable in the interrupt 1_3,49,0,73,2,);
L(1,0,1,2);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 4 ;
        NETWORK_BODY
B(B_F,@EQ-2!,,9,1,14,4,,?D?D?C);
B(B_VARIN,,g_iCount_up,7,1,9,3,);
B(B_VARIN,,10,7,2,9,4,);
B(B_COIL,,bEnable_Interrupt,19,1,21,3,S);
L(14,2,19,2);
L(1,0,1,4);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 5 ;
        NETWORK_BODY
B(B_F,FP_INTERRUPT_CLEAR_REQUESTS!,,19,0,36,5,,?DEN?Dd_Slot?Ds_Control?AENO);
B(B_VARIN,,1,17,2,19,4,);
B(B_VARIN,,16#FF02,17,3,19,5,);
B(B_CONTACT,,bEnable_Interrupt,5,1,7,3,R);
B(B_COMMENT,, Clear only the interrupts I_1_2 und I_1_3 (Because Bits 2 and 3 are False - Bits 0 and 1 are True --> will not be cleared) ,49,1,73,3,);
L(1,2,5,2);
L(7,2,19,2);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 3 ;
        NETWORK_BODY
B(B_F,FP_INTERRUPT_ENABLE!,,19,0,31,3,,?DEN?AENO);
B(B_CONTACT,,bEnable_Interrupt,5,1,7,3,R);
L(1,2,5,2);
L(7,2,19,2);
L(1,0,1,3);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 4 ;
        NETWORK_BODY
B(B_F,FP_INC!,,19,0,25,4,,?DEN?Dd?Ad?AENO);
B(B_VARIN,,g_iCount_up,17,2,19,4,);
B(B_CONTACT,,sys_bPulse1s,5,1,7,3,R);
L(1,2,5,2);
L(7,2,19,2);
L(1,0,1,4);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST 본문

(* Initiation *)
g_bHscUnitEnable_Ch0 := (DFN(sys_bIsFirstScan) OR g_bHscUnitEnable_Ch0) AND NOT bDisableHscUnit ;
g_bHscUnitEnable_Ch1 := (DFN(sys_bIsFirstScan) OR g_bHscUnitEnable_Ch1) AND NOT bDisableHscUnit ;
g_bHscUnitEnableCounting_Ch0 := (DF(g_bHscUnitEnable_Ch0) OR g_bHscUnitEnableCounting_Ch0) AND NOT bDisableHscUnit ;
g_bHscUnitEnableCounting_Ch1 := (DF(g_bHscUnitEnable_Ch1) OR g_bHscUnitEnableCounting_Ch1) AND NOT bDisableHscUnit ;
(* Monitoring *)
bComparisonMatchMonitor_0 := g_bHscUnitComparisonMatchFlag_Ch0_0 ;  
g_iCount_up := g_iCount_up;        (* is counted in the main project *)
(* Interrupt expressions *)
if (sys_bIsFirstScan OR bDisable_Interrupt) then
    FP_INTERRUPT_DISABLE();
    bEnable_Interrupt := FALSE;
end_if;
if DF(g_iCount_up = 10) then
    FP_INTERRUPT_CLEAR_REQUESTS(d_Slot := 1, s_Control := 16#FF02);        (* Clear all interrupts of unit 1 except interrupt 1_0 and 1_1 *)
    FP_INTERRUPT_ENABLE();
end_if;
(* 1 second counting pulse *)
if (DF(sys_bPulse1s)) then
    FP_INC(d := g_iCount_up);
end_if;

최종 수정일: 2022-09-19이 페이지에 대한 피드백Panasonic 직통 전화