# Virtual Controller CRobT/47 Argument Error

**URL:** <https://tech-community.robotics.abb.com/t/virtual-controller-crobt-47-argument-error/4805>\
**Category:** Robot Controller\
**Created:** [April 19, 2012, 7:14pm UTC](https://tech-community.robotics.abb.com/t/virtual-controller-crobt-47-argument-error/4805 "2012-04-19T19:14:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laro88](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/laro88/32/2653_2.png) [@Laro88](https://tech-community.robotics.abb.com/u/Laro88)\
**Post date:** [April 19, 2012, 7:14pm UTC](https://tech-community.robotics.abb.com/t/virtual-controller-crobt-47-argument-error/4805/1 "2012-04-19T19:14:39Z")

</div>

SysVirRapdev: Argument Error 19-04-2012 19:05:06 Controllers  
Undefined if robot holds the tool or the workobject.

Here is the line causing the problem ( it is in a non motion task SEMISTATIC)  
robtargetCurrentPos := CRobT (Tool:=tRapProgram WObj:=wobjRapProgram);

(I have tried with TaskRef:=TROB1Id as well)

So  
Is there any way to do proper error handling so that the semistatic Task does not crash miserably…?

Best regards

---

<div class="post-metadata">

**Author:** ![Torbjorn](https://avatars.discourse-cdn.com/v4/letter/t/a87d85/32.png) [@Torbjorn](https://tech-community.robotics.abb.com/u/Torbjorn)\
**Post date:** [May 7, 2012, 3:39pm UTC](https://tech-community.robotics.abb.com/t/virtual-controller-crobt-47-argument-error/4805/2 "2012-05-07T15:39:22Z")

</div>

How have you defined your variables tRapProgram and wobjRapProgram?  
Are they PERS or TASK PERS. They need to be PERS, otherwise you will not share your data between your tasks. I did that mistake and got the same error code as you.  
The program works for you when you do the movement instructions with tRapProgram and wobjRapProgram?

Here is my 2 modules, and this works fine:  
Robot task:  
MODULE MainMoves  
PERS bool run\_CRobt:=FALSE;  
TASK PERS tooldata tool1:=[TRUE,[[0,0,0],[1,0,0,0]],[10,[103,0,108],[1,0,0,0],0,0,0]];  
PERS tooldata L10tip:=[TRUE,[[138.695,150.023,98.9783],[0.709396,-0.704707,-0.00856676,0.00851007]],[10,[103.6,-0.7,108.5],[1,0,0,0],0,0,0.12]];  
CONST jointtarget jpos10:=[[0,0,0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST jointtarget jpos20:=[[-10.4956,10.1942,43.8338,-15.7201,-46.1733,13.6386],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget p10:=[[933.43,-156.03,885.18],[0.714349,0.00968503,0.699448,0.0196065],[-1,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget p20:=[[869.38,-650.65,553.29],[0.00200615,0.711693,-0.702145,0.0219609],[-1,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget p30:=[[869.38,335.71,553.30],[0.00200546,0.711693,-0.702145,0.0219654],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget p40:=[[1200.65,335.71,553.30],[0.00200207,0.711693,-0.702145,0.0219671],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget p50:=[[1200.65,-470.31,553.29],[0.00200949,0.711694,-0.702144,0.0219611],[-1,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget p60:=[[1067.01,-118.30,553.30],[0.0020111,0.711694,-0.702144,0.0219675],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

PROC main()

WHILE TRUE DO  
MoveAbsJ jpos10NoEOffs, v1000, z50, tool0;  
MoveJ p10, v1000, z50, tool1;  
MoveJ p20, v1000, z50, L10tip;  
run\_CRobt:=TRUE;  
MoveL p30, v1000, z50, L10tip;  
MoveL p40, v1000, z50, L10tip;  
MoveL p50, v1000, z50, L10tip;  
MoveC p60, p40, v1000, z50, L10tip;  
MoveL p50, v1000, z50, L10tip;  
MoveJ p20, v1000, z50, L10tip;  
run\_CRobt:=FALSE;  
ENDWHILE  
ENDPROC  
ENDMODULE

Semistatic task:  
MODULE BCK\_TEST  
PERS bool run\_CRobt;  
PERS robtarget BCK\_p1:=[[0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [9E9, 9E9, 9E9, 9E9, 9E9, 9E9] ];  
PERS tooldata L10tip;

PROC main()  
WaitTime 10;  
WHILE TRUE DO  
WaitUntil run\_CRobt = TRUE;  
BCK\_p1 := CRobT(TaskName:=“T\_ROB1” Tool:=L10tip);  
WaitTime 0.01;  
ENDWHILE  
ENDPROC  
ENDMODULE
