I'm looking for help in creating an IF/THEN statement that involves the current location of a real variable...
Currently what I use in a simple example:
1. "Move To Pounce Position"
2. Block Step (Go to above general pick position). This is generally a meter or so above actual pick position.
3. DECOMPOSE mp2[1] = master_pick2[1]
4. POINT final_pick2 = TRANS(mp2[1]+x2,mp2[2]+y2,mp2[3],mp2[4]+r2,mp2[5],mp2[6])
5. LAPPRO final_pick2, -100
6. LMOVE final_pick2
What I want to do is determine the current value of mp2[4] based off of the master_pick position and adjust the J6 axis if it's within a certain range. The purpose is to decide if the robot needs to go to is "above general pick position" or go straight to its LAPPRO position if J6 does not need to move at all or that much. I will have dozens of different pick positions stored in a pick program, so I'd like to have the flexibility to make the decision to skip the block move if it isn't necessary.
So in one form or another, this is what I'm trying to accomplish, I just don't know how to write it.
1. "Move To Pounce Position"
2. DECOMPOSE mp2[1] = master_pick2[1]
3. POINT final_pick2 = TRANS(mp2[1]+x2,mp2[2]+y2,mp2[3],mp2[4]+r2,mp2[5],mp2[6])
4. "IF mp2[4]+r2 is < 130.00 OR mp2[4]+r2 is > 190.000 THEN; GO TO GENERAL ABOVE PICK POSITION
5. Block Step (Go to above general pick position). This is generally a meter or so above actual pick position.
6. END
7. LAPPRO final_pick2, -100
8. LMOVE final_pick2
Simply put (I think), I want the robot to go straight to its LAPPRO move if the orientation of J6 does not change from its pounce position to the final pick position. If J6 needs to move in excess of a certain amount of degrees, I want the program to execute the block step.
Any suggestions?
Thanks!