New Fanuc IF THEN ENDIF V8.30 /P52

  • Can anyone provide, without violating copyright, some information on Fanuc’s new IF instruction (regular TPP code, not Karel.)


    There appears to be something beyond the traditional compact IF (where the only “then” is to CALL prog or JMP LBL) and the SELECT [R]


    Now i can use IF and ENDIF, but I cannot find out from my documentation exactly how it works in normal T.P. Program code.


    Thank you.

  • Place your Ad here!
  • The new statement is IF (...) THEN which only executes the lines of code following that statement when the condition you provide is true, up to the next ELSE or ENDIF command. You should use this to replace IF (!...) JMP LBL statements.


    The functionality of the other IF statements has not changed.


    Post any specific examples of code where you might want to use this if you want help converting it to use the new statement. It doesn't really add functionality, it just makes the code a lot more intuitive and easier to read.

  • IF THEN is a cool new feature for 8.3. Basically if your conditional statement is true, then it will run anything you put between the IFTHEN and the ENDIF. If it's false then it skips to the ENDIF and continues on. You can nest IFTHENs inside of IFTHENs when needed. I have found that you can create more robust conditional statements overall with the IFTHEN. The part that's not quite as user friendly is the part in parenthesis. After you select the first part of your statement you have to hit INSERT (F1) to keep adding to it. Also notice that as you add more to the statement, an option appears on F2 to DELETE in case you start adding too many.


    I use both standard IF and IFTHEN statements regularly depending on the situation. Just another tool in the toolbox!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now

Advertising from our partners