Hello Guest it is June 14, 2025, 05:35:13 PM

Author Topic: macro hole correction  (Read 13238 times)

0 Members and 1 Guest are viewing this topic.

macro hole correction
« 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



Offline Graham Waterworth

*
  • *
  •  2,783 2,783
  • Yorkshire Dales, England
Re: macro hole correction
« Reply #1 on: August 17, 2024, 07:44:38 PM »
Have you tried turning the softlimits off.
Without engineers the world stops
Re: macro hole correction
« Reply #2 on: August 18, 2024, 01:22:14 AM »
Good morning Graham Waterworth
yes I tried to deactivate softlimits but it didn't solve the problem

Offline TPS

*
  •  2,592 2,592
Re: macro hole correction
« Reply #3 on: August 18, 2024, 03:04:01 AM »
from the manual:


The L number is optional and represents the number of repeats. L=0 is not allowed.
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 #4 on: August 18, 2024, 03:50:03 AM »
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

Offline TPS

*
  •  2,592 2,592
Re: macro hole correction
« Reply #5 on: August 18, 2024, 03:52:48 AM »
The L number is optional...

so IMHO it should be ok to without it.
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 #6 on: August 18, 2024, 04:28:21 AM »
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

Offline TPS

*
  •  2,592 2,592
Re: macro hole correction
« Reply #7 on: August 18, 2024, 04:36:56 AM »
your programm contains the first point two times:

Code: [Select]
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
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 #8 on: August 18, 2024, 04:45:52 AM »
I deleted it, now the first hole is drilled at X0 Y0 when it should be at X15 Y15

Offline TPS

*
  •  2,592 2,592
Re: macro hole correction
« Reply #9 on: August 18, 2024, 10:34:44 AM »
this is runnig here correct:

Code: [Select]
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
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.