Reputation: 109
Using Mitsubishi's RT Toolbox3 and Melfa Basic VI programming language, I am trying to get the syntax correct for an If...Then...Elseif...Endif statement. I would like this robot to assess 3 external Inputs and based on their state run different Subroutines. If none of these inputs are true I want the robot to go to a "Waiting" position, we'll label this position posXXX.
Here is what is currently running in this robot. This script selects the proper subroutine but doesn't account for the condition when none of the inputs are true. When I attempt to insert the "Else" Goto posXXX I get syntax errors.
If M_In(11) = 1 Then *Box1
If M_In(12) = 1 Then *Box2
If M_In(13) = 1 Then *Box3
Upvotes: 0
Views: 592
Reputation: 1
I have used also Mitsubishi Roboter in my Bachelor Thesis and for going the position you should move the robot with remote control and then you should get position from Melfa Basic.It gets automaticaly from there.Then you should use that your position. I hope it will works.
Upvotes: 0
Reputation: 109
Below is the script that resolved my question.
*BoxEval
Mvs posPostScan
If M_In(10) = 1 Then
GoSub *Box6
Break
ElseIf M_In(11) = 1 Then
GoSub *Box1
Break
ElseIf M_In(12) = 1 Then
GoSub *Box2
Break
ElseIf M_In(13) = 1 Then
GoSub *Box3
Break
ElseIf M_In(14) = 1 Then
GoSub *Box4
Break
ElseIf M_In(15) = 1 Then
GoSub *Box5
Break
Else
GoSub *BoxEval
EndIf
Upvotes: 0