Welcome to Synthiam!

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

Asked — Edited

Starting A Autoposition Action From A Script In A Different Action

I'm having troubls starting a AP action from a script located on a different AP frame while it's running from within the same AutoPosition control. Is this even possable?

To be clear, here's an example: Lets say I only have one AP control installed. I have two actions I've made in this AP control. Action "one" has a script attached to one of it's frames commanding Action "two" to start. Can this be done? I've tried and I can't seem to get action two to start. If it is possable maybe I'm doing somthing wrong.

Synthiam
#4  
Would this not do it, put into an EZ-Script control?

Code:


# tell the Auto Position to start the action
ControlCommand("Auto Position", AutoPositionAction, "An Action 1")

# wait a small amount to ensure the Auto Position received the message and is running
sleep(500)

# wait for the Auto Position to set its status variable to 0, meaning completed
waitfor($AutoPositionStatus = 0)

# now that we know the Auto Position is done with the last action, tell the Auto Position to start the next action
ControlCommand("Auto Position", AutoPositionAction, "Another Action")

# wait a small amount to ensure the Auto Position received the message and is running
sleep(500)

# wait for the Auto Position to set its status variable to 0, meaning completed
waitfor($AutoPositionStatus = 0)

print("Actions are done")
#5  
Ya, I see the logic in this. I was just looking at the $AutoPositionStatus = 0 variable earlier this evening and thinking along these lines. Your laying it out like this really helps to understand the process. Once more, thanks. :)
Synthiam
#6  
Maybe try Blockly for this. You can add the Auto Position actions to a script and the code will be generated that "waits", just like what I posted.

I'm on my phone but I'll whip something up using mobile
Synthiam
#7  
Here's doing it with Blockly using the mobile app


User-inserted image



Which generates this code


User-inserted image
#8  
Cool, thanks for taking time to show me how this can help. I've been wanting to sit down and learn how to use Blocky. Sounds like now would be a good time for this. Up till now I've been so involved in getting things working and fixing my bugs.

Does It work the other way also? Can EZ Builder take an ez script and convert it into a Blocky layout?
Synthiam
#9  
No, that would be impossible. You can do a lot more with syntax programming than block programming. Syntax programming is far more versatile. Therefore you could not convert syntax to block.