cliffordkoperski
USA
Asked
— Edited
In the MMA7544 window if wrote balance script with (if )statement example: if ($mmay>90) press run script it stops here saying Variable $mmay not defined
Whats really weird is that the whole script ran fine till I saved my file and reopened it an hour later. This is a bug right?
this is latest version software 3/7
Sorry, can you try again to explain the issue? I do not understand.
@cliffordkoperski Although you don't have to declare variables in ARC, you have to assign them an initial value before you use them in a comparison... So if this is the first instance of where ARC is seeing the variable $mmay " if ($mmay>90) " it will fail because no value has been set to $mmay previously... Are you sure the control is connected to the MMA7455 and is saving data to your variables before you run your scripts? Also make sure the set variables box is checked within the control itself....
Add the variable watcher. Only when the variables are added will scripts which refer to them work.
If the control assigns the variables you must use the control before the variables are created, this is not done on project open.
To avoid script errors you can define variables in an init script however until the control is used they will remain whatever set in the init script (it just wont error in the script).
Sorry DJ don't want to be confusing and waste any ones time. just reporting what I noticed
solution:
I closed and re opened ARC a few times and then it ran through script fine
only guess to problem:
the set variable check box would not stay selected. Also run script timer still never stays selected for me once out of edit window.
Thanks for responses they helped, I'll share my biped balance script with community once smoothed out.