Possible to do IF-OR-THEN on Fanuc 0i or 31i?
I am writing a macro tutorial for my trainees and am testing syntax on my machines with a Fanuc 0i-TD control.
The following syntaxes failed. Can you see anything wrong with these statements?
IF[[#105NE1]OR[#105NE2]]THEN#3000=5(INVALID TAB NUMBER. MUST BE 1 OR 2)
IF[[#105GE1]OR[#105LE2]]THEN#3000=5(INVALID TAB NUMBER. MUST BE 1 OR 2)
IF[[#105GT1]OR[#105LT2]]THEN#3000=5(INVALID TAB NUMBER. MUST BE 1 OR 2)
IF[[#105NE101]OR[#105NE202]OR[#105NE303]]THEN#3000=1(BAD TOOL/OFFSET NUMBER. MUST BE 0101, 0202, OR 0303)
IF[[#105NE101.]OR[#105NE202.]OR[#105NE303.]]THEN#3000=1(BAD TOOL/OFFSET NUMBER. MUST BE 0101, 0202, OR 0303)
The issue is that even when the logic is true and no alarm should generate, the alarm still appears. For example, in the first example I set #105=1.000 but the alarm still appeared.
For comparison, the following syntax worked as expected
IF[[#105EQ1]OR[#105EQ2]OR[#105EQ3]OR[#105EQ4]OR[#105EQ5]]GOTO1123
#3000=1(INVALID TAB NUMBER. MUST BE 1,2,3,4,OR 5)
N1123
IF[#26EQ#0]THEN#3000=1(ERROR: Z LOCATION MISSING IN G101 LINE)
IF[[#105GT1000]AND[#500LE2000]]THEN#600=202
IF[[#105EQ101]OR[#105EQ202]OR[#105EQ303]]GOTO110
#3000=1(BAD TOOL/OFFSET NUMBER. MUST BE 0101, 0202, OR 0303)
N110
Based on what worked or failed, it seems as if I cannot use IF/OR/THEN but I can use IF/AND/THEN. Can anyone confirm this or is there a parameter setting or syntax error im not seeing?
Thanks in advance
CNC Product Manager / Training Consultant