Hello Guest it is April 19, 2024, 04:02:48 PM

Author Topic: macro correction help  (Read 1320 times)

0 Members and 1 Guest are viewing this topic.

macro correction help
« on: October 29, 2022, 02:34:42 AM »
good morning
I have a problem with this keyboard macro I have tried to modify it (but I have not succeeded) but it is not in my capacity the problem is this I load the file gcode:



o0001

n1   M1299
n2   M40
%
n20  G90
n30  G0 Z #110
n40  #103=0 
n70  #106 = [#100 + #102 * COS[#103]]
n71  #107 = [#101 + #102 * SIN[#103]]
n73  G0 X #106 Y #107
n74  G1 Z #111
n75  G31    X#100 Y#101


%
n72  M98 P2 L#108
N73  G0 Z#110
N73  M41
N74  m30

o0002 (sub)
n80  #105=[#103+#104]
n90  #106 = [#100 + #102 * COS[#105]]
n100 #107 = [#101 + #102 * SIN[#105]]
n101 G90
n120 G0 X #106 Y #107
n110 G31 X#100 Y#101
 
n121 #103 = #105
n131 m99





the file calls the macro M1299:


' G31 Polar Array Calibration Macro V1.00
Xpos= getdro(0)
Ypos= getdro(1)
Pspeed= Question (" VELOCITA' TASTATURA SONDA")
Rleg= Question ("LUNGHEZZA PEZZO DIVISO 2 + 10")
Linc= Question ("ANGOLO SPOSTAMENTO SONDAGGIO")
SafZ= Question ("SPOSTAMENTO SICURO ASSE  Z")
Phgt= Question ("DISCESA INGRESSO SONDA")
Spnt= Question (" INGRESSO SONDA, 0 ASSE X A ORE 6")
Tdeg= Question ("LUNGHEZZA TASTATURA IN GRADI")
Nrep= (Tdeg / Linc)

Setvar (100 , Xpos)
Setvar (101 , Ypos)
Setvar (102 , Rleg)
Setvar (104 , Linc)
Setvar (108 , Nrep)
Setvar (109 , Pspeed)
Setvar (110 , SafZ)
Setvar (111 , Phgt)
Setvar (103 , Spnt)
Code " F#109"


and starts withcc " Question (" VELOCITA' TASTATURA SONDA") " then the second measure then the third etc. etc.I would like the settings to be all visible and I changed the macro to:
 

'response = MsgBox ("TASTATURA ARRAY")
   Begin Dialog TextBoxSample 100,50,450,220,"TASTATURA ARRAY"
   Picture 295, 9, 145, 168, "TASTATURA.BMP"
      OKButton 60,190,40,14
      GroupBox 5,5,280,170,"  IMPOSTAZIONI  ",.GroupBox1
      Text 100,22,180,8,"VELOCITA' TASTATURA SONDA"'Pspeed
      TextBox 11,20,80,14,.TextBox1
        Text 100,42,180,8,"LUNGHEZZA PEZZO DAL CENTRO DIVISO 2"'Rleg
      TextBox 11,40,80,14,.TextBox2
        Text 100,62,180,8,"ANGOLO SPOSTAMENTO SONDAGGIO"'Linc
      TextBox 11,60,80,14,.TextBox3
        Text 100,82,180,8,"SPOSTAMENTO ALTEZZA SICURO ASSE  Z"'SafZ
      TextBox 11,80,80,14,.TextBox4
        Text 100,102,180,8,"ALTEZZA DISCESA INGRESSO SONDA"'Phgt
      TextBox 11,100,80,14,.TextBox5
       Text 100,122,180,8,"INGRESSO SONDA   0 ASSE X A ORE 6"'Spnt
      TextBox 11,120,80,14,.TextBox6
        Text 100,142,180,8,"LUNGHEZZA TASTATURA IN GRADI"'Tdeg 
      TextBox 11,140,80,14,.TextBox7
        Text 50,160,220,8,"@@  ATTENZIONE @@ POSIZIONARSI AL CENTRO DEL PEZZO"'Tdeg
       
  End Dialog
 
   Dim Dlg1 As TextBoxSample
   Dialog Dlg1
   Pspeed = CDbl(Dlg1.TextBox1)
   Rleg = CDbl(Dlg1.TextBox2)
   Linc = CDbl(Dlg1.TextBox3)
   SafZ = CDbl(Dlg1.TextBox4)
   Phgt = CDbl(Dlg1.TextBox5)
   Spnt = CDbl(Dlg1.TextBox6)
   Tdeg = CDbl(Dlg1.TextBox7)
   
' G31 Polar Array Calibration Macro V1.00
Xpos= getdro(0)
Ypos= getdro(1)

Nrep= (Tdeg / Linc)

Setvar (100 , Xpos)
Setvar (101 , Ypos)
Setvar (102 , Rleg)
Setvar (104 , Linc)
Setvar (108 , Nrep)
Setvar (109 , Pspeed)
Setvar (110 , SafZ)
Setvar (111 , Phgt)
Setvar (103 , Spnt)
Code " F#109"

End


to work it works, the problem is that it appears 2 times, the first time I load the gcode file the second when I start processing. is there anyone who can help me to correct / modify it since my skills are limited? I hope I have explained
  I thank anyone who can help me





Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: macro correction help
« Reply #1 on: October 29, 2022, 06:22:59 AM »
Config -> General Config -> ignore M calls while loading
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: macro correction help
« Reply #2 on: October 29, 2022, 07:17:51 AM »
OK IT WORKS, thanks TPS for the help (once again you solved the problem for me !!!) :) :)