Hello Guest it is April 23, 2024, 07:27:18 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - bartolome.mas

Pages: 1
1
VB and the development of wizards / 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

Pages: 1