robtarget:=robtarget+10
I've got a list/path that includes hundreds of points. I'd like to run through a certain drill/deburring operation at every point. Rather than creating a program where I move to every point and call the same routine after every point (resulting in a zillion page redundant program), is there any way I can increment a variable robtarget? These points are not spaced or oriented in any consistent pattern so I can't just increment their components with trans or pose.
I've tried incrementing a variable num and writing that as an addendum to a string "Target_", but passing the new string to a variable robtarget fails since the string doesn't count as a reference/pointer or contain the right data type. What's weird is that Programmaker tells me there are no errors in my program. But RobotStudios dies/can't load the program as is. The relevant part in my short experimental program looks something like this (with everything defined appropriately):
WHILE point<50 DO
Apoint:=ValToStr(point);
newstring:=Atarget+Apoint;
ok:=StrToVal(newstring,Target_point);
MoveL Target_point,v200,z1,tool0WObj:=wobj0;
rDRILL;
point:=point+10;
ENDWHILE
Saving the world from the scum of the universe.
Comments
-
And yes, I'm trying to do this WITHOUT having to resort to an array. But if that's the only way to do it, could I please have the proper format/syntax for a robtarget array?Lisa Cardon
Saving the world from the scum of the universe.0 -
point starts as 10
Atarget:="Target_"
Lisa Cardon
Saving the world from the scum of the universe.0 -
*continues browsing the manuals* If there were something like CallByVar that worked for variables (persistant veriables?) instead of procedures only... then I think I'd be set!
Target_point:=(CallByVar("Target_",point));
MoveL Target_point,v200,z1,tool0WObj:=wobj0;
rDRILL;
point:=point+10;I really wish this worked....
Lisa Cardon
Saving the world from the scum of the universe.0 -
Hi
What you could do is create your own Move instruction which includes the stuff you want to do after the motion. Here is just a simple example how to do it, have also included the array stuff.
%%%
VERSION:1
LANGUAGE:ENGLISH
%%%
MODULE ABB
VAR robtarget myTarget{2}:=[[[0,0,0],[1,0,0,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[0,0,0],[1,0,0,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]];
VAR robtarget myTarget1:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
VAR robtarget myTarget2:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
VAR robtarget myTarget3:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
!My special instruction
PROC MyMoveL(
robtarget mytarget,
speeddata myspeed,
zonedata myzone,
PERS tooldata mytool,
PERS wobjdata mywobj)
MoveL mytarget,myspeed,myzone,mytoolWObj:=mywobj;
!do the drill stuff
rDrill;
ENDPROC
!
PROC main()
!IF you want to loop thru the array of robtargets
FOR i FROM 1 TO 2 DO
MyMoveL myTarget{i},v200,z1,tool0,wobj0;
ENDFOR
!
!or just if you want to have the motion instruction in a flow
MyMoveL myTarget1,v200,z1,tool0,wobj0;
MyMoveL myTarget2,v200,z1,tool0,wobj0;
MyMoveL myTarget3,v200,z1,tool0,wobj0;
ENDPROC
ENDMODULE
Per Svensson
Company Specialist
ABB Automation Technology Products0 -
But the question is, can you construct the robtarget name using a variable? For example, can you pass the robtarget name of "Rob_Move"+NumToStr(x,0) as a parameter to the subroutine as the name of the robtarget? I'm guessing that since the name, in this example, is constructed as a string that it will pass it as a string to the subroutine. If that is the case, you will get a type mismatch error.Only the array portion of the suggested solution uses a variable to define which robtarget will be used. Can this be accomplished on non-arrayed robtargets that have similar names except for an identifier, such as Rob_Move1, RobMove2, RobMove3.......RobMove20. ??????0
-
have done this before (years ago and cant remeber exactly the process)I think I used GetDataValsomething like this;GetDataVal "target"+ ValToStr(num), temprobtargetMoveL temprobtargetalso answered the over in this post too;
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 319 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 802 RAPID Programming
- 4 AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings