66
Gemini GV6K/GT6K Command Reference
recall a data program,
and not create one
, specify only the first integer and not the second integer. For
example,
DATSIZ7
recalls data program #7 (
DATP7
) as the active data program.
Example:
DEL
DATP5
; Delete existing data program #5 (DATP5)
DATSIZ5,200
; Create data program #5 (DATP5) with 200 data elements
DEF
TEACH
; Begin definition of program called TEACH
COMEXC0
; Disable continuous command execution mode
MA1
; Enable the absolute positioning mode
HOM1
; Home (absolute position counter set to zero after homing)
DATPTR5,1,1
; Set data pointer to data element #1 in DATP5, and increment the
; pointer by one element after every DATTCH value or DAT command
REPEAT
; Set up a loop for teaching the positions
JOY1
; Enable joystick mode so that you can start moving the
; axis into position with the joystick. Command processing stops
; here until you activate IN.2 to disable the
; joystick mode and execute the rest of the commands in the
; repeat/until loop (assign the motor positions to the variables and
; then store the positions from the variables to the data program).
VAR1=1PM
; Store the current position in variable #1
DATTCH1
; Store variable #1 into consecutive data elements
WAIT(IN.2=b0)
; Wait for the "joystick release" input to be de-activated
UNTIL(DPTR=1)
; Repeat loop until the data pointer wraps around to data element #1
HOM1
; Home (absolute position counter set to zero after homing)
DATPTR5,1,1
; Set data pointer to data element #1, read one data element at a time
REPEAT
; Set up a repeat/until loop to read all data elements
D(DAT5)
; Read position data from the data program to the distance command
GO1
; Make the move to the positions that were taught
T.2
; Wait 0.2 seconds
UNTIL(DPTR=1)
; Repeat loop until the data pointer wraps around to data element #1
END
; End definition of program called TEACH
DATTCH
Data Teach
Type
Data
Storage
Syntax
<a_><!>DATTCHi<,i,i,i>
Units
i = number of a numeric variable
Range
i = 1-225
Default
n/a
Response
n/a
See Also
[ DAT ], [ DATP ],DATPTR, DATSIZ, DATTCH, VAR
Product Rev
GT6K 6.0
GV6K 6.0
The Data Teach (
DATTCH
) command stores the values from the specified numeric variables (
VAR
) into the
currently active data program
(i.e., the data program specified with the last
DATSIZ
or
DATPTR
command). The value that is in the specified variable at the time the
DATTCH
command is executed is the
value that is stored in the data program.
If the
DATTCH
command is issued without having first issued the
DATSIZ
command, an error will result. If
a zero is entered in the first integer of the
DATSIZ
command (e.g.,
DATSIZØ
), the
DATTCH
command is
disabled.
As indicated by the number of integers in the syntax, the maximum number of variables that can be stored
in the data program per
DATTCH
command is 4. The variables are stored in the data program, starting at the
current location of the data pointer. The data pointer's position can be moved to any data element in any
data program by use of the
DATPTR
command. After each successive
DATTCH
value is stored, the data
pointer will increment by the number specified in the third integer of the
DATPTR
command. Any data
element in the data program can be edited by setting the data pointer to that element and then issuing the
DATTCH
command.
As an example, suppose data program #1 (
DATP1
) is configured to hold 15 data elements (
DATSIZ1,15
),
the data pointer is configured to start at the first data element and increment 1 data element after every
DATTCH
value is stored (
DATPTR1,1,1
), and the values of numeric variables #1 through #4 are already
assigned (
VAR1=2
,
VAR2=4
,
VAR3=8
,
VAR4=64
). If you then enter the
DATTCH1,2,3,4
command, the
www.comoso.com
Содержание Gemini GT6K
Страница 24: ...www comoso com ...
Страница 40: ...www comoso com ...
Страница 344: ...www comoso com ...
Страница 350: ...www comoso com ...