User guide

120
6000 Series Programmer's Guide
Variable Arrays (
teaching
variable data)
More on variables:
see page 18.
Variable data arrays provide a method of storing (teaching) variable data and later using the
stored data as a source for motion program parameters. The variable data can be any value that
can be stored in a numeric (VAR) variable (e.g., position, acceleration, velocity, etc). The
variable data is stored into a data program, which is an array of data elements that have a
specific address from which to write and read the variable data. Data programs do not contain
6000 Series commands.
The information below describes the principles of using the data program in a teach-type
application. Following that is an application example in which the joystick is used to teach
position data to be used in a motion program.
Basics of Teach-Data Applications
The basic process of using a data program for data teaching applications is as follows:
1. Initialize a data program.
2. Teach (store/write) variable data into the data program.
3. Read the data elements from the data program into a motion program.
Initialize a
Data Program
This is accomplished with the DATSIZ command. The DATSIZ command syntax is
DATSIZi<,i>. The first integer (i) represents the number of the data program (1 - 50).
You can create up to 50 separate data programs. The data program is automatically given a
specific program name (DATPi). The second integer represents the total number of data
elements (up to 6,500) you want in the data program. Upon issuing the DATSIZ command,
the data program is created with all the data elements initialized with a value of zero.
The data program has a tabular structure, where the data elements are stored 4 to a line. Each
line of data elements is called a data statement. Each element is numbered in sequential order
from left to right (1 - 4) and top to bottom (1 - 4, 5 - 8, 9 - 12, etc.). You can use the TPROG
DATPi command (“i” represents the number of the data program) to display all the data
elements of the data program.
For example, if you issue the DATSIZ1,13 command, data program #1 (called DATP1) is
created with 13 data elements initialized to zero. The response to the TPROG DATP1 command
is depicted below. Each line (data statement) begins with DATA=, and each data element is
separated with a comma.
*DATA=+Ø.Ø,+Ø.Ø,+Ø.Ø,+Ø.Ø
*DATA=+Ø.Ø,+Ø.Ø,+Ø.Ø,+Ø.Ø
*DATA=+Ø.Ø,+Ø.Ø,+Ø.Ø,+Ø.Ø
*DATA=+Ø.Ø
Each data statement, comprising four data elements, uses 43 bytes of memory. The memory for
each data statement is subtracted from the memory allocated for user programs (see MEMORY
command).