6a Roboguide Call - Jump - Label
6a Roboguide Call - Jump - Label
NOTE: Caution calling a Program to a Subprogram 1 then calling a Subprogram from Subprogram 1. This makes it difficult to sort
through the code during troubleshooting process
1. Open RoboGuide > Open BHS Fanuc Robotic Arm Workcell “Student Last Name”
2. Create a New Program called Shapes_”Student Last Name”
NOTE: On the Physical Robots we will use Program MAIN to be able to run in Cycle Start Mode (Production Mode with a
speed limit of 250 mm/sec)
3. Set UFrame and and Tool Frame > Insert Blank Space
4. Calling a Program
NOTE: This program will not set PR[1] (HOME) position because each of the shapes programs sets that. If operator was
to create this project from scratch knowing each program would be called then PR[1] (HOME) would be set in the main
program Shapes_”Student_Last_Name”
a. Select New Instruction > Select CALL > Select CALL PROGRAM
d. .TP Program List will appear > Arrow Down to Rectangle_”Student_Last_Name” > Select Hardkey Enter
SAVE Workcell
5. Label/Jump Commands
Label/Jump Commands: Labels can be placed in the program where the operator can Jump to that Label based on
conditional statements received from input, output or sensors. In order to Jump to a specific part of the program the
operator needs to set a Label [#]. It is recommended to add a remark/comment to identify the label number.
NOTE: It is not possible to jump between programs.
b. Place Cursor on Line 4 > Select New Instruction > Select JMP/LBL > Select LBL [_]
c. Adding a Comment
a. Place Cursor on the Label Number > Press Hardkey Enter > Type in Comment: Start of Program
d. Place cursor at END command > Insert 1 Line above
e. Position Cursor on Line 16 > Select NEW INSTRUCTION > Select JMP/LBL > Select JMP LBL [_] > Arrow over between
braces > Set Value to 1
Select NEW
INSTRUCTION >
Select JMP/LBL
6. Conditional Statement
Conditional Statements are If/Then statements that will make a comparison between two values (= , <, >, <=, >=, <> (not
equal) if the statement is TRUE then the program will execute the next line of code, If the condition statement is
false the program will ignore the next line of command.
NOTE:
c. Setting a Counter Variable: Variables are set as Registers. Operator may set registers to keep track of
various data points.
i. Registers Menu: Select Hardkey Data > Select Registers: Option 1
ii. Arrow over to R[1]: > Press Hardkey Enter > Select Options/KeyBD > Select Softkey Keyboard or F5>
Name: Loop Counter
Select … = … + …
3. Select R [_] > Select Keyboard > Set to 1
4. Cursor will move over to the next set of dots > Select R[_] > Set Value as 1
Select R[_]
5. Set value to change Loop Counter by: Select Constant > Set Value to 1
Select IF …. = ….
Selection Options for the
Left Side of the IF
Arrow Cursor to Line 18
Statement Conditions
iii. First set of … (left side of the =) Select R [_] > Set Value to 1
NOTE: It is recommended to set variable that is changing throughout the program first then set the
static value to stop at or abort second
iv. Set second set … (right side of the =) > Select Constant > Set to 4
3. Setting Label 2:
a. Arrow Cursor to END Command
b. Select NEW INSTRUCTION > Select JMP/LBL > Select LBL [_]
NOTE: Steps i. Adjusting Comparison in the IF/THEN and Step iv Setting R[1]:LOOP COUNTER to 0 are set to make sure the
counter has a starting point of 0 and a comparison that does not exceed 4 in case an operator stops the program in mid-cycle
and forgets to reset the robot or its registers.
v. Run the Program > Open Registers (Hardkey DATA) to see the numbers count as the program is
running
SAVE Workcell