BRAND.03 / R-30iA + R-30iB
The teach-pendant language and the Pascal-derived host language that drive every yellow robot on the line.
Every FANUC controller (R-30iA, R-30iB, R-30iB Plus) ships with two programming surfaces. TP — Teach Pendant — is the line-numbered language operators record live: J P[1] 100% FINE, DO[1]=ON, WAIT DI[1]=ON. KAREL is FANUC's structured Pascal-derived host language, compiled into .pc files and used for everything that doesn't fit on a pendant — vision, sockets, file I/O, custom motion logic. Switch between the two below.
TP programs are recorded line-by-line on the teach pendant. Each line is either a motion (J/L/C), an I/O (DO[]/RO[]), a flow keyword (IF/JMP LBL/CALL), or a register/system action. END marks the program end.
J P[1] 100% FINE L P[2] 500mm/sec FINE DO[1]=ON WAIT 0.5(sec) END
J is joint motion (point-to-point, fastest). L is linear (Cartesian) at a given mm/sec. C is circular through an auxiliary point. Each motion ends with FINE (stop) or CNTn (blend).
J P[1] 100% FINE L P[2] 500mm/sec CNT50 C P[3] P[4] 200mm/sec FINE
P[n] is a taught position constant. PR[n] is a position register you can read or write at runtime; PR[n,j] addresses one element (X..R, j=1..6). Use PR[] for online math and Offset/Tool_Offset.
PR[1]=P[2] PR[1,3]=PR[1,3]+50 L PR[1] 500mm/sec FINE
UFRAME_NUM picks the active user frame (work-object). UTOOL_NUM picks the active tool frame (TCP). Switching frames mid-program reinterprets all subsequent motion targets.
UFRAME_NUM=1 UTOOL_NUM=2 L P[1] 500mm/sec FINE
DO[] / RO[] write peripheral / robot digital outputs. DI[] / RI[] read inputs. GO[] / GI[] read or write a group of bits as a single value. WAIT DI[1]=ON blocks until the input asserts.
DO[1]=ON WAIT DI[2]=ON GO[1]=5
TP uses IF cond,JMP LBL[n] for conditional jumps and JMP LBL[n] for unconditional jumps. CALL invokes another TP program. FOR/ENDFOR iterates with a register counter.
FOR R[1]=1 TO 3 IF DI[1]=ON,JMP LBL[10] L P[2] 500mm/sec FINE LBL[10] ENDFOR
| Instruction | Category | Purpose | Example |
|---|---|---|---|
| J | Motion | Joint move (point-to-point, fastest, path not constrained) | J P[1] 100% FINE |
| L | Motion | Linear (Cartesian) move at a specified TCP speed | L P[2] 500mm/sec FINE |
| C | Motion | Circular move through an auxiliary point | C P[3] P[4] 200mm/sec CNT50 |
| A | Motion | Arc-circular continuous (arc welding option) | A P[5] 100mm/sec CNT100 |
| FINE | Motion | Termination type — robot stops exactly at the point | L P[2] 500mm/sec FINE |
| CNTn | Motion | Termination type — blend with tolerance n (0..100) | L P[2] 500mm/sec CNT50 |
| PR[] | Position | Use a position register as the move target | L PR[1] 200mm/sec FINE |
| Offset | Motion | Apply an offset register (PR) to the next motion target | L P[1] 200mm/sec FINE Offset,PR[5] |
| Tool_Offset | Motion | Apply a tool-frame offset to the next motion | L P[1] 200mm/sec FINE Tool_Offset,PR[3] |
| DO[] | I/O | Set or pulse a digital output | DO[1]=ON |
| DI[] | I/O | Read a digital input | IF DI[1]=ON,JMP LBL[10] |
| RO[] | I/O | Robot digital output (peripheral) | RO[1]=ON |
| RI[] | I/O | Robot digital input (peripheral) | WAIT RI[1]=ON |
| GO[] | I/O | Set a group output (multiple bits as a value) | GO[1]=5 |
| GI[] | I/O | Read a group input | R[1]=GI[1] |
| AO[] | I/O | Set an analog output | AO[1]=R[2] |
| PULSE | I/O | Pulse a DO for a fixed time | DO[3]=PULSE,0.5sec |
| WAIT | Wait | Wait a fixed number of seconds | WAIT 0.5(sec) |
| WAIT (cond) | Wait | Wait until a condition becomes true | WAIT DI[1]=ON |
| WAIT TIMEOUT | Wait | Wait with a timeout label | WAIT DI[1]=ON TIMEOUT,LBL[99] |
| IF | Flow | Conditional jump or call | IF R[1]>5,JMP LBL[20] |
| JMP LBL[] | Flow | Unconditional jump to a label | JMP LBL[10] |
| LBL[] | Flow | Define a label (jump target) | LBL[10] |
| CALL | Flow | Call another TP program | CALL PICK_PART |
| RUN | Flow | Run a program in the background (multitasking) | RUN MONITOR |
| END | Flow | Marks the end of the program | END |
| ABORT | Flow | Abort program execution | ABORT |
| PAUSE | Flow | Pause until operator presses CYCLE START | PAUSE |
| FOR | Flow | Start of a counted loop (FOR/ENDFOR) | FOR R[1]=1 TO 5 |
| ENDFOR | Flow | End of a FOR loop | ENDFOR |
| SELECT | Flow | Multi-way branch on a register value | SELECT R[1]=1,JMP LBL[1] |
| R[] | Register | Numeric register (integer or real) | R[1]=R[1]+1 |
| R[]=expr | Register | Arithmetic on registers | R[2]=R[1]*10 |
| PR[i,j] | Position | Read or write one element of a position register (X..R) | PR[1,3]=200 ; Z = 200 |
| P[] | Position | Taught position constant (recorded by the operator) | L P[1] 500mm/sec FINE |
| UFRAME_NUM | System | Select the active user frame | UFRAME_NUM=1 |
| UTOOL_NUM | System | Select the active tool frame (TCP) | UTOOL_NUM=2 |
| OVERRIDE | System | Set the global speed override (%) | OVERRIDE=80 |
| PAYLOAD | System | Switch the active payload schedule | PAYLOAD[1] |
| TIMER[] | System | Start, stop, or reset a timer | TIMER[1]=START |
| MESSAGE | System | Display a message on the teach pendant | MESSAGE[Cycle complete] |
| ! | Misc | Comment to end of line (TP convention) | ! Pick station setup |