12.07.2015 Views

RAPID reference manual - Technology

RAPID reference manual - Technology

RAPID reference manual - Technology

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

InstructionIPersAdvanced <strong>RAPID</strong>IPers - Interrupt at value change of a persistent variableIPers (Interrupt Persistent) is used to order and enable interrupts to be generated whenthe value of a persistent variable is changed.ExampleVAR intnum pers1int;PERS num counter := 0;PROC main()CONNECT pers1int WITH iroutine1;IPers counter, pers1int;...Idelete pers1int;ENDPROCTRAP iroutine1TPWrite “Current value of counter = “ \Num:=counter;ENDTRAPOrders an interrupt which is to occur each time the persistent variable counter ischanged. A call is then made to the iroutine1 trap routine.ArgumentsIPersName InterruptNameData type: anytypeThe name of the persistent variable that is to generate interrupts.InterruptData type: intnumThe interrupt identity. This should have previously been connected to a trap routineby means of the instruction CONNECT.Program executionWhen the persistent changes value, a call is made to the corresponding trap routine.When this routine has been executed, program execution continues from where theinterrupt occurred.If the persistent changes value during a program stop, no interrupt will occur when theprogram starts again.<strong>RAPID</strong> <strong>reference</strong> <strong>manual</strong> - part 1a, Instructions A-R 177

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

Saved successfully!

Ooh no, something went wrong!