FANUC JUMP AND LBL

  • The simplest solution for your code is to place an END statement or a JMP LBL[100] between line 3 and 4 of your PICK_CONROD program.

    My main issue is that it runs without any satisfied condition it's running the sub program

  • Multiple solutions have been provided. If all your inputs are off, the program will execute label 101. Put a jump label 100 after your three conditional statements.


    Also, learn to use the step button.

  • I personally hate the way Fanuc TP programming forces you to jump around like a monkey on a bungee and quite often can be confusing, although they can deliver the required results too, this is just my personal opinion of mine by the way.


    Robot executes exactly what you code in.

    If the condition evaluation result does not match the argument, then it will shoot through as you are not asking the robot to look for it (I refer to this as shoot through, it's not a Fanuc term).

    So straight away looking at your signal state monitoring, unless one of the signals is in the state you're looking for it will shoot through.


    Many solutions to this problem exist, but the main thing to understand is 'why' this is happening, then you can decide on appropriate solutions that you can also understand too.


    If I was new to programming and Fanuc syntax, I would explore other solutions available, solutions that I can easily recall, understand, and find easier to read to should I need to 'refresh my mind'.


    For example, I like the SELECT as it's much like a menu choice based on the value.

    Assign the 3 DI's to a GI[x] in the input allocation.

    Then you can read the result of all 3 DI's as a binary value which ranges from 0 - 6 (seven values) simply by:


    R[x] = GI[x]

    SELECT R[x] = [value1] [action]= [value2] [action]= [value4] [action] ELSE [action]


    This then simply looks at the individual states, any other state the ELSE action applies.

    Therefore this actions what I want to action per input, and if there are inputs not in the correct state due to malfunction etc, I catch it with the ELSE action which as already mentioned could be to a JMP LBL at the beginning of the program.


    The advantage of this is that you could then use other binary values by simply adding them to the SELECT instruction.


    Again, many solutions available, so I would explore them further before just applying the first thing that works.

    A good direct reference is the branching instructions in the manual.

Advertising from our partners