Link to us from your website and promote the community!... Then email us to receive a Free CNC cheat sheet from the CNC Specialty Store!

Facebook Group

Share your CNC information?
...Procedures
...Macro programs
...Articles
...and more

Suggestions or comments?
Please Email Us

Thank you for all your contributions and supporting the CNC community.

Fanuc Macro Variables control commands

fanuc macro variable control commands

Macro Variable Control commands

Purpose Expression Kind of operation

Conditional branch "IF [<conditional expression>]

GOTO n

Branch to sequence number n

n." #j EQ #k (=)

#j NE #k ( )

#j GT #k (>)


Conditional execution "IF [<conditional expression>]

THEN st. Execute macro statement st." #j LT #k (<)

#j GE #k ( )

#j LE #k ( )


Iteration "WHILE [<conditional expression>]

DO m" #j EQ #k (=)

(m=1 2 3) #j NE #k ( )

"If omitted conditional expression,

blocks from DO m to END m are executed eternally." #j GT #k (>)

#j LT #k (<)

#j GE #k ( )

#j LE #k ( )