![background image](http://html1.mh-extra.com/html/omron/r88a-mcw151-drt-e/r88a-mcw151-drt-e_operation-manual_742243101.webp)
86
Overview
Section 5-1
5-1
Overview
The MCW151-E and MCW151-DRT-E Motion Control Units feature a multi-
tasking version of the BASIC programming language. The motion control lan-
guage is largely based upon a tokenised BASIC and the programs are
compiled into the tokenised form prior to their execution.
Multitasking is simple to set up and use and allows very complex machines to
be programmed. Multitasking gives the MC Unit a significant advantage over
equivalent single task systems. It allows modular applications where the logi-
cally connected processes can be grouped together in the same task pro-
gram, thus simplifying the code architecture and design.
The MC Unit can hold up to 14 programs if memory size permits. A total of 3
tasks can be allocated to the programs. The execution of the programs is user
controlled using BASIC.
The BASIC commands, functions and parameters presented here can be
found in SECTION 6 BASIC Motion Control Programming Language.
5-2
BASIC Programming
The BASIC language consists among others of commands, functions and
parameters. These BASIC statements are the building blocks provided to
control the MC Unit operation.
Commands
Commands are words recognized by the processor that perform a certain
action but do not return a value. For example, PRINT is a recognized word
that will cause the value of the following functions or variables to be printed on
a certain output device.
Functions
Functions are words recognized by the processor that perform a certain
action and return a value related to that action. For example, ABS will take the
value of its parameter and return the absolute value of it to be used by some
other function or command. For example ABS(-1) will return the value 1,
which can be used by the PRINT command, for example, to generate a string
to be output to a certain device.
Parameters
Parameters are words recognized by the processor that contain a certain
value. This value can be read and, if not read only, written. Parameters are
used to determine and monitor the behavior of the system. For example,
ACCEL determines the acceleration rate of a movement for a certain axis.
5-2-1
Axis, System and Task Statements
The commands, functions and parameters apply either to (one of) the axes,
the tasks running or the general system.
Axis Statements
The motion control commands and the axis parameters apply to one or more
axes. Axis parameters determine and monitor how an axis reacts on com-
mands given and how it reacts to the outside world. Every axis has a set of
parameters, so that all axes can work independently of each other. The
motion control commands are able to control one or more of the axes simulta-
neously, while every axis has its own behavior. The axis parameters are reset
to their default values for each startup.
The commands and parameters work on some base axis or group of axes,
specified by the BASE command. The BASE command is used to change this
base axis group and every task has its own group which can be changed at
any time. The default base axis is 0.
Individual axis dependent commands or parameters can also be programmed
to work on a temporary base axis by including the AXIS function as a modifier