Robot studio isn't telling me where my syntax errors are
I'm working on some code in Rapid, but RobotStudio doesn't tell where or why my code doesn't work.
I think the line below might be the problem.
checkpoint := IsReachable(point, printhead, wobj0);
I'm not sure how to fix it
Below is the rest of the code
MODULE MainModule
I think the line below might be the problem.
checkpoint := IsReachable(point, printhead, wobj0);
I'm not sure how to fix it
Below is the rest of the code
MODULE MainModule
! (name), started 11 27 2018
! This code read a file of eight positions per set and checks if the robot can reach each set
! This done for a workspace analysis
VAR iodev reader;
VAR iodev writer;
VAR pos corner;
VAR string word;
VAR bool check;
VAR bool checkpoint;
VAR robtarget point;
PERS tooldata printhead := [ TRUE, [[ 85.22, 0, 79.57], [0.707170, 0, 0.707170, 0]], [0.79496, [16.02,9.4,44.26], [1, 0, 0, 0], 0, 0, 0]];
! This function is from msalminen on the ABB forums
FUNC bool IsReachable(robtarget pReach, PERS tooldata ToolReach, PERS wobjdata WobjReach)
! Check if specified robtarget can be reach with given tool and wobj.
!
! Output:
! Return TRUE if given robtarget is reachable with given tool and wobj
! otherwise return FALSE
!
! Parameters:
! pReach - robtarget to be checked, if robot can reach this robtarget
! ToolReach - tooldata to be used for possible movement
! WobjReach - wobjdata to be used for possible movement
VAR bool bReachable;
VAR jointtarget jntReach;
bReachable := TRUE;
jntReach := CalcJointT(pReach, ToolReach\Wobj:=WobjReach);
RETURN bReachable;
ERROR
IF ERRNO = ERR_ROBLIMIT THEN
bReachable := FALSE;
TRYNEXT;
ENDIF
ENDFUNC
PROC main()
Open "U:/RAMSeniorDesign/RobotStudio Stations/Workspace/ReadTest1.txt", reader \Read;
Rewind reader;
Open "U:/RAMSeniorDesign/RobotStudio Stations/Workspace/ReadTest1b.txt", writer \Append;
word := ReadStr(reader);
check := StrToVal(word,corner);
point := [ [ corner.x, corner.y, corner.z], [0.707170, 0, 0.707170, 0], [0,0,0,0], [ 9E9, 9E9, 9E9, 9E9, 9E9, 9E9]];
checkpoint := IsReachable(point, printhead, wobj0);
Write writer, ""\Pos:=corner;
Write writer, ""\Bool:=checkpoint;
Close reader;
Close writer;
ENDPROC
ENDMODULE
0
Comments
-
Hello,I've test your code, all works fine...I've this text on ReadTest1.txt:
[200,0,0]<br>
Can you give us your error text?PS: When you paste code on post, use Code format (in pilcrow down list).
☑️2024 - RobotStudio® User Group0 -
Funnily enough the code started working the next day. I don't know why it didn't work before0
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)
- 799 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings