Which control software are you using or running this?
Hi All,
I'm completely new to G code and I'm using it to control the positioning and firing of a laser for my master's project. I've written the code to make it fire and it works fine, but once I put my code into a loop to fire more than 3 times, some of the laser pulses are missed out. I've written the code out without any loops and it works fine but it's ridiculously long and messy code as any kind of loop - For, While, even using an If - causes some shots to be missed out. I've included the code I have below, any help would be greatly appreciated.
PSOF,1
DW 1
PSOF,0
DWELL 1000
Copying and pasting this 15 times works great, but:
LOOP 15
PSOF,1
DW 1
PSOF,0
DWELL 1000
NEXT
misses out a couple of shots.
Many thanks for any help.
Mike
Similar Threads:
- Need Help!- looping
- Problem- looping
- M98 Looping
- Program Looping
- Sub Looping
Which control software are you using or running this?
This looks like "Basic" not G code for CNC
If it is Basic or Visual
For i= 1 to 15
PSOF,1
DW 1
PSOF,0
DWELL 1000
NEXT i
If its for G code then use DO while Statements
+1
This is what G code looks like:
N0002 G90
N0003 G70
N0005 M145 D0
N0006 AL0.0
N0007 G04
N0008 G41
N0009 M145 D0
N0010 M63
N0011 G160 P1
N0012 G00 X0.709 Y-0.630
N0013 M177
N0014 M65
N0015 AL-15.0
N0016 G01 X0.906 Y-0.630
N0017 M35
N0018 G01 X1.102 Y-0.630
N0019 G01 X3.465 Y-0.630
N0020 AL-30.0
N0021 G01 X4.252 Y-0.630
N0022 G01 X6.614 Y-0.630
N0023 AL-45.0
N0024 G01 X7.402 Y-0.630
N0025 G01 X9.764 Y-0.630
N0026 AL0.0
N0027 G01 X10.551 Y-0.630
N0029 G01 X13.701 Y-0.630
N0030 G01 X13.701 Y-3.630
N0030 G01 X13.701 Y-4.500
N0030 G01 X13.701 Y-3.630
N0031 G01 X10.551 Y-3.630
N0032 M176
N0033 AL-45.0
N0034 G01 X9.764 Y-3.630
N0035 G01 X7.402 Y-3.630
N0036 AL-30.0
N0037 G01 X6.614 Y-3.630
N0038 G01 X4.252 Y-3.630
N0039 AL-15.0
N0040 G01 X3.661 Y-3.630
N0041 M57
N0043 AL-15.0
N0044 G01 X3.465 Y-3.630
N0045 G01 X1.102 Y-3.630
N0046 G01 X0.315 Y-3.630
N0047 M35
N0048 AL0.0
N0049 G01 X1.102 Y-4.418
N0050 G01 X1.102 Y-3.630
N0051 G01 X1.102 Y-1.960
N0052 M58
N0053 G01 X1.102 Y-1.024
N0054 M57
N0055 G01 X1.102 Y-0.630
N0056 G01 X1.102 Y-0.315
N0057 M66
This is what ESSI code looks like:
145+0
5
+50+1650
6
76
51
29
53
122+150
+200+
+600+
122+300
+200+
+600+
122+450
+200+
+600+
122+0
+200+
+300+
77
+
I think you've missed the point.
What your manual is telling you to use is not "G" code. Hence, asking for G code help will get you no where. Even trying the D0 statement at the beginning will be useless because the machine post processor isn't interpreting G code, but something else.
Your best line of support is going to be the manufacturer - the folks who wrote the software.
Best of luck