Installation guide
48 Motion Controller Programming Interface
6.1 - Programming
6.1.1 - General Description of
Programming
This section provides an overview to the process of pro-
gramming a Controller. Once the "logic" behind the vari-
ous commands are understood, programming your Con-
troller will be seen as a straightforward process.
Programming of any sort requires planning and fore-
thought. Programming your Controller is no exception.
This section will provide aids to facilitate your planning
process. Be patient! Allow time for mis takes, adjustments
("debugging"), and experimentation.
6.1.1.1 - What is Programming?
At its most basic level, a computer program is a means of
using electronic digital signals (simple ON and OFF) to
produce certain results from a machine. A line of code, or
"command string," is built up from the presence (On) or
absence (Off) of electrical signals. On or Off signals,
called "Bits," are bunched together to form "Bytes", or
groupings that are coded into what we recognize as al-
phabetical characters or numbers. (This character coding
is accomplished via the ASCII code - see Glossary Section
for further details.
A program is a list of discrete lines or command strings
that, taken together in sequence, provide the information
needed to get a machine to perform your predetermined
sequence of instructions. These instructions can, in the
case of a Programmable Motion Controller, cause the mo-
tor to move at certain speeds and for given distances, read
various inputs or set outputs, or send and receive mes-
sages from an operator interface panel, all used to accom-
plish different machine-related tasks.
6.1.1.2 – What’s in a Program?
A program consists of many individual lines organized in a
prescribed sequence. The Controller uses an English lan-
guage, BASIC-type computer programming language
("SEBASIC"). This makes it easy and intuitive to
write and read machine control programs. The lan-
guage we have designed supports many higher-level-
language features, such as statement labels, subrou-
tines, for-next and do-while loops for program flow
control. This makes it easy to write concise, well-
organized, easily debugged programs. Also, there
are built-in mathematical, Boolean, array, and trigo-
nometry functions to perform complex calculations.
The rich string-handling functions allow easy data
input and message writing when using external op-
erator interface panels. Finally, the motion, I/O, and
timing commands are easy to understand, remember,
and apply.
In addition to program lines, the controller needs and
stores (separate from the commands) a series of set-up
parameters in a "header file". The MCPI compiler program
automatically creates this file.
6.1.1.3 - How is the Controller
Programmed?
There are two primary ways to set up and program your
Controller. Both involve the use of a personal computer
(PC). One is a programming environment called "MCPI",
and is supplied on diskette with your unit. Section 6.3 of
this manual gives detailed instructions on installing and
using this tool to develop your application. A second way
is to create your program using any standard text editor or
word processor. Write the SEBASIC commands, save the
file as an ASCII format then use the MCPI to compile your
code and download it.
The types of commands your Controller can accept
are pre-set. Thus each command is assigned a
"name". These commands are explained in detail in
the Software Reference Section of this Manual.
Commands are performed via the statement lines in your
program. The program is a sequence of commands that
control the motor and motion-related events you want to
happen in a particular period of time. Thus, the sequence
of commands is critical to the proper operation of your
system.
6.1.2 - What are "Host Commands"?
There are also "Host Commands" available for certain
programming needs. These commands go straight from
your input device (computer or terminal, for example), to
the Controller, and override the normal sequence of opera-
tion directed by your program. These are useful for manu-
ally controlling a machine that normally operates under
program control.
6.1.3 – Memory Types and Usage
A program is stored in Memory. There are two kinds of
memory. RAM (Random Access Memory) is called "Vola-
tile Memory" because when power is removed from the
Controller, all the electrical signals in that memory are lost,
and accordingly, the information stored in that memory is
lost. The Controller, for example, stores some transient
information in RAM.
The second kind of memory is "Non-Volatile Memo ry",
such as Flash memory, EEPROM (Electrically Programma-










