Canada
Asked

I'Ve Been Trying To Use A Vari

I've been trying to use a variable like $ScriptManagerStatus but I get the error message 'Variable not defined' and I can see that in the list of variables. I can use the $Autopositionstatus variable and it works great, however, having a $ScriptManagerStatus variable would be good to have as well. Can I create this variable? If so, how? Or does it have to be created by DJ and put into the list?

Thanks


ARC Pro

Upgrade to ARC Pro

ARC Pro is more than a tool; it's a creative playground for robot enthusiasts, where you can turn your wildest ideas into reality.

PRO
USA
#1  

Bob, Check your script, I can use the variable no problem


$ScriptManagerStatus = 128
if($ScriptManagerStatus & 128)
print($ScriptManagerStatus)
endif



This works fine. Post your script.

#2  

@rz... I don't think that will help Bob.  If I am reading this correctly, he is looking for a variable that tells him what script manager is doing.  That would need to be created by DJ, although, as rz90208 demonstrated, you can define any variable to any value in a script, so you could do something like have each script in your script manager set a variable when it starts and clear that variable when it completes so you can then detect if a script is running by checking the contents of that variable.

Maybe if you specify a bit more about what you are trying to accomplish we can come up with a good solution.

PRO
USA
#3  

OH That makes more sense, with all the programming Bob has done, I thought it strange he would have a problem so simple. Thank you guru

#4  

Thanks for your thoughts on this. I'm trying write a script with several Control Commands and Auto Positions in it without having to put in Sleep commands. I thought by having a "Waitfor($variable)" in between the commands, that would work, however, I was wrong.  Using this type variable here is no good as it doesn't give the servos time to physically move to their positions before sending the next command, so a sleep command will still be needed.  I'll keep writing my scripts with the sleep commands after timing the movements.

#5  

So, this is similar to the issue Will was having with ScriptRecorder (see conversation here about new variable DJ added  https://synthiam.com/Software/Manual/Servo-Recorder-15963 ).  The issue is that as soon as the script issues the command, it thinks it is finished, so a variable of hte script manager status may not actually help.  It will depend on what function the scripts are calling.  For autoposition, as you indicated, there already is a variable but for other controls, there may or may not be variables to act on.