Asked

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 EZ-B v4

ARC Pro

Upgrade to ARC Pro

ARC Pro is your passport to a world of endless possibilities in robot programming, waiting for you to explore.

PRO
Synthiam
#1  

If you post code, I can help

#2  
DEVIATION_LEFT = false;

LoopStart:
sleep(1);

if (DEVIATION_LEFT == true) {

  print(DEV_PITCH + "LEFT DEV  ");
  Digital.set(d11, true);
  sleep(1);


}

continue LoopStart;

Thankyou DJ.  I have multiple scripts that normally run.  This is one of them.  I have found that if I open the script up, it gets "corrupted" and sends an error code.  Of the scripts that I did not open since the revision download, they run fine.  The above code error message is LoopStart "undefined". Jack

PRO
Synthiam
#3   — Edited

Unfortunately, that would never have run in any JavaScript environment. The reason is the label needs to be directly before a loop. I believe the confusion you have is moving from EZ-Script to JavaScript and misinterpreting the label: functionality. That's easy to do because EZ-Script was terrible:)

A label: is defined in JavaScript quite differently, see here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label

And more specifically, someone attempting to use it in the similar fashion and realizing the label: needs to be applied directly before a looping statement, here: https://stackoverflow.com/questions/6393648/why-is-this-labeled-javascript-continue-not-working

Here is your code re-written. Keep in mind, as the code comment says, DEVIATION_LEFT is always false. So the IF condition will never be met.


// loop for ever and don't do anything because DEVIATION_LEFT is always false

var DEVIATION_LEFT = false;

while(true) {

  sleep(1);

  if (DEVIATION_LEFT == true) {

    print(DEV_PITCH + "LEFT DEV  ");
    Digital.set(d11, true);
    sleep(1);
  }
}

Perhaps if you're communicating with other controls, you'd want DEVIATION_LEFT to be public across the entire project. In that case, use getVar() and setVar(). Such as....


// loop for ever and don't do anything because DEVIATION_LEFT is always false
// unless DEVIATION_LEFT is set from another control to TRUE

setVar("$DEVIATION_LEFT", false);

while(true) {

    sleep(1);

  if (getVar("$DEVIATION_LEFT") == true) {

    print(DEV_PITCH + "LEFT DEV  ");
    Digital.set(d11, true);
    sleep(1);
  }
}

#4  

All my scripts are in blockly.  They do not run.  This version of ARC does not run my Blockly Scripts. What am I to do? Jack

PRO
Synthiam
#5   — Edited

Don't use goto/label, as per the manual for JavaScript states. Unless you're using it for the correct intended purpose, which is outlined in the JavaScript manuals.

The solution would be to use the Loop Forever block, which produces while (true) loop

User-inserted image

#6  
PITCHBACK = false;

SCAN:
IR = (ADC.get(adc7));

sleep(1);

if (IR <= 65) {

  PITCHBACK = true;

  continue SCAN;


}

PITCHBACK = false;

continue SCAN;

On this script an error msg "unble to get"(ADC 7). It is connected to the EZB4.  I have tried recoding it using Blockly from this current ARC. My scripts ran perfectly earlier this morning before the download.  Does a  previous version exist that I could use?  I would say that the last update I did was 3-6m ago.  I tried ARC 4.2 with the same results. Thanks Jack

PRO
Synthiam
#7   — Edited

There indeed seems to be a naming mismatch between the Blockly and JavaScript using ADC.get and ADC.getADC. I'll fix that for the next release:). There will be a new Beta release candidate this evening. I recommend switching to that channel