What's new
What's new

G-Code IF Statement using an axis position

Jemop430

Plastic
Joined
Dec 30, 2014
Is it possible to use an axis position in an IF statement?

The only examples of IF statements I have seen are using variables.

would the statement that follows work:

IF[A EQ 0]GOTO 10
#3000=10(DIAL IN A0)
N10

I want the program to stop and give an error if the A-axis is not at 0.
 
There is a system variable that stores machine and absolute positions for each axis. I would use that. I do not believe you can just use the axis letter.

Paul
 
In the Custom Macro B Programming Manual, machine coordinate system current position variables are #5021 to #5025, #5021 being "X" axis. Check these in your control, they might vary by control. Workpiece coordinate system variables are #5041 to #5045, but my book doesn't state which coordinate system of G54-G59. This may be whichever one is current. All of these variables will be in your parameter books for your specific Fanuc control. Be careful and check these before just running.

Paul
 








 
Back
Top