Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: swets on August 01, 2007, 05:56:50 PM
-
is it posible with mach3 to make something like...(pff diffecult that english)
if I push a button , the machine goes too a special place (x,y) and there it goes down (z) slow... tilt a input is make... ?
I want in a corner from my machine make a litle PCB... and connect a wire on the cutter... and wen the cutter touch the PCB , than Z=3
pff i hope every one understands my english... :-)
-
Hey Swets, that can be done pretty easy. In your general config, ports and pins,inputs, you have an input for probe. Instead of wiring your tool, you will insulat your board so it is not grounded through the machine, the tool will be the ground that completes the circuit. On the settings page, far left, 3 DROs for your tool change positions. I have some code that has been copied and pasted together (I'm no VB guru like a lot of these guys) that you could place inside a button on your screen that will do what you want I think.
Brett
-
....... I have some code that has been copied and pasted together (I'm no VB guru like a lot of these guys) that you could place inside a button on your screen that will do what you want I think.
Brett
Hi,
where can i found the code?
so i can study and try it...
-
Hey Swets,
I think this is what you want.
Response = MsgBox ( "Would you like to set your Z height automatically? If so, click OK", 1 ) 'these two lines are for safety
If Response = 1 Then
'Get the tool change pos from the settings page
ChangeX = GetOEMDRO(1200)
ChangeY = GetOEMDRO(1201)
ChangeZ = GetOEMDRO(1202)
Code "G00 G54 Z2" 'This line moves the Z to +2 in work coord to clear your part.
Code "G00 G53 X" & ChangeX & "Y" & ChangeY 'This moves your X and Y to the TCP DROs on the settings page in Machine coord.
Code "G00 G53 Z" & ChangeZ 'This moves your Z to the TCP DROs on the settings page in machine coord
Response = MsgBox ( "Give your machine time to get to the tool change position. Once there, change your tool and click OK to proceed. The next move will be your Z looking for your plate.", 1 )
If Response = 1 Then
CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
PlateThickness =0.062 'You can adjust this number for your plate thickness
ProbeFeed = 5 'Rate the tool will drive to the touch plate
Code "G90 F" &ProbeFeed
If GetOemLed (825)=0 Then
'Code "G4 P5" 'Time to get to the z-plate
Code "G31Z-5 F" &ProbeFeed
While IsMoving()
Wend
Code "G4 P0.25"
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePos
While IsMoving()
Wend
Call SetDro (2, PlateThickness)
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z0.25" 'Change the Z retract height here
Code "(Z axis is now zeroed)"
Code "F" &CurrentFeed
Else
Code "(Z-Plate is grounded, check connection and try again)"
End If
End If
End If
Play with it a little before you try to use it. Try it in the air and make sure the moves are right.
Brett
-
thanks
i gonna try it...