 Welcome to this welding module on counting programs. In this module, you'll explore how to use calls, jumps, and if-then-else commands in a robot program to make counters. These commands are used throughout your lab work and in industrial applications for torch cleaning routines and part counters. Let's start with the commands to create a counter within a program. If-then-else is sometimes called a conditional branch statement. The if portion tests a condition. Depending on whether the condition is true or false, the program executes either a first statement block, then block, or a second statement block, else block. A call statement transfers control from one program to another within the original program. In this example, main program has a call command. When this line executes, the robot leaves the current program and runs the t-joint program completely. When program t-joint finishes, the cursor returns to the original program, which is one line below that call statement. A call command can be used in an if-then-else is either the then statement block or the else statement block. A jump and a label are two commands that work hand in hand. The jump moves the cursor to a new location in the program. The label is the destination for the jump. A programmer can use many types of variables in a program. The two most common for our applications are a global byte GB and a local byte LB. Both represent a location in memory that stores whole numbers. A local byte can only be used in one program while a global byte is common to all programs. When using a counting variable, a set command assigns an initial value to a GB or an LB, an increment adds one to a global byte or local byte. This is an example of a program with a counter. This counter can be used within a program to complete several of your lab assignments. Line 1 is a motion command that moves the robot to its home position. Line 2 is a set command. It assigns the value of 0 to local byte 1. Line 3 is a label. It's a destination for a jump command that is used later in the program. Line 4 calls program T joint. Program T joint runs completely, then returns to the original program at line 5. Line 5 is an increment command. It adds 1 to local byte 1. Line 6 is an if-then-else command. It evaluates the status of local byte 1. If LB1 is equal to 4, no operation will occur, and the cursor will move to line 7 of the program. If LB1 does not equal 4, the cursor will jump to label 001 on line 3 of the program. As you can see, each time program T joint is executed, LB1 is incremented. Eventually, LB1 will reach 4, and the if-then-else statement will be satisfied. At that time, the cursor will move beyond the counting loop. Line 7 is the end of this example program. Now, let's check your knowledge with a few questions. This example program shows us how calls, jumps, and if-then-else commands can be used in a robot program to make counters. Counters are used throughout your lab work and in industrial applications for torch cleaning routines and part callers. You've completed this welding module on counting programs.