JMP/LBL

From Industrial Robotics & Automation - Fanuc Teach Pendant Programming
How to add the JMP LBL and LBL instructions

This page details the jump and label instructions available on the FANUC Teach Pendant Programmers. Jump and Label instructions do not involve motion. They are simply program operations with a directive to go to a line and a label for that destination line. This article is part of a series on Non-Motion instructions.

Label Instruction

LBL [ 1 ] Label Instruction

Instruction Syntax

This instruction consists of a mnemonic “LBL” followed by a variable.


When this instruction is reached

Nothing happens. It is treated as if it were a blank line. When stepping through the program, you will have to step once for each label instruction.


When to add this instruction

This labels a line so any jump instructions will know where to go. A label line is also a good place to comment your code.


How to add this instruction

Use this button to get to the menu of non-motion instructions.


In the Non-Motion Instructions menu, select the “JMP/LBL” Category. In the “JMP/LBL” menu, select “LBL []”. Once added, type the label number and press enter.


What else is needed to use this instruction

Nothing. It can be placed in a program with no adverse effects.


Valid Variables

Any number between 1 and 32766.


Special Notes

You don’t have to go in order when choosing label numbers, they can be anything.


There can only ever be one of each label. For example, if you put down two LBL [1] instructions, it will alert you with an asterisk next to the instruction. * Think of them like phone numbers. If two phones had the same number, both would ring, and it would be impossible to know which one the intended destination is.

Jump Label Instruction

JMP LBL [ 1 ] Jump Instruction
[ R[1] ]


Instruction Syntax

This instruction consists of a mnemonic “JMP LBL” followed by a variable.


When this instruction is reached

The program’s pointer will jump up (or down) to wherever that label happens to be.

Anything between the jump and its destination is ignored. The operation is unconditional.


When to add this instruction

Use this instruction whenever you need to redirect your program to another part of the same program every time it is reached.


How to add this instruction

In the Non-Motion Instructions menu, select the “JMP/LBL” Category.

Use this button to get to the menu of non-motion instructions.

In the “JMP/LBL” menu, select “JMP LBL []”.

Once inserted, insert the label number.

If you want to insert a register, select ”Indirect” in the on screen options and type the register number.


What else is needed to use this instruction

A LBL instruction with the associated number, somewhere else in the code.


Valid Variables

Direct – Any number between 1 and 32766.

Example: LBL [7]

Indirect – A register containing any number between 1 and 32766.

Example: LBL [R[32]]


Special Notes

The JMP instruction on its own is unconditional, but it can be a resulting action of a conditional instruction. If the line begins with a condition, see that condition’s detail page.