Panic,
Thanks for the detailed explanation of the formulas involved to calculate frames.
I did not post my attempts to convert the positional points mentioned because I was attempting to use INV:POS and its my understanding that this function cannot be used with fixed tool interpolation.
Here is the code I currently have gotten to be successful to achieve my end goal, I was just trying to eliminate a manual teaching step from this process.
;teach base frame
;FOLD PTP P1 Vel=100 % PDAT1 Tool[2]:Workpiece2 Base[0] ;%{PE}
;ENDFOLD
;FOLD PTP P2 Vel=100 % PDAT2 Tool[2]:Workpiece2 Base[0] ;%{PE}
;ENDFOLD
;FOLD PTP P3 Vel=100 % PDAT3 Tool[2]:Workpiece2 Base[0] ;%{PE}
;ENDFOLD
GOTO POS32
SET_AREA1_ORIGIN:
frame_error = ComputeFrameFrom3Pts(xp1,xp2,xp3,base_data[3])
if frame_error == 1 then
msgnotify("Area definition points too close together.")
halt
endif
if frame_error == 2 then
msgnotify("Area definition points are collinear.")
halt
endif
base_data[3].x = base_data[1].x
base_data[3].y = base_data[1].y
base_data[3].z = base_data[1].z
GOTO SKIPP
POS32:
;FOLD PTP p1 Vel=100 % PDAT28 Tool[2]:Workpiece2 Base[0] ;%{PE}
;ENDFOLD
;FOLD WAIT Time= 1.0 sec ;%{PE}
WAIT SEC 1.0
;ENDFOLD
;FOLD PTP p32 Vel=100 % PDAT29 Tool[2]:Workpiece2 Base[3] extTCP ;%{PE}
;ENDFOLD
SKIPP:
XP001.A = XP_ORIGIN.A
XP001.B = XP_ORIGIN.B
XP001.C = XP_ORIGIN.C
xp002 = xp32
I would like to eliminate the need to touch up p32 to match p1 once the base frame is calculated with the frames macro.
I have identified this step in the purple colored code above.
I hope this helps explain what I am trying to accomplish as well as where I am at with the coding so far.
Sorry for the delayed responses, I have some conflicting schedules that are currently limiting my ability to fetch code and post it.
Thanks