Ok guys, this is what I came up with today, most of it seems to work, but I still see design flaws. I can't seem to figure how to make it probe in Z, and it would be much better if the probe was running in protected mode (so it fails safe if it hits a clamp or something). The program is for picking up parts that have longer lengths, than widths, and puts the origin at top center. It also checks for parallelism to the X axis.
Code:
(***********************)
(**INCREMENTAL PROGRAM**)
(LENGTH OF RAIL)
VC1=31.1
(WIDTH OF RAIL)
VC2=3.9
(REQ'D PARALLELISM TO X AXIS)
VC3=.0007
(OFFSET TO BE SET)
VC4=1
(***********************)
IF [VATOL NE 31 ]NOPE
M130 M127
G91 G00 X=-[VC1*.4]
(PROBE Y LEFTSIDE)
CALL OO10 PMOD=12 PELI=VC2 PIN=.7
CALL OO20 PHN=50 PY=0
G00 X=[VC1*.8]
(PROBE RIGHT SIDE)
CALL OO10 PMOD=12 PELI=VC2 PIN=.7
CALL OO20 PHN=49 PY=0
(TEST)
IF [ABS[VZOFY[50]-VZOFY[49]] GE VC3]NOUT
(SET Y)
VZOFY[VC4]=[VZOFY[50]+VZOFY[49]]/2
(PROBE X)
G91 G00 X=-[VC1*.4]
CALL OO10 PMOD=11 PELI=VC1 PIN=.7
CALL OO20 PHN=VC4 PX=0
(PROBE Z)
(CALL OO10 PMOD=3 PEI=???)
(CALL OO20 PZ=.2216 PHN=VC4)
M131
GOTO NEND
(ALARMS)
NOPE
G90
VNCOM[1] = 3
MSG(PROBE NOT IN SPINDLE)
VDOUT[992]=1
NOUT
G90
VNCOM[1] = 3
MSG(NOT PARALLEL WITH X AXIS)
VDOUT[992]=1
NEND
G90
G30 P11
M2
I don't have a manual for the probing system on our MB56, (does anyone have one they can share?). I would like to make it so rather than the operator editing the macros in the header, it just asks him for the same information, and he enters it at run time. (So I can lock the program, and he can't edit it) I also have no idea how to make the Z probe work, I pulled the Z section from another program that I run in absolute mode, and it does not seem to like incremental.