EZ Chart icon EZ Chart 4-series bar chart for real-time sensor comparison in ARC; set titles, values, RGB bar colors and conditional coloring via EZ-Script. Try it →
Asked
Scripts will not run from previous synthiam version software

Scripts Will Not Run From Previous Synthiam Version Software

I have tried to run both ARC 4.3 and ARC 4.5 with scripts from my previous Synthiam software.    I receive an error code that identifys a LOOP LABEL as not identified.  I have reidentified the LOOP and still indicates an error. I have performed multiple EZB4 resets and removed/reinstalled above software versions to include a computer retart. I am using widows 10 All scripts operated beautifully until I updated this morning.  I tried ARC 2 and problem remains. Any help? I'm desparate. Jack



Related Hardware (view all EZB hardware)
EZ-B V4 by EZ-Robot
EZ-B v4/2 robot controller: dual Cortex ARM, Wi-Fi, audio/video, 24 servo/digital ports, I2C/UART, camera and Synthiam ARC control for custom robots
Wi-Fi / USB
Servos 24
Camera
Audio
UART 3
I2C
ADC 8
Digital 24

ARC Pro

Upgrade to ARC Pro

Stay on the cutting edge of robotics with ARC Pro, guaranteeing that your robot is always ahead of the game.

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#17   — Edited

Here's an example of using public (global) and private variables in a loop...

Notes:

  • notice how a public (Global) variable has a $ (dollar sign) at the beginning. A global public variable means it can be accessed by all scripts.
  • the variable "countThisIsNotPublic" does not start with a $ (dollar sign). Therefore, it only exists within this script. It cannot be accessible by other scripts.
  • see how the main code is within a "loop forever". That will loop for ever, as the name suggests. You can exit the loop with a BREAK. Or you can exit the entire script with a HALT or a RETURN

    User-inserted image

And here's the JavaScript it generates...


countThisIsNotPublic = 0;

while (true) {

  setVar("$MyGlobalVariable", Utility.getRandom(0, 10));if (getVar("$MyGlobalVariable") == 5) {

    print("The random number matched my number");
    break;
  }

  countThisIsNotPublic = (countThisIsNotPublic + 1);
}

print("Break got me here because it breaked out of the loop.");
print("It took " + countThisIsNotPublic + " times to guess my number with random");
#18  

Thanks a million, I think I'm back on track. Jack