Error C4A1 when using while loops | UR10CB

Hi everyone,

i’ve been running into a Problem when running long while-loops on a UR10CB(3.12.1). I’ve reduced it to the minimal example below.

Running this code either gets me a C207A0-SafetyStop or a C4A1-Error. After reading up on this, it appears this happens because the Robot Program Thread doesn’t leave enough CPU time for URcontrol to communicate with the robot. Sadly, this is not reproducible in any Version of the Simulator.

The Solution given in the official Safety Stop Service note recommends simply calling wait() or sync(), which sadly does not help.

Do you have an idea what else i could do to avoid running into this error? The actual URscript uses many long while loops that can’t simply be split up.

Summary
def get_array_of_size(size, val):
	# -- returns an array of size "size" filled with "val",
    if (size == 500): return [val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val, val]
	end
end

test_ar = get_array_of_size(500, p[random(), random(), random(), random(), random(), random()])

i = 0
while (i <27):
    j = 0
    while (j < 28):
        test_ar[i] = pose_add(test_ar[i], p[random(), random(), random(), random(), random(), random()])
        j = j+1
    end
    i = i+1
end

The code for creating an array of a given size looks ridiculous, but it’s the only solution i’ve found on these Forums excluding RPCs, which i can’t use.

Are you putting the sync() commands in each loop?

Thought i did, but i just added more sync()'s and now it works. It’s just painfully slow, but i get that. Thanks for the reply