array of workobjects
sort
✭
Hello,
I cannot find any refference in the rapid manual for this so I am trying to find the answer here.
I have multiple workobjects that I would like to store in an array like this:
TASK PERS wobjdata wObj1:=[FALSE,TRUE,"",[[181.197,632.58,297.741],[0.999992,0.00251573,0.000730156,0.00299524]],[[0,0,0],[1,0,0,0]]];
TASK PERS wobjdata
wObj2:=[FALSE,TRUE,"",[[181.197,632.58,297.741],[0.999992,0.00251573,0.000730156,0.00299524]],[[0,0,0],[1,0,0,0]]];
TASK PERS wobjdata
wObj3:=[FALSE,TRUE,"",[[181.197,632.58,297.741],[0.999992,0.00251573,0.000730156,0.00299524]],[[0,0,0],[1,0,0,0]]];
...... and so son
PERS wobjdata arrayofObj{3}:=[wObj1,wObj2,wObj3,....]
I am getting syntax error that says: Expected num but found identifier. I suppose I cannot do it this way. I know I can do it like this with robtargets so I thought that I can do it with work objects but I can't. Is there any way how to do it?
thanks for the help
0
Comments
-
Putting identifiers in array is not allowed. You should keep data structure of wobjdata in a array as follows.
TASK PERS wobjdata wobj_array{3}:=[[FALSE,TRUE,"",[[700,-500,570],[1,0,0,0]],[[0,0,0],[1,0,0,0]]],[FALSE,TRUE,"",[[0,0,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]]],[FALSE,TRUE,"",[[0,0,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]]]];
0 -
Here's a previous post which might help.
0 -
I found that post here is how I did it and it's working.CONST STRING wobjArray{10}:=["productA","productB","productC".....];VAR wobjdata actualWobjTemp;
PERS wobjdata actualWobj;
.......
GetDataVal wobjArray{i},actualWobjTemp;
actualWobj:=actualWobjTemp;MoveJ p201,v1000,z50,tGripper\WObj:=actualWobj;Identifiers in array is not allowed but with robtargets it is working
0 -
sort said:Identifiers in array is not allowed but with robtargets it is working
Lee Justice0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 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