thesidetalker
Hot Rolled
- Joined
- Jan 11, 2015
- Location
- Bay Area, CA
Thought I'd share a new macro I wrote to use DWO on the old control similar to the new one, where you rotate to a new angle, call G254, then move to next XY, Z position. Code is below. On my VF2 I saved it as program 9013, then aliased G254 to it. (parameter 94) I've only done some testing with indicators for now. I haven't run any parts with it just yet.
It uses G52 to modify your work offset, so at the end of program, poweroff, or pressing reset restores any changes. Setting 33 should be on Fanuc.
Just be sure to set the Y/Z center point for your machine.
It uses G52 to modify your work offset, so at the end of program, poweroff, or pressing reset restores any changes. Setting 33 should be on Fanuc.
Just be sure to set the Y/Z center point for your machine.
Code:
%
O09013 (DWO)
G103 P1
(USAGE:)
(USE THIS PROGRAM JUST LIKE)
(DWO ON NGC - ROTATE TO NEW)
(ANGLE, CALL THIS PROGRAM, THEN)
(RAPID TO NEXT XY, Z POSITION)
(BE SURE ROTARY CENTER POINT)
(SETTING BELOW IS GOOD)
(Y-Z ROTARY CENTER)
#12= -9.9957
#13= -16.8942
(CHECK SETTING 33 EQ. FANUC)
IF [ #6033 NE 0 ] THEN #3000= 1 (SETTING 33 NOT FANUC)
(CANCEL G52 OFFSET)
G52 Y0 Z0
(CURRENT WORKOFFSET Y&Z SETTING)
#22= #5022 - #5042
#23= #5023 - #5043
(CURRENT WORKOFFSET ANGLE TO CALCULATE)
#24= #5044
(NEW Y POS)
#32= COS[#24]*[#22-#12]-SIN[#24]*[#23-#13]+#12
(NEW Z POS)
#33= SIN[#24]*[#22-#12]+COS[#24]*[#23-#13]+#13
(SET DIFF AS G52)
G52 Y[#32-#22] Z[#33-#23]
G103
M99
%