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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2. Teach the Data<br />

to the Data<br />

Program<br />

The data that you wish to write to the data elements in the data program must first be placed<br />

into numeric variables (VAR). Once the data is stored into numeric variables, the data elements<br />

in the data program can be edited by using the Data Pointer (DATPTR) comm<strong>and</strong> to move the<br />

data pointer to that element, <strong>and</strong> then using the Data Teach (DATTCH) comm<strong>and</strong> to write the<br />

datum from the numeric variable into the element.<br />

When the DATSIZ comm<strong>and</strong> is issued, the internal data pointer is automatically positioned to<br />

data element #1. Using the default settings for the DATPTR comm<strong>and</strong>, the numberic variable<br />

data is written to the data elements in sequential order, incrementing one by one. When the<br />

last data element in the data program is written, the data pointer is automatically set to data<br />

element #1 <strong>and</strong> a warning message (*WARNING: POINTER HAS WRAPPED AROUND<br />

TO DATA POINT 1) is displayed. The warning message does not interrupt program<br />

execution.<br />

The DATPTR comm<strong>and</strong> syntax is DATPTRi,i,i. The first integer (i) represents the data<br />

program number (1 through 50). The second integer represents the number of the data element<br />

to point to (1 through 6500). The third integer represents the number of data elements by<br />

which the pointer will increment after writing each data element from the DATTCH comm<strong>and</strong>,<br />

or after recalling a data element with the DAT comm<strong>and</strong>.<br />

The DATTCH comm<strong>and</strong> syntax is DATTCHi. Each integer (i) represents the<br />

number of a numeric variable. The value of the numeric variable will be stored into the data<br />

element(s) of the currently active data program (i.e., the program last specified with the last<br />

DATSIZ or DATPTR comm<strong>and</strong>). As indicated by the number of integers in the syntax, the<br />

maximum number of variable values that can be stored in the data program per DATTCH<br />

comm<strong>and</strong> is 4. Each successive value from the DATTCH comm<strong>and</strong> is stored to the data<br />

program according to the pattern established by the third integer of the DATPTR comm<strong>and</strong>.<br />

As an example, suppose data program #1 is configured to hold 13 data elements<br />

(DATSIZ1,13), the data pointer is configured to start at data element #1 <strong>and</strong> increment 1<br />

data element after every value stored from the DATTCH comm<strong>and</strong> (DATPTR1,1,1), <strong>and</strong> the<br />

values of numeric variables #1 through #3 are already assigned (VAR1=2, VAR2=4,<br />

VAR3=8). If you then enter the DATTCH1,2,3 comm<strong>and</strong>, the values of VAR1 through VAR3<br />

will be assigned respectively to the first three data elements in the data program, leaving the<br />

pointer pointing to data element #4. The response to the TPROG DATP1 comm<strong>and</strong> would be<br />

as follows (the text is highlighted to illustrate the final location of the data pointer after the<br />

DATTCH1,2,3 comm<strong>and</strong> is executed):<br />

*DATA=+2.Ø,+4.Ø,+8.Ø,+Ø.Ø<br />

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

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

*DATA=+Ø.Ø<br />

If you had set the DATPTR comm<strong>and</strong> to increment 2 data elements after every value from the<br />

DATTCH comm<strong>and</strong> (DATPTR1,1,2), the data program would be filled differently <strong>and</strong> the<br />

data pointer would end up pointing to data element #7:<br />

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

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

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

*DATA=+Ø.Ø<br />

3. Recall the Data<br />

from the Data<br />

Program<br />

After storing (teaching) your variables to the data program, you can use the DATPTR comm<strong>and</strong><br />

to point to the data elements <strong>and</strong> the DATi (“i” = data program number) data assignment<br />

comm<strong>and</strong> to read the stored variables to your motion program. You cannot recall more than<br />

one data element at a time; therefore, if you want to recall the data in a one-by-one sequence,<br />

the third integer of the DATPTR comm<strong>and</strong> must be a 1 (this is the default setting).<br />

Chapter 3. Basic Operation Setup 111

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

Saved successfully!

Ooh no, something went wrong!