Kuhnke Electronics Instruction Manual

Kuhnke Electronics Instruction Manual Kuhnke Electronics Instruction Manual

17.02.2013 Views

Function Libraries PROGRAM Init_Interrupt_IO VAR Index0: WORD; Index1: WORD; flag0:BOOL; flag1:BOOL; END_VAR Index0:=INDEXOF(Interrupt_I0); Index1:=INDEXOF(Interrupt_I1); IF IN_00 AND NOT flag0 THEN flag0:=INSTALL_INPUT_IRQ(Index0,0,1); ELSE flag0:=INSTALL_INPUT_IRQ(Index0,0,0); END_IF IF IN_01 AND NOT flag1 THEN flag1:=INSTALL_INPUT_IRQ(Index1,1,3); ELSE flag1:=INSTALL_INPUT_IRQ(Index1,1,0); END_IF 86 E 700 GB

4.4.8 Installing a REF IRQ Module Function Libraries A Ref impulse from Ventura Remote PLC's counter interface generates an interrupt request (IRQ) which can interrupt the processing of the current program and run an IRQ module instead. This requires that running an interrupt module (IRQmod) following reference interrupt is admitted by the project parameter settings made using the PLC Configuration Editor. To install a program module as a REF-IRQ module you must run the following code to identify the module: Index := INDEXOF (module name); Afterwards, run the following function in order to set up the error module: REGIT_REFIRQ ( Index ); After successful completion, the function returns TRUE. FUNCTION REGIT_REFIRQ: BOOL VAR_INPUT POU_ID: WORD; END_VAR VAR END_VAR 87

Function Libraries<br />

PROGRAM Init_Interrupt_IO<br />

VAR<br />

Index0: WORD;<br />

Index1: WORD;<br />

flag0:BOOL;<br />

flag1:BOOL;<br />

END_VAR<br />

Index0:=INDEXOF(Interrupt_I0);<br />

Index1:=INDEXOF(Interrupt_I1);<br />

IF IN_00 AND NOT flag0 THEN<br />

flag0:=INSTALL_INPUT_IRQ(Index0,0,1);<br />

ELSE<br />

flag0:=INSTALL_INPUT_IRQ(Index0,0,0);<br />

END_IF<br />

IF IN_01 AND NOT flag1 THEN<br />

flag1:=INSTALL_INPUT_IRQ(Index1,1,3);<br />

ELSE<br />

flag1:=INSTALL_INPUT_IRQ(Index1,1,0);<br />

END_IF<br />

86 E 700 GB

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!