09.12.2012 Views

Basic Characteristics RAPID

Basic Characteristics RAPID

Basic Characteristics RAPID

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Program execution<br />

Limitations<br />

Interrupt Data type: intnum<br />

The interrupt identity. This should have previously been connected to a trap routine<br />

by means of the instruction CONNECT.<br />

When the signal assumes the specified value, a call is made to the corresponding trap<br />

routine. When this has been executed, program execution continues from where the<br />

interrupt occurred.<br />

If the signal changes to the specified value before the interrupt is ordered, no interrupt<br />

occurs (see Figure 1).<br />

:<br />

1<br />

Signal level<br />

0<br />

Interrupt ordered<br />

Interrupt ordered<br />

1<br />

Signal level<br />

0<br />

Figure 1 Interrupts from a digital output signal at signal level 1.<br />

The same variable for interrupt identity cannot be used more than once, without first<br />

deleting it. Interrupts should therefore be handled as shown in one of the alternatives<br />

below.<br />

PROC main ( )<br />

VAR intnum sig1int;<br />

CONNECT sig1int WITH iroutine1;<br />

ISignalDO do1, 1, sig1int;<br />

WHILE TRUE DO<br />

:<br />

:<br />

ENDWHILE<br />

ENDPROC<br />

Interrupt occurs<br />

Interrupt occurs<br />

All activation of interrupts is done at the beginning of the program. These instructions<br />

are then kept outside the main flow of the program.<br />

8-ISignalDO-2 <strong>RAPID</strong> Reference Manual

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

Saved successfully!

Ooh no, something went wrong!