Definition
set_ref_coord(coord)
Features
This function sets the reference coordinate system.
Parameter
|
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
|
coord |
int |
- |
Reference coordinate system
|
Return
|
Value |
Description |
|---|---|
|
0 |
Success |
|
Negative value |
Failed |
Exception
|
Exception |
Description |
|---|---|
|
DR_Error (DR_ERROR_TYPE) |
Parameter data type error occurred |
|
DR_Error (DR_ERROR_VALUE) |
Parameter value is invalid |
|
DR_Error (DR_ERROR_RUNTIME) |
C extension module error occurred |
|
DR_Error (DR_ERROR_STOP) |
Program terminated forcefully |
Example
Python
p0 = posj(0,0,90,0,90,0)
movej(p0, v=30, a=30)
x1 = posx(370.9, 419.7, 651.5, 90,-180,0)
movel(x1, v=100, a=100) # Base Coordinate basis
uu1 = [-1, 1, 0] # x-axis vector of the user coordinate system (base coordinate basis)
vv1 = [1, 1, 0] # y-axis vector of the user coordinate system (base coordinate basis)
pos = posx(370.9, -419.7, 651.5, 0, 0, 0) # Origin point of the user coordinate system
DR_USER1 = set_user_cart_coord(uu1, vv1, pos) # Sets the user coordinate system.
set_ref_coord(DR_USER1) # Sets DR_USER1 of the user coordinate system to the global coordinate system.
movel([0,0,0,0,0,0],v=100,a=100) # The global coordinate system is used if the reference coordinate system is not specified.
# Moves to the origin point and direction of the DR_USER1 coordinate system.
movel([0,200,0,0,0,0],v=100,a=100) # Moves to the (0,200,0) point of the DR_USER1 coordinate system.