Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: gantarone on December 03, 2015, 04:48:20 PM

Title: GetVar (2002) doesn't not give correct value!!!!
Post by: gantarone on December 03, 2015, 04:48:20 PM
Hi All,
I have a problem on script Mach3 :
when I try to make a GetVar (2002 ) ,  it return 0  or an other wrong value..... (sometime it give me the correct value)

1 ) I am not using the classical parallel pc but a dedicated card ( Intepcnc 2.1 to control up to 5 axes )
2 ) and the machine is a virtualized Windows XP ( Parallel system on OSX )


If someone is found in the same problem maybe you can help , or find another command like GetVar(2002)
Regards
Simone
Title: Re: GetVar (2002) doesn't not give correct value!!!!
Post by: ger21 on December 03, 2015, 07:00:07 PM
The problem is the plugin for your motion controller does not support the GetVar command. Contact the manufacturer and tell them that there plugin should support GetVar().

Most chinese motion controllers do not support GetVar(), and because of this, probing does not work properly.
Title: Re: GetVar (2002) doesn't not give correct value!!!!
Post by: gantarone on December 04, 2015, 04:54:40 PM
Thanks Gerry!!! you gave me the right advice!!!! :D :D
probably is a problem Manufacturer.....
I found the solution on a French website:
It is French but is understandable
Code:

SetOEMDRO(1000, 2) ' Numéro de l'axe ou faire le probe (0=X, 1=Y, 2=Z)
SetOEMDRO(1001, -90) ' Course maxi (le signe indique le sens de déplacement)
SetOEMDRO(1002, 20) ' Feed rate
SetOEMDRO(1003, 9) ' Numéro de l'entré de plapage (1 à 16
SetOEMDRO(1004, 1) ' état de l'entrée attendu (0 ou 1)
NotifyPlugins(3000)
' Attente fin de probe descente
While (GetOEMDRO(1000) = 0)
Sleep(10)
Wend
'Si succès, lancement de probe lent ver le haut
If (GetOEMDRO(1000) = 1) Then
SetOEMDRO(1000, 2) ' Numéro de l'axe ou faire le probe (0=X, 1=Y, 2=Z)
SetOEMDRO(1001,+10) ' Remontée en Z
SetOEMDRO(1002, 1) ' Feed rate
SetOEMDRO(1003, 9) ' Numéro de l'entré de plapage (1 à 16
SetOEMDRO(1004, 0) ' Attente re-laché de l'entrée 9
NotifyPlugins(3000)
' Attente fin de probe
While (GetOEMDRO(1000) = 0)
Sleep(10)
Wend
If (GetOEMDRO(1000) = 1) Then
ZProbe = GetOEMDRO(1001) ' Lecture de la position de palpage
Z = GetOEMDRO(85) ' Lecture positionactuelle
HPalpeur = 30 ' Déclaration hauteur palpeur
Zero = Z - ZProbe + HPalpe ' Distance erreur liée à deceleration
SetDRO(2, Zero) ' Initialisation zero pièce
Sleep(100)
NewZPos = Zero + 10 ' dégagement 10mm au dessus du capteur

Code "G0 Z"&NewZPos
While IsMoving()
Wend
Else
'Message ("Fin de probe avec erreur palpage lent")
End If
Else
'Message ("Fin de probe avec erreur palpage rapide")
End If