# MoveL instruction

**URL:** <https://tech-community.robotics.abb.com/t/movel-instruction/2662>\
**Category:** Developer Tools\
**Created:** [April 9, 2009, 11:17am UTC](https://tech-community.robotics.abb.com/t/movel-instruction/2662 "2009-04-09T11:17:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravi](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@ravi](https://tech-community.robotics.abb.com/u/ravi)\
**Post date:** [April 9, 2009, 11:17am UTC](https://tech-community.robotics.abb.com/t/movel-instruction/2662/1 "2009-04-09T11:17:32Z")

</div>

## Hi, I have a strange problem.I am working with a Flex Picker IRB 360. I have a program in C# sends the data to Robot Contorller through TCP/IP communication.The received data is used to move the robot to target points.Instead of the Robot moving to Target positions it always move to X=0 and Y=0 position. below is the code

MODULE TCPIP  
\< =“-” =“text/; =utf-8”\>\< name=“ProgId” =“Word.”\>\< name=“Generator” =“Microsoft Word 11”\>\< name=“Originator” =“Microsoft Word 11”\>

VAR **SocketDev**  **Socket\_Server** ;

VAR **SocketDev**  **Socket\_Client** ;

VAR **string**  **ReceiveMessage** ;

VAR **string**  **ControllerIP** ;

VAR **num**  **ReceivedOption** ;

VAR **bool**  **Dummy** ;

VAR **robtarget**  **r1** ;

\< =“-” =“text/; =utf-8”\>\< name=“ProgId” =“Word.”\>\< name=“Generator” =“Microsoft Word 11”\>\< name=“Originator” =“Microsoft Word 11”\>

VAR **String**  **sP1x** ;

VAR **string**  **sP1y** ;

VAR num **pr1x** ;

VAR num **pr1y** ;

VAR num **r1x** ;

VAR num **r1y** ;

PROC MAIN()

\< =“-” =“text/; =utf-8”\>\< name=“ProgId” =“Word.”\>\< name=“Generator” =“Microsoft Word 11”\>\< name=“Originator” =“Microsoft Word 11”\>

**SocketCreate**  **Socket\_Server** ;

**SocketBind**  **Socket\_Server** ,“172.29.74.1”,1025;

**SocketListen**  **Socket\_Server** ;

**SocketAccept**  **Socket\_Server** , **Socket\_Client** ;

**SocketReceive**  **Socket\_Client**  **Str** := **ReceiveMessage\*\*\*\*Time** := **WAIT\_MAX** ;

**TPWrite**"Message received "\*\*+\*\ ***ReceiveMessage** ;

**Dummy** := **StrToVal** ( **ReceiveMessage** , **ReceivedOption** );

\< =“-” =“text/; =utf-8”\>\< name=“ProgId” =“Word.”\>\< name=“Generator” =“Microsoft Word 11”\>\< name=“Originator” =“Microsoft Word 11”\>

**SocketSend**  **Socket\_Client**  **Str** :=“Message received”;

\< =“-” =“text/; =utf-8”\>\< name=“ProgId” =“Word.”\>\< name=“Generator” =“Microsoft Word 11”\>\< name=“Originator” =“Microsoft Word 11”\>

**sP1x** :=“P1x”;

**pr1x** := **ReceiveSend** ( **sp1x** );

**r1x** := **pr1x** ;

**sP1y** :=“P1y”;

**pr1y** := **ReceiveSend** ( **sp1y** );

**r1y** := **pr1y** ;

**r1** :=[[**r1x** , **r1y** , **Pz**],[0,1,0,0],[0,1,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];

**MoveJ**  **r1** , **V500** , **fine** , **tool2** ;

\< =“-” =“text/; =utf-8”\>\< name=“ProgId” =“Word.”\>\< name=“Generator” =“Microsoft Word 11”\>\< name=“Originator” =“Microsoft Word 11”\>

**SocketClose**  **Socket\_Server** ;

stop;

ENDPROC

\< =“-” =“text/; =utf-8”\>\< name=“ProgId” =“Word.”\>\< name=“Generator” =“Microsoft Word 11”\>\< name=“Originator” =“Microsoft Word 11”\>

FUNC **num**  **ReceiveSend** (var **string**  **Point** )

VAR **string**  **Receive** ;

VAR **num**  **Position** ;

**SocketReceive**  **socket\_Client**  **Str** := **Receive** ;

**TPWrite**""\*\*+\*\ ***Receive** ;

**SocketSend**  **socket\_Client**  **Str** := **Point** ;

**Dummy** := **StrToVal** ( **Receive** , **Position** );

Return **Position** ;

ENDFUNC

ENDMODULE

* * *

Incase of further calirifications please let me know.

Cheers  
Ravi

---

<div class="post-metadata">

**Author:** ![Jorge](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jorge](https://tech-community.robotics.abb.com/u/Jorge)\
**Post date:** [May 28, 2009, 6:54pm UTC](https://tech-community.robotics.abb.com/t/movel-instruction/2662/2 "2009-05-28T18:54:16Z")

</div>

Try to change the vars to persistence insted var

/Jorge

---

<div class="post-metadata">

**Author:** ![sturner](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/sturner/32/3432_2.png) [@sturner](https://tech-community.robotics.abb.com/u/sturner)\
**Post date:** [May 29, 2009, 4:53pm UTC](https://tech-community.robotics.abb.com/t/movel-instruction/2662/3 "2009-05-29T16:53:51Z")

</div>

robtargets are normally defined with the type ‘Constant’

leaving them as Var will set them to zero when program pointer is reset
