Registers: Difference between revisions
→Equals Instruction
(3 intermediate revisions by the same user not shown) | |||
Line 1:
<br />[[File:REGISTER Instruction menu.png|thumb|600x600px|REGISTER Instruction menu]]
''This page details the Register Instructions available on the FANUC Teach Pendant Programmers. For information on the data within the variables, see [[Data|Data.]]''
Register instructions do not involve motion. They are simply math operations with one or more inputs and an output.
When the program reaches a register instruction, it completes the math operation, overwrites the destination variable, and moves forward.
The leftmost variable in a register instruction is where the result is stored. Everything to the right of the equal sign is the equation to be performed.
{| class="wikitable"
Line 63 ⟶ 65:
|Mixed Logic
|}
A common use for Register instructions is a counter that increases the value of a register by one each time a program runs.
Example:
==Equals Instruction== ▼
R[1] = R[1] + 1
This will take whatever is in R[1], add 1 to it, and store it to R[1]. Every time you run a program that contains this line, it will count up. This means a technician can walk up to a robot cell and glance at the register's contents to know exactly how many times the robot performed its task.
Below is a detailed explanation with examples of each of the register instructions from the table above.
▲==Equals Instruction==
{| class="wikitable"
Line 129 ⟶ 138:
=== When this instruction is reached ===▼
▲===When this instruction is reached ===
Line 898 ⟶ 906:
===Special Notes ===
It is easy to accidentally build a mixed logic instruction incorrectly. Unlike the default choices, mixed logic won't force you to choose valid options and variables as you build it. Extra parenthesis are a common mistake and it may take some doing to ensure you have an equal amount of opening and closing parenthesis.
__NOTOC__
|