IF/SELECT

From Industrial Robotics & Automation - Fanuc Teach Pendant Programming
Revision as of 17:23, 20 July 2019 by Mike138 (talk | contribs)

IF Statements

IF statements are the primary conditional instructions. When reached, they evaluate whether a condition is true.

If the condition is found to be true, it can execute either a Jump or Call.

How to add an "IF" instruction.

If it is not true, the instruction will occur as if the line were blank.

IF Variable Math Variable Action Destination
IF R[1] = 1 Call Program1
IF DI[3] = ON JMP LBL[2]

Additionally, when selecting the action field, another condition can be added with the AND or OR selection.

IF Variable Math Variable Modifier Variable Math Variable Action Destination
IF R[1] = 1 AND R[2] > AI[10] JMP LBL[2]

SELECT Statements

When wanting to make a large list of possible conditions for a single variable, you'll likely want to use the SELECT option.

SELECT Variable Math Variable Action Destination
SELECT R[1] = 1 Call Program1
= 2 Call Program2
= 1 Call Program3
Else JMP LBL2