hi,
Will it work?
If ..... then
......
else
If ...... then
......
else
wait off
endif
hi,
Will it work?
If ..... then
......
else
If ...... then
......
else
wait off
endif
The available instructions will depend on the Fanuc software version that you are using.
There is a SELECT instruction (at least on version 9.1). Its in the IF screen when adding an instruction. But that uses a Register value as the condition. I don't know if that will work for you.
You can also do a similar behavior using JMP and LBL.
IF cond1 is NOT true THEN JMP LBL100
action 1
JMP LBL 900
LBL100
IF cond2 is NOT true THEN JMP LBL 200
action 2
JMP LBL 900
LBL200
action 3 (else or default case goes here)
JMP LBL 900
LBL 900
Display Morehi,
Will it work?
If ..... then
......
else
If ...... then
......
else
wait off
endif
There is one ENDIF missing. Then it will work. You can use the SELECT statement to call different programs containing your motion statements.
Why not use
Select R[x]=1 JMP LBL1
R[x] = 2 JMP LBL 2
R[x] =3 JMP LBL 3
etc
It will be more complicated than if else because I will need 3 more jmp lbl statement at the end etc.
The cleanest way is it use Select ...call. Then put your motions in different sub programs. Breaking up your program into smaller pieces is a good general programming practice anyway.
Select R[x]=1 call sub1
R[x] = 2, call sub2
R[x] =3, call sub3
...
Else, call subN