Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: birillo1959 on August 17, 2024, 09:10:17 AM
-
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
-
Have you tried turning the softlimits off.
-
Good morning Graham Waterworth
yes I tried to deactivate softlimits but it didn't solve the problem
-
from the manual:
The L number is optional and represents the number of repeats. L=0 is not allowed.
-
good morning TPS
I tried to eliminate "L0" and it seems to work (tried in vain), is it ok like this or do I have to modify "L?" programming is at 0 it is not in my capabilities.
thanks for the help tps
-
The L number is optional...
so IMHO it should be ok to without it.
-
OK TPS, I tried on a piece of wood without "L0" and it seems to work but it gives me an error, the first point executes it 2 times, let me explain: the txt file:
X15 Y15
X33 Y37
X40 Y45
etc etc
I convert it then I launch it and "x15 Y15" is executed 2 times, is there a way to correct it?
I apologize if I take advantage of your availability
regards
-
your programm contains the first point two times:
G54 G17 G90 G00 G40
X15 Y15 '<- first time at X15 Y15
G00 Z50
G01 Z5 F500
G83 G98 Z-10 Q3 R2 L0 F100
(---INIZIO PUNTI MEMORIZZATI-------)
X15 Y15 '<- second time at X15 Y15
X30 Y30
X40 Y40
(---FINE PUNTI MEMORIZZATI---------)
G80
M5 M9
G00 Z50
M30
-
I deleted it, now the first hole is drilled at X0 Y0 when it should be at X15 Y15
-
this is runnig here correct:
G54 G17 G90 G00 G40
G00 Z50
X15 Y15
G01 Z5 F500
G83 G98 Z-10 Q3 R2 F100
(---INIZIO PUNTI MEMORIZZATI-------)
(X15 Y15)
X30 Y30
X40 Y40
(---FINE PUNTI MEMORIZZATI---------)
G80
M5 M9
G00 Z50
M30
-
OK TPS
first of all I apologize if I abuse your patience, your modification works well, the problem is that every time I have to open and modify the created gcode, would it be possible to insert the modification in the macro published at the beginning of the discussion?
best regards
-
L0 in a canned cycle tells the cycle not to drill/bore until the next position line. If you omit the L0 it will do the operation as soon as it reads the G83 line so I would say it should be there.
-
Good morning
OK Graham Waterworth I'll start by saying that I'm almost at 0 in programming (it's not in my capabilities) if I remove "L0" the gcode works fine, the problem as I published in previous posts is that the first hole is executed twice, if I insert "L0" it goes down to Z2 and starts to pitch between Z2 and Z1 and doesn't go down. I can't figure it out.
regards
-
you can try this:
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
TempI=InStr(2,coordinate,"X")
coordinate=Right(coordinate, Len(coordinate) - TempI+1)
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, "G00 Z50" & Chr(10)
Print #1, PrimoPunto 'scrive il primo punto
Print #1, "G01 Z5 F500" & Chr(10)
Print #1, "G83 G98 Z-10 Q3 R2 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 "
-
Good evening TPS
I tried the macro and it works fine !!!!!!!!!!!!!
I added a line for the spindle after:
Print #1, "G00 Z20" & Chr(10)
Print #1, "M3 S2500" & Chr(10 ) <-------
it seems to work is it ok or do I have to change position?
thanks again for the help
regards