hello tsaladyga, there are different ways to put the origin
using a system variable is ok, especially if you declare the origin without being near the cnc
instead of :
Code:
OSET2
VC110=1(SETS ACTIVE PALLET)
(*******PART ZERO**********)
(*** B0 COORDINATES *** )
VZOFX[20]=VZOFX[10]+7.000
VZOFY[20]=VZOFY[10]+14.57
VZOFZ[20]=VZOFZ[10]+5.26
VZOFB[20]=0
VZOFX[30]=VZOFX[10]-7.000
VZOFY[30]=VZOFY[10]+14.57
VZOFZ[30]=VZOFZ[10]+5.26
VZOFB[20]=0
RTS
you may use this shorter code:
Code:
NOEX VC110 = 1
G15 H10
G11 X+7 Y+14.57 Z+5.26 ( coordinate system conversion )
// cutting with actual corections
G10
G11 X-7 Y+14.57 Z+5.26 ( coordinate system conversion )
// cutting with actual corections
G10
however, even so, it is too much code; also this is possible :
Code:
O****
NOEX VC110 = 1 ( active pallet )
NOEX VZOFX [ 30 ] = +7 VZOFY [ 20 ] = +14.57 VZOFZ [ 20 ] = +5.26 VZOFB [ 20 ] = 0
NOEX VZOFX [ 30 ] = -7 VZOFY [ 30 ] = +14.57 VZOFZ [ 30 ] = +5.26 VZOFB [ 30 ] = 0
RTS
this last sample requires a determined cnc, thus the origin at the middle of the table is no longer declared inside G15H10, but as the origin of the abso-encoders
and the code can be futher enhanced, so to reduce future edit time :
Code:
O****
NOEX VC110 = 1 ( active pallet )
NOEX VZOFX [ 20 ] = +7 VZOFY [ 20 ] = +14.57 VZOFZ [ 20 ] = +5.26 VZOFB [ 20 ] = 0
CALL OCOPY LV01 = 20 LV02 = 30
NOEX VZOFX [ 30 ] = - VZOFX [ 30 ]
RTS
Code:
OCOPY ( copy work coordinate system; LV01 : source , LV02 : target )
NOEX VZOFX [ LV02 ] = VZOFX [ LV01 ]
NOEX VZOFY [ LV02 ] = VZOFY [ LV01 ]
NOEX VZOFZ [ LV02 ] = VZOFZ [ LV01 ]
NOEX VZOFB [ LV02 ] = VZOFB [ LV01 ]
RTS
kindly