Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Canada
Asked — Edited
Resolved Resolved by DJ Sures!

How Can Two Commands Be Run At The Same Time?

I am trying to get two commands to run at the same time ( without success ).
For example:

Code:


Left(1,2000)
ControlCommand("Auto Position", AutoPositionFrame, "Stretch Left", 10,1,1)

The program runs the first line, once that is completed then the next line runs. Is there a way to have them run simultaneously?

AI Support Bot
Related Content
Synthiam
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
PRO
Synthiam
#1  
First, we'll change your question to "how to run two commands consecutively without delay". This is because a computer runs instructions one at a time. A program is a list of instructions. Each instruction is read and then run. That's how computers work. What you don't see is the small lag between commands/instructions, which gives the appearance of "things happening at the same time".

So let's now look at your code...

The first command is specified Left to run for 2,000 ms (which is two seconds). You're asking the command to run for two seconds. This means you can't expect the next command to execute until the first command has completed, which will take 2 seconds.

Perhaps what you can do is this...

Code:


left(1)
ControlCommand("Auto Position", AutoPositionFrame, "Stretch Left", 10,1,1)
Sleep(2000)
Stop()

#2  
Thanks DJ.
That added some clarity, it's the order of the commands as well. This is giving me what I am looking for;

Code:


ControlCommand("Auto Position", AutoPositionFrame, "Stretch Left",10,1,1)
left()
Sleep(3000)
Stop()