RevHaus
Plastic
- Joined
- Oct 31, 2019
- Location
- Illinois, USA
Thank you for taking some time to try and help.
I am running a Romi M27 Lathe, it has a GE Fanuc Series 21i-TB controller.
We are running tube stock, cutting 6 parts from the length sticking out of the chuck, then advancing the tube to do it again.
The program I was given to use runs a single part, has the user adjust the work offset, runs a single part, has the user adjust the work offset, etc.
I am tryin to use Macro B to get the programming to adjust the work offset after each part, for 6 parts, then set its self back out to the very first starting work offset.
I use the part counter to set when the program should change the work offset.
I've successfully wrote and ran another program using the part counter in a similar fashion, so that part should be pretty solid.
Currently I am getting a G code alarm, 010 Improper G-Code.
I'll indicate in my program example where the machine stops running the program and pops the alarm at.
The code that I have come up with is as follows:
IF[#3902GT6]THEN#3902=6
IF[#3902LT6]THEN#3902=6
IF[#3901GT#3902]THEN#3901=0
#3901=#3901
IF[#3901EQ0]GOTO20
IF[#3901GE1]GOTO10
N10 G90 G10 L2 P1 Z0.0 (This is the line that the machine alarms out at)
N20 (FACE PART)
T0202
G40 G80 G90 G95 G97
G0 Z0.2
X7.9
M3 S300
G1 Z0.0 F0.025
X6.0
G0 Z0.1
M5
X18.0
Z-1.0
M00
IF[#3901LE5]GOTO40
IF[#3901EQ6]GOTO30
N30 G90 G10 L2 P1 Z0.0
N40
M30
The first time I run the program it works fine, since the indicated line is skipped.
It's not until the second run through that it alarms out for me.
The book I am using explaining and teaching Macro B programming told me to use those codes for the input.
Where G10 is Data Setting, L2 is Work Coordinate Setting, and P1 tells it to set G54.
It seems like it should work, but something is off. I use the same exact codes the book gives me, so I don't know. I have even tried variations of the L & P, like L0002 & P0001, that didn't work. I have to guess its something dumb with Fanuc where it doesn't know what those codes are or something. It acts like G10 is not a valid code for Data Setting.
The book that the company has that I got the information from is called: Fanuc CNC Custom Macros by Peter Smid.
Any help would be greatly appreciated.
Thank you very much.
Have a great day.
I am running a Romi M27 Lathe, it has a GE Fanuc Series 21i-TB controller.
We are running tube stock, cutting 6 parts from the length sticking out of the chuck, then advancing the tube to do it again.
The program I was given to use runs a single part, has the user adjust the work offset, runs a single part, has the user adjust the work offset, etc.
I am tryin to use Macro B to get the programming to adjust the work offset after each part, for 6 parts, then set its self back out to the very first starting work offset.
I use the part counter to set when the program should change the work offset.
I've successfully wrote and ran another program using the part counter in a similar fashion, so that part should be pretty solid.
Currently I am getting a G code alarm, 010 Improper G-Code.
I'll indicate in my program example where the machine stops running the program and pops the alarm at.
The code that I have come up with is as follows:
IF[#3902GT6]THEN#3902=6
IF[#3902LT6]THEN#3902=6
IF[#3901GT#3902]THEN#3901=0
#3901=#3901
IF[#3901EQ0]GOTO20
IF[#3901GE1]GOTO10
N10 G90 G10 L2 P1 Z0.0 (This is the line that the machine alarms out at)
N20 (FACE PART)
T0202
G40 G80 G90 G95 G97
G0 Z0.2
X7.9
M3 S300
G1 Z0.0 F0.025
X6.0
G0 Z0.1
M5
X18.0
Z-1.0
M00
IF[#3901LE5]GOTO40
IF[#3901EQ6]GOTO30
N30 G90 G10 L2 P1 Z0.0
N40
M30
The first time I run the program it works fine, since the indicated line is skipped.
It's not until the second run through that it alarms out for me.
The book I am using explaining and teaching Macro B programming told me to use those codes for the input.
Where G10 is Data Setting, L2 is Work Coordinate Setting, and P1 tells it to set G54.
It seems like it should work, but something is off. I use the same exact codes the book gives me, so I don't know. I have even tried variations of the L & P, like L0002 & P0001, that didn't work. I have to guess its something dumb with Fanuc where it doesn't know what those codes are or something. It acts like G10 is not a valid code for Data Setting.
The book that the company has that I got the information from is called: Fanuc CNC Custom Macros by Peter Smid.
Any help would be greatly appreciated.
Thank you very much.
Have a great day.