Hello Guest it is April 26, 2025, 04:32:49 PM

Author Topic: macro hole correction  (Read 12517 times)

0 Members and 1 Guest are viewing this topic.

Re: macro hole correction
« Reply #10 on: August 18, 2024, 01:05:31 PM »
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

Offline Graham Waterworth

*
  • *
  •  2,779 2,779
  • Yorkshire Dales, England
Re: macro hole correction
« Reply #11 on: August 18, 2024, 08:51:39 PM »
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.

Without engineers the world stops
Re: macro hole correction
« Reply #12 on: August 19, 2024, 02:00:27 AM »
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

Offline TPS

*
  •  2,574 2,574
Re: macro hole correction
« Reply #13 on: August 19, 2024, 02:18:16 PM »
you can try this:

Code: [Select]
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 "


anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: macro hole correction
« Reply #14 on: August 19, 2024, 02:52:26 PM »
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