How to make a record
Options
ArneBert
✭
in RobotStudio
Hello
We have an assignment for school. We want to create a record with multiple data for the height of an object, to see if the object is there, the point where to pick the object up, the color of the object and if the object is a pass or a fail.This is our code but we constantly get an error on line 5
MODULE MainModule
Can somebody help us?
Arne
MODULE MainModule
PROC main()
RECORD Marker1
!point112; -> this is the point where the Marker is
bool booisthere:=0; -> this if to see if the object is there
!AI_SensorSick
num numheight:=5; -> this is to know the height
bool boolcolor:=0; -> this is to know the color is wright
bool boolbadpiece:=0; -> this is to know if the piece passes or fails
ENDRECORD
ENDPROC
ENDMODULE
Can somebody help us?
Arne
Tagged:
0
Answers
-
MODULE exampleModule
RECORD exampleRecord
string aName;
num aNumber;
dnum aDNumber;
pos aPos;
pose aPose;
robtarget aRobtarget;
jointtarget aJointtarget;
ENDRECORD
PERS exampleRecord exampleArray{5}:=
[["string1", 1, 10, [10,0,0], [[1,0,0],[1,0,0,0]], [[1,0,0],[1,0,0,0],[1,1,0,0],[11,12.3,9E9,9E9,9E9,9E9]], [[1,0,0,0,0,0],[0,9E9,9E9,9E9,9E9,9E9]]],
["string2", 2, 20, [20,0,0], [[2,0,0],[1,0,0,0]], [[2,0,0],[1,0,0,0],[1,1,0,0],[11,12.3,9E9,9E9,9E9,9E9]], [[2,0,0,0,0,0],[0,9E9,9E9,9E9,9E9,9E9]]],
["string3", 3, 30, [30,0,0], [[3,0,0],[1,0,0,0]], [[3,0,0],[1,0,0,0],[1,1,0,0],[11,12.3,9E9,9E9,9E9,9E9]], [[3,0,0,0,0,0],[0,9E9,9E9,9E9,9E9,9E9]]],
["string4", 4, 40, [40,0,0], [[4,0,0],[1,0,0,0]], [[4,0,0],[1,0,0,0],[1,1,0,0],[11,12.3,9E9,9E9,9E9,9E9]], [[4,0,0,0,0,0],[0,9E9,9E9,9E9,9E9,9E9]]],
["string5", 5, 50, [50,0,0], [[5,0,0],[1,0,0,0]], [[5,0,0],[1,0,0,0],[1,1,0,0],[11,12.3,9E9,9E9,9E9,9E9]], [[5,0,0,0,0,0],[0,9E9,9E9,9E9,9E9,9E9]]]];
PROC main()
FOR i FROM 1 TO Dim(exampleArray,1) DO
TPErase;
TPWrite exampleArray{i}.aName;
TPWrite NumToStr(exampleArray{i}.aNumber,0);
TPWrite DNumToStr(exampleArray{i}.aDNumber,0);
TPWrite ValToStr(exampleArray{i}.aPos);
TPWrite ValToStr(exampleArray{i}.aRobtarget);
TPWrite ValToStr(exampleArray{i}.aJointtarget);
WaitTime 1;
ENDFOR
ENDPROC
ENDMODULE
0 -
Thank you very much !!!!0
Categories
- All Categories
- 5.4K RobotStudio
- 385 UpFeed
- 15 Tutorials
- 12 RobotApps
- 291 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 247 ScreenMaker
- 2.7K Robot Controller
- 285 IRC5
- 47 OmniCore
- 6 RCS (Realistic Controller Simulation)
- 3 RobotStudio AR Viewer
- 748 RAPID Programming
- 15 Wizard Easy Programming
- 110 Collaborative Robots
- 3 Job listings