Congratulations DJ Sures, for answering the question and has received an EZ-Credit award! Share what you have learned and create a tutorial to help others by clicking here.

Help Needed With A Code

Assistance Requested

Help bhouston with their question and receive $10 of EZ-Credit to get more robots and parts from our store. The following information was provided about their previous efforts searching tutorials for a resolution.

bhouston claims to have checked these sources:

I have been trying to get this code to work,


#Power Up
ControlCommand("Script Manager", ScriptStart, "Amp On")
ControlCommand("Auto Release", PauseOn)

ControlCommand("Auto Position 3", AutoPositionFrame, "Tilt Straight",100,7,4)
ControlCommand("Auto Position", AutoPositionFrame, "Rest",25,10,5)
Sayezbwait("i am ready")
ControlCommand("Script Manager", ScriptStop, "LowPowerMonitoring")
ControlCommand("Camera", CameraStart)
ControlCommand("Script Manager", ScriptStart, "Monitor")

The problem is the Auto PositionFrame "Rest" will not run,however, if I run the the code again, it will. I've played with various sleep duration's between lines in the code. I'm stumped ! Anyone got any ideas?

I have found a few conversations, tutorials and activities that may help with your question. Take a look at these links. I've sorted them by what I believe to be most relevant but that is not always the case as I'm still learning.

Also, consider reviewing the Learn section for informative lessons and activities. Check it out!


When the code runs, does the auto position window show that "rest" was executed but the servos don't move?

its difficult to diagnose without seeing the project. There could be commands delayed from the other scripts that are being called which interfere with the servos being used in the Rest frame.


I notice you have multiple Auto position controls open ("Auto Position" and "Auto Position 3"Winky. Is there a reason for this?

Like DJ says, it is very hard to diagnose the issue without knowing what else may be running in conjunction with this script.


I think he has multiple EZB's. Each control only works with one EZB.


@DJ, Yes, it show that "rest" was executed. No other scripts are running these servos as they are on board 0. The Auto Position 3 is running servos on board 1.


Then I would have to assume the servos were already in their "rest" position - unless you are willing to share the project so I can take a look?

if the auto positioner displays the "rest" in the log, that means it is executing that frame. So, if you see "rest" in the status log and you believe it is not running, something else is having it stop or it's already in position. Post your project and I'll look.


Project posted. Here's the script I run before the one I'm having problems with;


#Power Down
ControlCommand("Script Manager", ScriptStop, "Monitor")
ControlCommand("Personality Generator", PauseOn)
ControlCommand("Script Manager", ScriptStart, "Ring power dn")
ControlCommand("Script Manager", ScriptStop, "LowPowerMonitoring")
ControlCommand("Auto Position", AutoPositionFrame, "Resting",50,5,2)
ControlCommand("Auto Release", PauseOff)
ControlCommand("Auto Position 3", AutoPositionFrame, "Tilt Back",100,7,4)
sayezbwait(" Ok, the amp is off ")
ControlCommand("Script Manager", ScriptStart, "Amp Off")
ControlCommand("Camera2", CameraStop)
ControlCommand("Camera", CameraStop)
ControlCommand("Auto Release", PauseOn)

Basically what i'm doing is - This script powers down the robot, the previous script powers it up.


Looks like there's a funny timing conflict with the Auto Release. The Auto Release is set for 5 seconds, and the timing of the sleeps() and code is all landing at the same time. Comment/disable the Auto Release control and try, it will work.

Rather than using Auto Release control because there are so many synchronous things happening at once, use the Release() command in ez-script for the servos that you wish to release.

They do not need to be released during startup, which is also what's happening. They only need to be released during shutdown script.

1) remove the Auto Release control

2) remove Auto Release control references from startup script

3) add Release() commands to shut down script


Ok, did as you said and added;



to the end of the power down script and that shuts everything, just what I want.
Now when I run the Power Up script, the auto positions "Rest" and "Tilt Straight" run but the servos don't move.


But, they work the second time you run the power up?