Multitasking; Tasks - Omron SYSMAC CV500-BSC11 Operation Manual

Basic units
Table of Contents

Advertisement

Multitasking

6-2

Multitasking

6-2-1 Tasks

INTRL contains the line number of the statement that was aborted by the inter-
rupt, or 0 if no statement was aborted. Some BASIC Unit instructions take an
indefinite amount of time to complete. For example, the INPUT statement
causes the Unit to wait until the user has entered a value at the terminal. If an
interrupt occurs while the Unit is waiting for such a statement to complete, the
statement will be aborted and INTRL will contain the statement's line number.
The instructions below may be aborted by an interrupt, and will cause a line num-
ber to be stored in INTRL if they are:
GET #
INPUT
INPUT WAIT
INPUT$
INPUT #
INPUT@
LINE INPUT
LINE INPUT #
Note INTRR and INTRB are saved before an interrupt routine is called and restored
after the routine returns, so they always contain the correct values for the current
interrupt, even if execution is not completed or a second interrupt occurs while
the Unit is executing a different interrupt service routine.
This example shows one way to re-start a statement if it is aborted by an inter-
rupt. If this type of programming is not implemented, the program line 100 may
be aborted before completion.
10 ON TIMER 100 GOSUB *SUB
20 TIMER ON
100 INPUT A$.
110 IF WAS_ABORTED = 100 THEN WAS_ABORTED = 0 : GOTO 100
480 *SUB
500 WAS_ABORTED = INTRL
600 RETURN
• A task is a series of instructions necessary for a computer to complete one pro-
cess and is one unit of a program.
• Tasks are classified by the function they perform; for example, a print task
prints data with a printer, a text display task displays characters on a CRT
screen, and a CPU Unit communications task communicates with the CPU
Unit.
• Multitasking is the ability to execute two or more tasks simultaneously on one
computer. The BASIC Unit can execute up to 16 tasks simultaneously.
LINE INPUT WAIT
LPRINT
LPRINT USING
PRINT
PRINT@
PRINT #
PRINT # USING
PUT #
Section 6-2
RECEIVE
SEND
TWAIT
WRITE
WRITE #
PC READ
PC WRITE
Subroutine
97

Advertisement

Table of Contents
loading

Table of Contents