<< Prev        Next >>

ID : 194

Drive

Function

To move each axis to a relative position.

Syntax

Drive[ @pass start displacement] relative travel distance[, motion option]

Guaranteed Entry

Pass start displacement
Designate the pass start displacement that specifies execution time of the next line. This is an optional value. This should be "@0" if this is omitted. Refer to Pass Start Displacement.
Relative travel distance
There are two ways to specify the relative travel distance: Specify the motion target axes (including extended-joints) and the relative travel distances from the respective current position; Specify all axes by joint type data.
Motion option
A motion option can be specified. Ex option and ExA option are not available.

Description

Each axis moves from the current position to a designated relative position. More than one axis can be specified.

To execute this statement, the task must acquire target axis control.

Specifying Relative Travel Distance

Specify the relative travel distance as follows:

Individually designating single axis

Enclose the axis number and relative travel distance in brackets "()" to specify them in a batch.

Axis number is specified by integer type data. Axis number for which the task has no control cannot be specified.

For relative travel distance, single precision real number type or joint type data can be designated. If joint type data is designated, elements other than specified axis elements will be ignored.

To specify more than one axis, separate multiple sets of an axis number and relative travel distance in brackets by comma(s).

'Example of individually specifying axes by Drive statement
Drive (7, 30) 'Move the axis 7 by +30 deg
Dim aaa As Joint, bbb As Joint
aaa = J(10, 20, 30, 40, 50, 60, 70, 80)
bbb = J(11, 12, 13, 14, 15, 16, 17, 18)
'Move the axes 1, 7 and 8 by +10 degrees, +70 degrees and +18 degrees relative to 
the current position, respectively. Drive (1,10), (7,aaa), (8, bbb)
Specifying all axes in a batch
To move the target axes simultaneously, enter the relative travel distances of axes where the task has the axis control in the corresponding elements of the joint-type data. Components of axes for which the task has no control are ignored.
'Example of specifying all axes
Drive J[10]

Related Terms

DriveA

Attention

When the same axis is specified twice in an instruction, the latter specification is given priority.

Drive (7, 50), (7, 100) 'The axis 7 moves by +100 [Degree or mm].

Example

'!TITLE "Relative Motion of Each Axis"
' Motion of each axis: the axes 1 through 4
Sub Sample_Drive

  TakeArm Keep = 1

  ' Move the axis 4 by 15 degrees (DEG) from the current position
  Drive ( 4, 15 )

  Dim aaa As Single
  Dim bbb As Single

  aaa = 10.0
  bbb = 5.0

  ' Move the axes 1, 2 and 3 from the current position by 0.78 (rad), 10 degrees and 5 degrees, 
respectively Drive( 1, RadDeg( 0.78 ) ), ( 2, aaa ), ( 3, bbb ) End Sub

ID : 194

<< Prev        Next >>