586,100 active members*
2,914 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2012
    Posts
    3

    GOTO STATEMENT

    Gentlemen,
    I seen in a Fanuc book that looked like two ways to program a GOTO Statement:

    GOTO2
    GOTO#20

    The way it reads both should go to N2
    I tried this on a Mazak VMC with a M-Plus control and only GOTO2 works and not GOTO#20. Does this only work on Fanuc controls?
    I haven't had a chance to get on one and see, so I thought I would ask my CNC Brothers.

    Thank You

  2. #2
    Join Date
    May 2013
    Posts
    128
    what is the series of fanuc control you are using ?

  3. #3
    Join Date
    Aug 2012
    Posts
    3
    18i and 31i

  4. #4
    Join Date
    Oct 2012
    Posts
    84
    #20 should be looking for the Variable 20. I think this would be a local variable to the program or sub in which it is being run. If I remember right this is one that is set to null when reset is hit. Try setting the variable in your program. Like #20=50 . Then the goto#20 would be goto50.

  5. #5
    Join Date
    Aug 2011
    Posts
    2517
    the Mazak macro is slightly different to standard Fanuc macro and has less functionality in some cases.
    either way you would only use #20 (or #number) if your program is doing calculations and putting numbers into variables and your program is doing the thinking about which line it should jump to based on those variables (this would require a lot of smart programming techniques).
    otherwise if you know you want to do a jump to a specific line just put GOTO 20

Similar Threads

  1. Error in IF, GOTO statement. LC40 OSP5000
    By jrolands in forum Okuma
    Replies: 10
    Last Post: 05-05-2013, 08:10 PM
  2. IF THEN statement won't run
    By mikey B in forum Parametric Programing
    Replies: 7
    Last Post: 09-30-2011, 12:38 AM
  3. Fanuc Operator Message/Comment/Statement
    By christinandavid in forum Fanuc
    Replies: 6
    Last Post: 01-28-2010, 01:53 AM
  4. Using an IF statement inside a While looping
    By ggborgen in forum Parametric Programing
    Replies: 6
    Last Post: 06-23-2009, 06:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •