I have an OTC/Daihen welding package with an AX-21 controller. I have it setup on a rotary table with a side A and Side B. I want to have different programs on each side. I was trying to use an IF statement depending on which side the robot was on, it would call the appropriate program. I don't understand the variable part of it. I have input going to the robot so that it knows which side it is on.
Help programming IF statement
-
devilstang -
March 6, 2019 at 7:58 PM -
Thread is Resolved
-
-
See below example with IF statement for Input 1
IF I1=1 THEN 2 ELSE 3 'Input 1 is high Prog 2 else Prog 3
CALLP 2
CALLP 3
END -
You can make that with a few way.
One of them is, using variable for program selection.
If it's little bit complicate for you, you can use station function.You need only 2 digital inputs for this operation.
Firstly you should select number of station.Constant Setting > Operation Constant > Number of Station > 10 > Complete
Then, you should select condition of starter.
Constant Setting > Operation Constant > Condition of Multi Station Starter
-
I too need help with the IF statements but within a program that jumps steps if an input/inputs are true. Just need examples to refresh my memory lol
-
Try using multiple If's statements for various problems.
-
I have an OTC/Daihen welding package with an AX-21 controller. I have it setup on a rotary table with a side A and Side B. I want to have different programs on each side. I was trying to use an IF statement depending on which side the robot was on, it would call the appropriate program. I don't understand the variable part of it. I have input going to the robot so that it knows which side it is on.
You can try to use system functions to find out mechanism angle and use the IF function.
Example:
if system%(200)>0 'System%(200) Mechanism1 J1 value for external axis. If it's Mechanism 2 you can use System%(210) for J1 211 for J2... etc
CALLP 1
elseif system%(200)<0
CALLP 2
endif
end
Or you can set limit switch to CallPI
CALLPI 1, I1 'Call program 1 when first limit switch is on
CALLPI 2, I2 'Call program 2 when other limit switch is on
-
I am also having issues using IF statements. Both statements shown below give me error I2152 - The step does don't exist.
I have several other programs (not programmed by me) that use IF statements like this. Any help would be appreciated.
I am using FD Controller.
IF V1%=1
CALLP[5]
IF V16%>=40
LETVI[V16%,0]
-
A possible cause could be missing endif and end in your statement
Endif
End
-
There are 2 different IF commands on FD Robot (I don't know about AX. but I'm guessing it's the same.)
One is: IF V1%=1 THEN 2 ELSE 3, which directly jumps to specified step no.
The other is the one you're showing, where you need an ENDIF after the steps you want to skip if the condition doesn't exist.
IF V1%=1
CALLP[5]
ENDIF
IF V16%>=40
LETVI[V16%,0]
ENDIF