1

**G-Code, CAD, and CAM discussions / Re: Runn Error Line 2**

« **on:**February 29, 2012, 01:45:02 PM »

What is G40.1?

Should I remove it?

Should I remove it?

Hello Guest it is March 28, 2023, 08:24:19 AM

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

1

What is G40.1?

Should I remove it?

Should I remove it?

2

Hi guys I'm getting a Run Error Line 2 unspecified failure.

It is stopping on the line for spindle start.

I can hit any key on the key board and it will start the program but the spindle

dose not start.

When the program starts running a VB scipt editor box appears,

The word DoSpinCW()

I have been generating code with the same cam software for about 5 years

and this is just started happening.

Here is a piece of the code

Thanks for any help

N1 G00 G43 G40.1 G17 G80 G50 G90

N2 G20

N3 (Deep Drill )

N4 M6 T1

N5 G43 H1

N6 M03 S1500

M8

N7 G00 Z0.50000

N8 X-0.30000 Y6.85000

N9 G83 X-0.30000 Y6.85000 Z-0.52197 R0.1 Q0.1 F5.0

N10G80

N11 G00 Z0.50000

N12 G83 X-1.90036 Y7.45000 Z-0.52197 R0.1 Q0.1 F5.0

N13G80

N14 G00 Z0.50000

N15 G83 X-4.10000 Y6.85000 Z-0.52197 R0.1 Q0.1 F5.0

N16G80

N17 G00 Z0.50000

N18 G83 X-6.30000 Y7.45000 Z-0.52197 R0.1 Q0.1 F5.0

N19G80

N20 G00 Z0.50000

N21 G83 X-9.00030 Y6.67013 Z-0.52197 R0.1 Q0.1 F5.0

N22G80

N23 G00 Z0.50000

N24 G83 X-10.69964 Y7.45000 Z-0.52197 R0.1 Q0.1 F5.0

N25G80

N26 G00 Z0.50000

N27 G83 X-12.90000 Y6.85000 Z-0.52197 R0.1 Q0.1 F5.0

N28G80

N29 G00 Z0.50000

N30 G83 X-15.09928 Y7.45000 Z-0.52197 R0.1 Q0.1 F5.0

M9

N31G80

N32 G00 Z5.0

It is stopping on the line for spindle start.

I can hit any key on the key board and it will start the program but the spindle

dose not start.

When the program starts running a VB scipt editor box appears,

The word DoSpinCW()

I have been generating code with the same cam software for about 5 years

and this is just started happening.

Here is a piece of the code

Thanks for any help

N1 G00 G43 G40.1 G17 G80 G50 G90

N2 G20

N3 (Deep Drill )

N4 M6 T1

N5 G43 H1

N6 M03 S1500

M8

N7 G00 Z0.50000

N8 X-0.30000 Y6.85000

N9 G83 X-0.30000 Y6.85000 Z-0.52197 R0.1 Q0.1 F5.0

N10G80

N11 G00 Z0.50000

N12 G83 X-1.90036 Y7.45000 Z-0.52197 R0.1 Q0.1 F5.0

N13G80

N14 G00 Z0.50000

N15 G83 X-4.10000 Y6.85000 Z-0.52197 R0.1 Q0.1 F5.0

N16G80

N17 G00 Z0.50000

N18 G83 X-6.30000 Y7.45000 Z-0.52197 R0.1 Q0.1 F5.0

N19G80

N20 G00 Z0.50000

N21 G83 X-9.00030 Y6.67013 Z-0.52197 R0.1 Q0.1 F5.0

N22G80

N23 G00 Z0.50000

N24 G83 X-10.69964 Y7.45000 Z-0.52197 R0.1 Q0.1 F5.0

N25G80

N26 G00 Z0.50000

N27 G83 X-12.90000 Y6.85000 Z-0.52197 R0.1 Q0.1 F5.0

N28G80

N29 G00 Z0.50000

N30 G83 X-15.09928 Y7.45000 Z-0.52197 R0.1 Q0.1 F5.0

M9

N31G80

N32 G00 Z5.0

3

Thank you for breaking it down for me.

4

Graham could have a little more of your time?

I’ll be cutting my parts next week and I have a few more

questions.

I done a test run and the code repeats perfectly

but I need to split it up.

The code is setup to cut one part and move the part out of the way

and bring the tool down so my wife can reach the draw bar to change

the tool.

It’s moving the part out of the way and bring the tool down 8 times,

can we make it only do that after the last part is cut?

Take a look at the code, I’ll point out the part that needs to be run

after the last parts is cut.

Also there will be 2 tools for this job, how would the code look for

tool # 2?

If you would like you can use the code for tool #1

and repost it for tool#2 as an example.

I would like you to explain the code so I can do this for myself

next time.

I have a Tormach mill and I didn’t see a G52 or a P2 in the G/M code table.

What does the G52 /P2 mean or stand for?

%

M6 T1

G43 H1

M03 S2500

M8

G52 X0

M98 P2

G52 X2.

M98 P2

G52 X4.

M98 P2

G52 X6.

M98 P2

G52 X8.

M98 P2

G52 X10.

M98 P2

G52 X12.

M98 P2

G52 X14.

M98 P2

M9

M5

M30

O0002 What is this O0002 for?

G00 Z 1.00

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100 this code moves the part and

Y-3.0 and brings the tool down

Z - 1.0 for the wife

G00 Z.1

G52 X0

M99

%

I’ll be cutting my parts next week and I have a few more

questions.

I done a test run and the code repeats perfectly

but I need to split it up.

The code is setup to cut one part and move the part out of the way

and bring the tool down so my wife can reach the draw bar to change

the tool.

It’s moving the part out of the way and bring the tool down 8 times,

can we make it only do that after the last part is cut?

Take a look at the code, I’ll point out the part that needs to be run

after the last parts is cut.

Also there will be 2 tools for this job, how would the code look for

tool # 2?

If you would like you can use the code for tool #1

and repost it for tool#2 as an example.

I would like you to explain the code so I can do this for myself

next time.

I have a Tormach mill and I didn’t see a G52 or a P2 in the G/M code table.

What does the G52 /P2 mean or stand for?

%

M6 T1

G43 H1

M03 S2500

M8

G52 X0

M98 P2

G52 X2.

M98 P2

G52 X4.

M98 P2

G52 X6.

M98 P2

G52 X8.

M98 P2

G52 X10.

M98 P2

G52 X12.

M98 P2

G52 X14.

M98 P2

M9

M5

M30

O0002 What is this O0002 for?

G00 Z 1.00

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100 this code moves the part and

Y-3.0 and brings the tool down

Z - 1.0 for the wife

G00 Z.1

G52 X0

M99

%

5

Some times the machines are cheap enough that I would be willing in gut entire

system motors, PLC's etc and start from scratch.

Just a 4th axis for one of these machines can cost $2000-$3000 used and if the controls

hasn't be configured for a 4th axis it can cost big bucks just to up grade.

system motors, PLC's etc and start from scratch.

Just a 4th axis for one of these machines can cost $2000-$3000 used and if the controls

hasn't be configured for a 4th axis it can cost big bucks just to up grade.

6

From time to time I run across a VMC like a Haas,Fadal, Mazak at actions.

They are sold as is where is and I don't want to fall prey to some ones

proprietary controls.

Has anyone retrofitted a commercial VMC with a tool changer with Mach?

I hope I've posted this in the right place.

They are sold as is where is and I don't want to fall prey to some ones

proprietary controls.

Has anyone retrofitted a commercial VMC with a tool changer with Mach?

I hope I've posted this in the right place.

7

Thanks for your time!!

8

Thanks Graham

What is the % for?

What is the % for?

9

Hi guys it's been some time since I've post here.

The code for cutting a part that I've done many times

for my customer. It has 2 tools and I've been cutting them 1 at a time

for a few years now.

My customer placed a order for 200 parts and now I'm building

a fixture to do 8 at a time.

The code that I'm post is for tool 1 and here's and example

of how I have done other code in the past.

A lot of copy and pasting.

Is there a simpler way?

The parts are 2" apart in the X.

M6 T1 CODE FOR 1 PART

G43 H1

M03 S2500

M8

G00 Z 1.00

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

Y-3.0

Z - 1.0

M9

M5

M30

Code below is for 8 parts

M6 T1 PART #1

G43 H1

M03 S2500

M8

G00 Z 1.00

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 2.0

G92 X0.0

G00 Z 1.00 PART#2

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 4.0

G92 X0.0

G00 Z 1.00 PART#3

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 6.0

G92 X0.0

G00 Z 1.00 PART#4

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 8.0

G92 X0.0

G00 Z 1.00 PART#5

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 10.0

G92 X0.0

G00 Z 1.00 PART#6

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 12.0

G92 X0.0

G00 Z 1.00 PART# 7

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 14.0

G92 X0.0

G00 Z 1.00 PART# 8

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 0.0

G92 X0.0

MOVES PART OUT OF THE WAY

AND BRING TOOL DOWN SO WIFE

CAN REACH IT TO CHANGE IT!

Y-3.0

Z - 1.0

M9

M5

M30

The code for cutting a part that I've done many times

for my customer. It has 2 tools and I've been cutting them 1 at a time

for a few years now.

My customer placed a order for 200 parts and now I'm building

a fixture to do 8 at a time.

The code that I'm post is for tool 1 and here's and example

of how I have done other code in the past.

A lot of copy and pasting.

Is there a simpler way?

The parts are 2" apart in the X.

M6 T1 CODE FOR 1 PART

G43 H1

M03 S2500

M8

G00 Z 1.00

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

Y-3.0

Z - 1.0

M9

M5

M30

Code below is for 8 parts

M6 T1 PART #1

G43 H1

M03 S2500

M8

G00 Z 1.00

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 2.0

G92 X0.0

G00 Z 1.00 PART#2

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 4.0

G92 X0.0

G00 Z 1.00 PART#3

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 6.0

G92 X0.0

G00 Z 1.00 PART#4

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 8.0

G92 X0.0

G00 Z 1.00 PART#5

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 10.0

G92 X0.0

G00 Z 1.00 PART#6

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 12.0

G92 X0.0

G00 Z 1.00 PART# 7

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 14.0

G92 X0.0

G00 Z 1.00 PART# 8

Y -.6875

X 0.003

Z-.130

G01 Y.6875 F5.0

Z-.130

X-0.003

Y-.6875

G00 Z.100

X 0.0

G92 X0.0

MOVES PART OUT OF THE WAY

AND BRING TOOL DOWN SO WIFE

CAN REACH IT TO CHANGE IT!

Y-3.0

Z - 1.0

M9

M5

M30

10

good to see you got your part worked out TT and welcome to the forum. what make is the rotory you are using for the 4th.

bill

Hi Bill

It's the 8" model that I bought with my Tormach.