BASIC Moves Development Studio
06/2005
Danaher Motion
12 Rev
E
M-SS-005-03l
To develop your application on the MC, you must install BASIC Moves
Development Studio. Refer to the software installation section of the
SERVOSTAR
®
MC Installation Manual
for detailed instructions.
2.2.1. Instructions
Instructions are the building blocks of BASIC. Instructions set variables, call
functions, control program flow, and start processes such as events and
motion. In this manual we will use the terms
instruction
and
command
interchangeably. For detailed information on any of the instructions (including
examples), refer to the
SERVOSTAR
®
MC Reference Manual
.
Syntax
is the set of rules that must be observed to construct a legal
command (that is, a command the MC can recognize).
MC-BASIC is
line-oriented
. The end of the line indicates the end of the
instruction. Whitespace (
i. e.
, spaces and tabs within the statement line and
blank lines), is ignored by the Basic interpreter. You can freely use
indentation to delineate block structures in your program code for easier
readability. The maximum allowed length of a line is 80 characters.
MC-BASIC is
case insensitive
. Commands, variable names, filenames, and
task names may be written using either upper case or lower case letters. The
only exception is that when printing strings with the “
” and “
PrintUsing
”
commands, upper and lower case characters can be specified.
Syntax
uses the following
notation
:
[ ]
indicates the contents are required
{ }
indicates the contents are optional for the command
Example lines
of text are shown in Courier type font and with a border:
X = 1
2.2.2. Type
There are many types of instructions: comments, assignments, memory
allocation, flow control, task control, and motion. For detailed information on
any of the commands (including examples), refer to the
SERVOSTAR
®
MC
Reference Manual
.
Comments
allow you to document your program. Indicate a comment with
either the Rem command or a single apostrophe ('). You can add comments
to the end of an instruction with either Rem or an apostrophe.
Rem This is a comment
' This is a comment too.
X = 1 'This comment is added to the line X = 1
X = 1 REM This is a comment too
Use comments generously throughout your program. They are an asset
when you need support from others and they avoid confusing code.
Declarations
allocate MC memory for variables and system elements
(groups, cam tables, etc.). This might be a simple type as an integer, or a
complex structure as a cam table.
Assignments
Assignment instructions assign a new value to a variable.
The syntax of an assignment is
[Lvalue] [=] [expression]
For example:
X = Y + 1