Loop Termination Bug


In DobotStudio2020 and DobotSCStudio, I’ve encountered an issue of a loop iterating even after the break condition is fulfilled. I’ve tried programming the arm using T&P, Blockly, and Lua, but they all exhibit the same issue.

A simple example of what I’m talking about:

while (DI(0) == 1)
// Loop body

If DI(0) is changed from high to low during the loop body, the arm performs extra iterations as if the break condition wasn’t fulfilled.

Here’s a Google Drive link with a video demonstrating the issue:

So far, the problem is fixed using the C# interface so I’ve been using that, but some of the functions aren’t working. MovJ and MovL work as expected, but JointMovJ, RelMovJ, and RelMovL return “invalid parameters”. I’ve triple-checked the data and number of parameters I’m passing, but no response from the arm.

An example of how I’m calling the RelMovJ:

OffsetXYZ offsetXYZ = new OffsetXYZ();
offsetXYZ.OffsetX = 5;
offsetXYZ.OffsetY = 0;
offsetXYZ.OffsetZ = 0;
bool blocked = false;
RelMovJ(ref offsetXYZ, blocked);

Could I get some examples on how to use these functions in case I’m using them incorrectly?


Hello, JointMovJ, RelMovJ, and RelMovL are not applicable to MG400 in DobotSDK1.4.1
We use a new SDK to replace the old version. The new SDK is based on TCP/IP remote protocol and can be called as long as the programming language supports TCP/IP communication. Details can be viewed: https://github.com/Dobot-Arm/TCP-IP-Protocol/tree/EN-Version


Hi, I have this same problem. I cannot get any conditional loop to terminate. I have an MG400. Was there a bug fix or work around for this?


– Version: Lua 5.3.5
while 1 do
if (DI(9))==1 then

This is my code. The if loop will continue even though the conditional has been met.


Are you breaking out of the while loop? I don’t understand what this program is trying to do


This is a small script in my code. When the condition is met in the if loop, break out and continue to the rest of the code. If I tried to do this in blockly, it didn’t work, I had to add this script. The until conditional functions were very buggy, or I just don’t know how to use them.