How can i Store a Robot target Name in a string array or variable
Comments
-
You just described the solution, didn't you? Here is my implementation of it:
MODULE Module1
CONST robtarget Target_10:=[[364.353809768,0,704.908015457],[0.500000013,0,0.866025396,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget Target_20:=[[364.353813367,0,601.342672798],[0.499999992,0,0.866025408,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget Target_30:=[[347.168289523,0,494.18528826],[0.332605283,0,0.94306613,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];CONST string myrobtargetnames{3}:=["Target_20","Target_30","Target_10"];
PROC Path_10()
VAR robtarget current_robtarget;FOR i FROM 1 TO 3 DO
GetDataVal myrobtargetnames{i},current_robtarget;
MoveL current_robtarget,v1000,z100,tool0\WObj:=wobj0;
ENDFOR
ENDPROCPROC main()
Path_10;
ENDPROCENDMODULE
Henrik Berlin
ABB4 -
Hi HenrikThanks for that, but what I really need to know is can you read existing RobTarget names into a string array?Is there a way of reading the name of a Robtarget eg "w4000768" and writing it into an array.Basically your solution backwards?I know you can read the .Trans and .Rot but is there such a thing as ".Name" in rapid.I.E."Read p40 into an array"MoveL p40,vmax,z50,ToolG1_Rob\WObj:=wobjuf1;"then Read p50 into an array"MoveL p50,vmax,z200,ToolG1_Rob\WObj:=wobjuf1;!"then Read w400030 into an array" and so onSpotL w400030,vmax,Sch187,Prs350,ToolG1_Rob\WObj:=wobjuf1;!"then Read p1070 into an array"MoveL p1070,vmax,z50,ToolG1_Rob\WObj:=wobjuf1;!0
-
Hi HenrikI'm assuming you don't know the answer, and you can't read and store the Robtarget Name using code?Matthew0
-
I am sorry, I don't know the answer. Perhaps you can read the data from a text file and get the names from there.
Henrik Berlin
ABB0 -
Thanks anyway HendrikI have now managed to do it, creating a function robtarget routine and string name, and then using VB to create the function for me in the move line."Target("p10")"I don't know why ABB can't give you access to the name, its only a string after all. I.E. "stRobTname:=p10.name;" but in rapid.0
-
I agree. I think that ABB should allow access to the name variable in rapid code. I could really use this functionality for displaying meaningful messages in the event log during a smart robot recovery loop.0
-
@liquidrobotics does this code make what you needs?PROC NameTest()CONST robtarget p10:=[[160,405,-152.2],[0,1,0,0],[-2,1,0,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
VAR string sPosName;
MoveL SaveName(p10,sPosName),vmax,fine,tool0;
TPWrite sPosName+" done";
ENDPROC
FUNC robtarget SaveName(robtarget rtPos, INOUT string name)
name:=ArgName(rtPos);
RETURN rtPos;
ENDFUNCPS: Code format doesn't work...☑️2024 - RobotStudio® User Group0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings