Hello Guest it is October 19, 2021, 06:53:58 PM

Author Topic: help with torch height  (Read 3347 times)

0 Members and 1 Guest are viewing this topic.

Re: help with torch height
« Reply #10 on: June 08, 2016, 04:36:05 PM »
Here is the M3 file-

Sub main()

Dim Xaxis As Double   'coordonnées actuelles
Dim Yaxis As Double
Dim X_1axis As Double   'coordonnées passées
Dim Y_1axis As Double
Dim DeltaX As Double
Dim DeltaY As Double
Dim XYLimit As double   'limit defini par l'opérateur.

'***************************************************************************
'Début de programme
'***************************************************************************

If getuserled(1001) = 0 Then   'Vérification mode TRIAL
GoTo Trial_no         'Pas en mode TRIAL
Else
GoTo Trial_yes         'en mode TRIAL
End If

Trial_no:         'lorsque pas en mode TRIAL effectue la routine de plate sensing

If getuserled(1002) = 0 Then   'Vérification mode PSMODE
GoTo sortie         'Pas en mode PSMODE

            'en mode PSMODE
End If


'***************************************************************************
'Routine qui fait le calcul pour vérifier si la torche dépasse la zone
'définie à ne pas faire de plate sensing
'***************************************************************************

X_1axis = getvar(1001)      'Récupération des variables X,Y mémorisées lors du plate sensing
Y_1axis = getvar(1002)      

Xaxis = Getoemdro(800)      'Récupération de la valeur actuelle de X
Yaxis = Getoemdro(801)      'Récupération de la valeur actuelle de Y
XYLimit = Getoemdro(1003)   'Récupération de la valeur de la limit

DeltaX = Xaxis - X_1axis
DeltaY = Yaxis - Y_1axis

'MsgBox (deltax)
'MsgBox (deltay)
'MsgBox (xylimit)

If getuserled(1003) Then

   If Abs(DeltaX) > XYLimit Then
   setuserled(1003,0)
   GoTo label1
   End If

   If Abs(DeltaY) > XYLimit Then
   setuserled(1003,0)
   GoTo label1
   End If
GoTo sortie


Else
GoTo label1
End If





'***************************************************************************
'label1:         Routine qui prend en charge le plate sensing
'            et ajuste le Z à la hauteur de coupe
'***************************************************************************

label1:

If getuserled(1003) =0 Then
         setvar (1001, Xaxis)      '1001 = uservariable = valeur de X lors du plate sensing
         setvar (1002, Yaxis)      '1002 = user variable = valeur de Y lors du plate sensing
Else         
End If
ActivateSignal (OUTPUT4)
code ("G28.1z0")
While IsMoving()
Wend
deactivateSignal (OUTPUT4)
Setuserled(1003,1)         'LED du MODE SPS est ON

         

'***************************************************************************
'            Sortie du programme
'***************************************************************************

Sortie:
code ("g00z0.20")      'ajuste le Z à la hauteur de coupe
While IsMoving()
Wend
DoSpinCW()            'Start Plasma

Trial_yes:            'en Mode TRIAL skip la procédure de plate sensing et start plasma.


End Sub

M15 file-
deactivateSignal (output3)
code ("g04 p0.5")


I noticed that my profile.xml is in the macros folder as well as the mach3 root folder. However, they are different ie do not contain the same information        
Re: help with torch height
« Reply #11 on: June 08, 2016, 04:43:13 PM »
Here is a portion of what i believe is my profile.
Like I said, the file is huge I can't post it all.


Post edited - see reply #13 for the complete .xml file.
« Last Edit: June 09, 2016, 02:11:19 AM by Tweakie.CNC »
Re: help with torch height
« Reply #12 on: June 08, 2016, 04:47:51 PM »
For the XML, you'll need to click on the reply button below the post to be able to attach the file, not just copy and past it (sorry, I should have explained)
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”
Re: help with torch height
« Reply #13 on: June 08, 2016, 05:06:27 PM »
ahhh there we go. Here is the profile.xml