# Scripts cancelling each other

**URL:** <https://forum.universal-robots.com/t/scripts-cancelling-each-other/24690>\
**Category:** Technical Questions\
**Created:** [October 28, 2022, 8:37am UTC](https://forum.universal-robots.com/t/scripts-cancelling-each-other/24690 "2022-10-28T08:37:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc.cayuela](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@marc.cayuela](https://forum.universal-robots.com/u/marc.cayuela)\
**Post date:** [October 28, 2022, 8:37am UTC](https://forum.universal-robots.com/t/scripts-cancelling-each-other/24690/1 "2022-10-28T08:37:57Z")

</div>

Hi!

**What we are doing:** we are using UR scripting language and the primary interface to remote control the robot. This means that we are sending commands to the UR like movej, movel and set\_configurable\_digital\_out, set\_standard\_digital\_out.

We basically have a very simple dashboard where the user can concatenate several of this commands.

We send this commands individually, since the user can run different commands conditionally. I say this because we cannot simply put all the commands into a function and send them all at once (which would solve the problem).

**The problem:** if you send several commands they cancel each other, not effectively running them (and not buffering them). For the move commands is not a big problem because we can read from the primary interface the isProgramRunning flag and send the next script command after it’s done. But this is not possible for setting digital i/o. The result being that set digital i/o commands are typically cancelled and do not run since we cannot wait for them.

And this makes our useful dashboard “unusable”.

_Possible solutions, what is possible?_

- Is it possible to kind of buffer script commands in the UR controller so they don’t cancel each other?
- Is it possible to read when a script command is effectively executed, other than the motion commands as I mentioned earlier?
- I know a potential solution is adding time delays to the commands so they just wait enough to make sure they are done. But I’d say this is a very bad practice that will impact the velocity at which one can run several commands, and also time depends on the pc and the controller so it’s not a universal solution for all our customers… This is the last resort. But is it possible to solve it without this??

Thanks!!
