09.12.2012 Views

Basic Characteristics RAPID

Basic Characteristics RAPID

Basic Characteristics RAPID

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.

<strong>RAPID</strong> Summary Interrupts<br />

8 Interrupts<br />

Interrupts are used by the program to enable it to deal directly with an event, regardless<br />

of which instruction is being run at the time.<br />

The program is interrupted, for example, when a specific input is set to one. When this<br />

occurs, the ordinary program is interrupted and a special trap routine is executed.<br />

When this has been fully executed, program execution resumes from where it was<br />

interrupted.<br />

8.1 Programming principles<br />

Each interrupt is assigned an interrupt identity. It obtains its identity by creating a variable<br />

(of data type intnum) and connecting this to a trap routine.<br />

The interrupt identity (variable) is then used to order an interrupt, i.e. to specify the reason<br />

for the interrupt. This may be one of the following events:<br />

- An input or output is set to one or to zero.<br />

- A given amount of time elapses after an interrupt is ordered.<br />

- A specific position is reached.<br />

When an interrupt is ordered, it is also automatically enabled, but can be temporarily<br />

disabled. This can take place in two ways:<br />

- All interrupts can be disabled. Any interrupts occurring during this time are<br />

placed in a queue and then automatically generated when interrupts are enabled<br />

again.<br />

- Individual interrupts can be deactivated. Any interrupts occurring during this<br />

time are disregarded.<br />

8.2 Connecting interrupts to trap routines<br />

Instruction Used to:<br />

CONNECT Connect a variable (interrupt identity) to a trap routine<br />

<strong>RAPID</strong> Reference Manual 3-23

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

Saved successfully!

Ooh no, something went wrong!