14.01.2015 Views

Gemini GV6K and Gemini GT6K Programmer's Guide

Gemini GV6K and Gemini GT6K Programmer's Guide

Gemini GV6K and Gemini GT6K Programmer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Variable Arrays (teaching variable data)<br />

More on variables:<br />

see page 18.<br />

Variable data arrays provide a method of storing (teaching) variable data <strong>and</strong> later using the<br />

stored data as a source for motion program parameters. The variable data can be any value that<br />

can be stored in a numeric (VAR or VARI) variable (e.g., position, acceleration, velocity, etc.).<br />

The variable data is stored into a data program, which is an array of data elements that have a<br />

specific address from which to write <strong>and</strong> read the variable data. Data programs do not contain<br />

Gem6K Series comm<strong>and</strong>s.<br />

The information below describes the principles of using the data program in a teach-type<br />

application. Following that is an application example in which the joystick is used to teach<br />

position data to be used in a motion program.<br />

Basics of Teach-Data Applications<br />

The basic process of using a data program for data teaching applications is as follows:<br />

1. Initialize a data program.<br />

2. Teach (store/write) variable data into the data program.<br />

3. Read the data elements from the data program into a motion program.<br />

1. Initialize a<br />

Data Program<br />

This is accomplished with the DATSIZ comm<strong>and</strong>. The DATSIZ comm<strong>and</strong> syntax is<br />

DATSIZi. The first integer (i) represents the number of the data program (1 - 50). You<br />

can create up to 50 separate data programs. The data program is automatically given a specific<br />

program name (DATPi). The second integer represents the total number of data elements (up<br />

to 6,500) you want in the data program. Upon issuing the DATSIZ comm<strong>and</strong>, the data program<br />

is created with all the data elements initialized with a value of zero.<br />

The data program has a tabular structure, where the data elements are stored 4 to a line. Each<br />

line of data elements is called a data statement. Each element is numbered in sequential order<br />

from left to right (1 - 4) <strong>and</strong> top to bottom (1 - 4, 5 - 8, 9 - 12, etc.). You can use the TPROG<br />

DATPi comm<strong>and</strong> (“i” represents the number of the data program) to display all the data<br />

elements of the data program.<br />

For example, if you issue the DATSIZ1,13 comm<strong>and</strong>, data program #1 (called DATP1) is<br />

created with 13 data elements initialized to zero. The response to the TPROG DATP1<br />

comm<strong>and</strong> is depicted below. Each line (data statement) begins with DATA=, <strong>and</strong> each data<br />

element is separated with a comma.<br />

*DATA=+Ø.Ø,+Ø.Ø,+Ø.Ø,+Ø.Ø<br />

*DATA=+Ø.Ø,+Ø.Ø,+Ø.Ø,+Ø.Ø<br />

*DATA=+Ø.Ø,+Ø.Ø,+Ø.Ø,+Ø.Ø<br />

*DATA=+Ø.Ø<br />

Each data statement, comprising four data elements, uses 43 bytes of memory. The memory<br />

for each data statement is subtracted from the memory allocated for user programs (see<br />

MEMORY comm<strong>and</strong>).<br />

110 Gem6K Series Programmer’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!