good morning
I have this macro to drill.
Dim coordinate
Dim PrimoPunto
Open "C:\LAVORI\FORI\myFile.txt" For Input As #1
Line Input #1, PrimoPunto 'leggo la prima riga del file
Close #1
Open "C:\LAVORI\FORI\myFile.txt" For Input As #1
coordinate=Input(LOF(1),#1) 'leggo tutto il file e salvo le coordinate nella variabile NON SO SE OTTENGO UNA SOLA RIGA O TANTE RIGHE
Close #1 ' chiudo il file delle coordinate
Open "C:\LAVORI\FORI\FORI.nc" For Output As #1 'Apro il file per la creazione del programma cnc
Print #1, "G54 G17 G90 G00 G40" & Chr(10)
Print #1, PrimoPunto 'scrive il primo punto
Print #1, "G00 Z50" & Chr(10)
Print #1, "G01 Z5 F500" & Chr(10)
Print #1, "G83 G98 Z-10 Q3 R2 L0 F100" & Chr(10)
Print #1, "(---INIZIO PUNTI MEMORIZZATI-------)" & Chr(10)
Print #1, coordinate ' stampa coordinate foratura
Print #1, " (---FINE PUNTI MEMORIZZATI---------)" & Chr(10)
Print #1, "G80" & Chr(10)
Print #1, "M5 M9" & Chr(10)
Print #1, "G00 Z50" & Chr(10)
Print #1, "M30" & Chr(10)& Chr(13)
Close #1
Speak ("faile convertito") 'Avviso Vocale
Message "FILE SALVATO = C:\LAVORI\FORI\FORI.nc "
it imports a .txt file of survey points:
X15 Y15
X33 Y37
X40 Y45
etc etc
and converts it into gcode to work:
G54 G17 G90 G00 G40
X15 Y15
G00 Z50
G01 Z5 F500
G83 G98 Z-10 Q3 R2 L0 F100
(---INIZIO PUNTI MEMORIZZATI-------)
X15 Y15
X30 Y30
X40 Y40
(---FINE PUNTI MEMORIZZATI---------)
G80
M5 M9
G00 Z50
M30
the problem arises when I launch the machining, the cnc starts going up to Z50 then down to Z5 then down to z1.8 and starts to pitch between Z2 and Z1.8 without going down, I can't solve the problem it's not in my capabilities is there anyone who can help me?
regards