need help. i am trying to install a counter to clean the torch tip. i would like for the torch tip to get cleaned after every fourth cycle start (or four parts) . i am new to programing so please give an example of what a torch tip cleaning program would look like. the program below i tried from a post i read on this fourm. i am working on a 100ic robot with an R30ib controller
[R1]=[R1]+1
IF [R1]<4 JMP LBL99
CALL REAMER
[R1]=0
LBL99
END
not sure what all of that means!!!!!!
counter for torch tip cleaner
-
Dean -
January 9, 2017 at 6:23 PM -
Thread is marked as Resolved.
-
-
I'll break it down line by line. I've also retranslated the lines into what you will see in the robot controller.
R[1:Cycle Counter] is a register. A register is a variable that can store a number. On a typical robot you will have 100 to 200 of them. In this case, you are working with the first register. Each register can have a comment, I've commented this one as "Cycle Counter".
After that is the equal sign, which is the assignment operator. This says take the result of the math operation on the right of the equals sign, and place it into whatever is on the left of the equals sign. In this case, you are adding 1 to the current number in R[1]. The result is then stored back into R[1]. So if R[1] was 0, it will be 1 after executing this line. If it was 1, it will be 2, etc.
This line contains an IF statement. The IF statement is divided into two parts, The condition to evaluate, and what to do if that condition is true, which are separated by a comma. The condition in this case is the R[1:Cycle Counter]<4 part of the statement above. When on this line, the robot asks itself "Is the number contained in register 1 less than 4?" If the condition is true ("Yes, register 1 has a number in it that is less than 4"), the robot will then execute the area after the comma. In this case, the command is a jump statement. This tells the robot to jump to label 99, a few lines down. If the condition is not true ("Nope, the number in register 1 is equal to, or greater than 4."), the area after the comma is not executed, and the robot continues onto the next line.
This statement is the call your reamer program. When ran, the robot will enter into your reamer program. Once done with the reamer program, your robot will execute the next line in this program. Note that the only way this runs is if the IF statement on the line above is evaluated as false.
This statement is similar to the first line, except here we placing a zero into register 1.
This is a label statement. By itself it does nothing. Its only purpose in this program is to serve as a exit point to the IF statement above if it was evaluated to be true.
This statement ends the current program.
-
this is great!!! thank you for taking the time to help me. i will install it now
-
where at in the program do i put the counter program? it 's not seeing the counter
-
I'd put it after the torch finishes... or put it in a separate routine and call it after the torch finishes.
it 's not seeing the counterWhat do you mean by "not seeing"? You can use the DATA key to check the value in [R1].
-
what is triggering [R1], or i take it that after one complete program cycle that [R1] increases by one. when i look at the I/O it shows it's off
-
what is triggering [R1], or i take it that after one complete program cycle that [R1] increases by one. when i look at the I/O it shows it's offI think you're confusing a register, which can be be found by pushing DATA as mentioned by Iowan, and the Robot inputs and outputs which you would see by looking in the I/O. The R[1] your using as your counter is found in the registers, not in your IO.