6 statements used for multi-tasking applications, 6 statements used for multićtasking applications – Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual

Page 57

Advertising
background image

6Ć17

20 FOR B%=2 TO 10 STEP 2
30 X%(A%,B%)=A% + B%
40 NEXT B%
50 NEXT A%
60 END

6.6

Statements Used for

MultiĆTasking Applications

The typical control application has a variety of functions to perform

and monitor. All of these functions require the attention of the CPU,

or Processor module. To better service these different functions,

BASIC provides a number of multiĆtasking capabilities. MultiĆtasking

is a scheme whereby the operations requiring service are grouped

into separate pieces called tasks.
AutoMax Enhanced BASIC provides the following statements to

allow the user to break the control application into tasks and then

synchronize those tasks:
1. EVENT statement
2. SET statement
3. WAIT statement
4. OPEN CHANNEL statement (INPUT/PRINT channel).

6.6.1

EVENT NAME Statement

An event can be thought of simply as a flag or indicator that one

task can set or raise and another task can wait for. There are two

types of events used in a BASIC task:
1. Hardware events
2. Software events
Hardware events are generated by an actual external condition,

such as an interrupt from a Resolver module (M/N 57C411).

Hardware events cannot be used on the AutoMax PC3000. See

Appendix C for information on allocating hardware interrupt lines. A

software event is simply a flag set by an application task.
An EVENT NAME statement defines a specific event and is used in

conjunction with the SET and WAIT statements. The EVENT

statement defines a symbolic name for an event. The SET and WAIT

statements act on that event. The EVENT statement has two

formats, one for a hardware event and one for a software event:

Software Event

EVENT NAME = event_name

Hardware Event

EVENT NAME = event_name,

&

INTERRUPT_STATUS = I/O_variable_name,

&

TIMEOUT = timeout_count

Advertising
This manual is related to the following products: