Calculated offset?
I'm attempting to use an incremented counter in a part laydown routine to calculate/modify an offset as I stack parts into a hopper. I need to the laydown position to shift 15mm in the +Z direction after each part, but I don't want to use dozens of robtargets to do it. One robtarget and a calculated offset based on a counter seems much cleaner, I just can't figure out how to do it.
Is there a way to use the counter to modify or select the offset I want?
Is there a way to use the counter to modify or select the offset I want?
0
Comments
-
You can just use a FOR or WHILE loop and every iteration increment the offset. With the function Offs you can modify the position.
So you can do something like this:<div>PERS num noParts := 5; </div><div>PERS num offset := 15; </div><div>PERS robtarget pFirst := [[1000,0,400],[0,1,0,0],[0,0,0,0],[9e9,9e9,9e9,9e9,9e9,9e9]]; </div><div>PROC main() </div><div> VAR num totalOffset := 0; </div><div> FOR i FROM 1 TO noParts DO </div><div> MoveJ Offs(pFirst,0,0,totalOffset), v1000, fine, tool0; </div><div> totalOffset := totalOffset + offset; </div><div> ENDFOR <br>ENDPROC </div>
1 -
That's quite a bit cleaner than what I ended up doing. Might have to go back and modify...Incr HopperCount;MoveAbsJ jposHOME,v1000,z50,tGripper;TEST HopperCountCASE 1:p1000Ct_PlacePos.trans.z := + 15;p1000Ct_PlaceDepart.trans.z := + 15;CASE 2:p1000Ct_PlacePos.trans.z := + 30;p1000Ct_PlaceDepart.trans.z := + 30;CASE 3:p1000Ct_PlacePos.trans.z := + 45;p1000Ct_PlaceDepart.trans.z := + 45;
etc, etc...
Then reset the Z values at completion of the routine.0
Categories
- All Categories
- 5.5K RobotStudio
- 395 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings