Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: birillo1959 on April 23, 2018, 06:12:22 AM
-
good morning
I downloaded from the site http://www.tweakie.byethost10.com/17.htm
the following script, I have a problem: do not respect me corner, use mm maybe it's the problem? is it possible to modify it?
THANK YOU
Button A script;
Call SetUserLed(1102,1) 'open Klaus's video window
Call SetOemDRO(118,0) 'reset system rotate DRO
Code "(Locate Datum then click Button B)" 'message for status bar
Call SetOemDRO(3,1) 'set slow jog rate to 1%
Button B script;
DoOEMButton (1008) 'zero X axis DRO
DoOEMButton (1009) 'zero Y axis DRO
Code "(Locate Reference then click Button C)" 'message for status bar
Button C script;
Sub Main()
Call SetUserLed(1103,1) 'close Klaus's video window
X1pos = GetOemDRO(800) 'read x axis DRO
Y1pos = GetOemDRO(801) 'read y axis DRO
If (Y1pos=0) Then GoTo Label1 'avoid divide by zero error
b = Atn(X1pos/Y1pos)*(180/(4*Atn(1))) 'calculate angle
b = b - (b*2) 'change sign (+/-)
Code "G0 X0 Y0" 'move to datum
While IsMoving () 'wait for task to be completed
Wend
Xmove = 70.850 'enter your camera offset here
Ymove = 1.070 'enter your camera offset here
Code "G91 G0 X" &Xmove & "Y" &Ymove 'make incremental move
While IsMoving () 'wait while that happens
Wend
Code "G90" 'go back to absolute moves
Call SetOemDRO(118,b) 'set system rotate DRO
Label1:
DoOEMButton (1008) 'zero X axis DRO
DoOEMButton (1009) 'zero Y axis DRO
Call SetOemDRO(3,80) 'reset jog rate to 80%
Code "(Process complete)" 'message for status bar
End Sub
-
This thread relates to the Local System Rotate and how I used it; http://www.machsupport.com/forum/index.php/topic,22932.msg160769.html#msg160769
Tweakie.
-
good morning
thanks Tweakie.CNC for the help. I managed to make it work the problem was mine
I wanted to ask you at the end of the macro inverts the axis (X = y Y = x) and you can modify it? for what I need in the gcode I had to change X with Y, and Y with X. I hope I explained myself.
regards
-
the macro does not swap axis, it is Rotation the X/Y plane,
so if you do a jog in X (on Keyboard) then will both axis move-
anyway the macros's are not for trigonometry Center probe, they are for probing a twisted part.