Urscript via primary interface

We want to move the robot via 4 waypoints. When we try to send this as a script via primary interface as below, the robot is only moving to the last waypoint

“def move():\r\n” +
“global PoseForMoveK = p[” + (digitalOutOnpose.Xm).ToString() + ", " + (digitalOutOnpose.Ym).ToString() + ", " + (digitalOutOnpose.Zm).ToString() + ", " + (digitalOutOnpose.RxRad).ToString() + ", " + (digitalOutOnpose.RyRad).ToString() + ", " + (digitalOutOnpose.RzRad).ToString() + “]\r\n” +
“global PoseForMoveL = p[” + (InitialPose.Xm).ToString() + “,” + (InitialPose.Ym).ToString() + “,” + (InitialPose.Zm).ToString() + “,” + (InitialPose.RxRad).ToString() + “,” + (InitialPose.RyRad).ToString() + “,” + (InitialPose.RzRad).ToString() + “]\r\n” +
"movel( PoseForMoveK, a= " + 50.ToString() + “, v= " + spraySpeed.ToString() + " , t=0, r=0)\r\n” +
"movel( PoseForMoveL, a= " + 50.ToString() + “, v= " + spraySpeed.ToString() + " , t=0, r=0)\r\n” +
“end” + “\r\n”;

What we expect is that the robot will move to first point, stop there will go to the second point and continue till the last movel command. What are we missing here?

Not enough details related to your code to digest it. I feel like I know what you’re problem is though.

When you’re send commands through the primary client interface the controller executes them as soon as they’re received. If you’re executing a move command and it receives a new one, it’ll interrupt that initial command and only execute the most recent one.

You would need to program the client to send a command only when the robot has finished its previous command, not all at once.