Hello Guest it is December 15, 2019, 06:39:07 PM

Author Topic: SetMachZero() problem  (Read 976 times)

0 Members and 1 Guest are viewing this topic.

SetMachZero() problem
« on: January 11, 2017, 01:26:48 PM »
Hi, I'm new here and with the mach3. I'm preparing an script to make a manual XY homing.

The problem is that i can't use the standart homing because the system is mounted in the way that a X desplacement requires a x and y motors rotation, and the same for an Y displacement.

Then, I wrote a vb script that work well, except the last step. When I use the SetMachZero(0) and SetMachZero(1), the display shows 0 x machinecoord and 0 y machinecoord. However, whether I send a MDI command the value of the display comebacks to its previous value before the SetMAchZero() execution

Any idea?

This is the script:

Code: [Select]
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

j = 0
Sleep 200
If GetOemLed (830)=0 Then
While GetOemLed (830)=0
If j = 0 Then
Code "G1 X6000 F500"
Sleep 200
j = j+1
End If
Wend
Sleep 200
End If
DoOEMButton(1003)
Sleep 200
Xpos = GetDro(0)
Code "G1 X"&Xpos-10 & "F500"

Sleep 5000

j = 0
Sleep 200
If GetOemLed (833)=0 Then
While GetOemLed (833)=0
If j = 0 Then
Code "G1 Y2000 F500"
Sleep 200
j = j+1
End If
Wend
Sleep 200
End If
DoOEMButton(1003)
Sleep 200
Ypos = GetDro(1)
Code "G1 Y"&Ypos-10 & "F500"

Sleep 2000

SetMachZero(0)
Sleep 200
SetMachZero(1)
Sleep 200
End

Thank you in advance