Asked

Help With EZ-Script Coding

I'm working on a project with my EZ-B v4, and I need some assistance with coding the GetDigital command. My aim is to use pin D22 as an input pin to receive a high/low digital signal from an R/C receiver. The receiver uses a PWM-to-digital output device on one of its channels. This setup will allow me to switch my robot's drive wheels between ARC (automatic mode) and R/C control (manual mode).

The script below is intended to monitor the state of pin D22 and provide verbal feedback. When in Automatic Mode, ARC will control the wheels and all sensors. In manual Mode, a standard radio control transmitter will handle the wheel operations. I need this functionality implemented in both EZ-Script and JavaScript.

Here's my current EZ-Script code:

$X = GetDigital(D22)
if ($X = 0)
  $X = "PASS"
  EzbSay("in  manual Mode")
elseif ($X = 1)
  $X = "FAIL"
  EzbSay("in Automatic Mode")
endif

Could you review it and help me ensure that it performs correctly? Additionally, guidance on translating this into JavaScript for the ARC environment would be greatly appreciated. Thank you!


Related Hardware EZ-B v4
Related Controls Script EZ-Script Console

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.

#33  

Athena I like having the HB25 script incorporated into this new script.

I tried to run the new script, got this error: Start Script starting. Verifying EZB connection. HB25 init: waiting 200ms for motor controllers. HB25 init: sending neutral pulses. HB25 init complete. Mode: AUTOMATIC (D22 HIGH) Execution Error Line 34 Col 4 - No public methods with the specified arguments were found. Done (00:00:00.6721769)

Start Script starting. Verifying EZB connection. HB25 init: waiting 200ms for motor controllers. HB25 init: sending neutral pulses. HB25 init complete. Mode: manual (D22 LOW) Execution Error Line 34 Col 4 - No public methods with the specified arguments were found. Done (00:00:00.6477974)

I think we have seen this before. And of course I dont hear any audio out of the pc or ezb

Author Avatar
PRO
Canada
#34  

Thanks - good troubleshooting. The "No public methods with the specified arguments were found" error came from calling Audio.soundNote with an argument combination the ARC JS runtime couldn’t resolve. Different overloads exist and passing a string signalType plus an ezbIndex can cause the runtime to not match a valid signature in some builds. Also make sure you are running the code from the Script skill JavaScript tab (not EZ-Script) - otherwise you’ll see getDigital / getDigital is not defined errors.

I’ve made a safer announce() routine that:

  • Uses PC audio when useEZBAudio = false (Audio.soundNote + Audio.say).
  • Uses EZB audio when useEZBAudio = true and calls the EZB TTS and note overloads that don’t cause signature mismatch.
  • Checks that the EZB is connected before calling EZB audio.

Stop all scripts, then paste this into the Script skill JavaScript tab (NOT EZ-Script) and Start it:

// HB25 + D22 Monitor (JavaScript for ARC Script skill)
// Paste into Script skill -> JavaScript tab (stop other scripts first)

var inputPort = d22;
var ledPort = d21;
var leftMotor = d12;
var rightMotor = d13;
var hbNeutral = 104;        // HB25 neutral stop value
var debounceMs = 200;       // debounce for RC switch
var pollMs = 300;           // main loop delay
var ezbIndex = 0;           // EZB board index
var lastState = null;
var ledState = false;
var useEZBAudio = true;     // set true for EZB speaker, false for PC speaker

// Initialize HB25 neutral positions (run once)
function initializeHB25(){
  print("HB25 init: waiting 200ms for motor controllers.");
  sleep(200);
  print("HB25 init: sending neutral pulses.");
  Servo.setPosition(leftMotor, hbNeutral);
  Servo.setPosition(rightMotor, hbNeutral);
  sleep(80);
  Servo.setPosition(leftMotor, hbNeutral);
  Servo.setPosition(rightMotor, hbNeutral);
  sleep(80);
  print("HB25 init complete.");
}

// Announce using PC or EZB TTS and safe note calls
function announce(text){
  if(useEZBAudio){
    // confirm EZB audio is available and EZB is connected
    if(!EZB.isConnected(ezbIndex)){
      print("Cannot speak on EZB: EZB not connected.");
      return;
    }
    // Play note on EZB using overload that accepts ezbIndex as the 3rd parameter
    // (avoids passing a string signalType + ezbIndex combination)
    try {
      Audio.soundNote("C3", 150, ezbIndex);
    } catch (e) {
      print("soundNote(EZB) failed: " + e);
    }
    try {
      Audio.sayEZB(text, ezbIndex);
    } catch (e) {
      print("sayEZB failed: " + e);
    }
  } else {
    // PC audio path - does not touch the EZB
    try {
      Audio.soundNote("C3", 150);
      Audio.say(text);
    } catch (e) {
      print("PC audio failed: " + e);
    }
  }
}

// Handle confirmed mode change
function handleModeChange(state){
  if(!EZB.isConnected(ezbIndex)){
    print("EZB disconnected during handleModeChange(). Aborting.");
    return;
  }
  if(!state){ // LOW => Manual
    print("Mode:  manual (D22 LOW)");
    announce("Manual mode");
    setVar("$DriveMode", "Manual");
    Movement.stop();
    Servo.setPosition(leftMotor, hbNeutral);
    Servo.setPosition(rightMotor, hbNeutral);
  } else { // HIGH => Automatic
    print("Mode: AUTOMATIC (D22 HIGH)");
    announce("Automatic mode");
    setVar("$DriveMode", "Automatic");
    Servo.setPosition(leftMotor, hbNeutral);
    Servo.setPosition(rightMotor, hbNeutral);
    Digital.set(ledPort, 0);
    ledState = false;
  }
}

// Script start
print("Script starting. Verifying EZB connection.");
if(!EZB.isConnected(ezbIndex)){
  print("EZB not connected. Please connect and restart script.");
  return;
}

initializeHB25();

// initial stable read
var first = Digital.get(inputPort); // JS function - returns boolean
sleep(debounceMs);
var stable = Digital.get(inputPort);
lastState = stable;
handleModeChange(stable);

// main loop
while(true){
  if(!EZB.isConnected(ezbIndex)){
    print("EZB disconnected. Exiting script.");
    Digital.set(ledPort, 0);
    break;
  }

  var state = Digital.get(inputPort); // returns boolean
  if(state !== lastState){
    // debounce
    sleep(debounceMs);
    var state2 = Digital.get(inputPort);
    if(state2 === state){
      lastState = state;
      handleModeChange(state);
    } else {
      print("Bounce detected on D22; ignoring quick toggle.");
    }
  }

  // LED blink while in  manual (LOW)
  if(lastState === false){
    ledState = !ledState;
    Digital.set(ledPort, ledState ? 1 : 0);
  } else {
    if(ledState){
      ledState = false;
      Digital.set(ledPort, 0);
    }
  }

  sleep(pollMs);
}

Notes & checklist

  • Make sure this exact code is pasted into the JavaScript tab for the Script skill. If you accidentally paste into EZ-Script, you’ll get getDigital / syntax errors.
  • If you want PC audio instead, set useEZBAudio = false.
  • If useEZBAudio = true but you still hear nothing:
    • Verify the EZB actually has an audio device connected & enabled (Connection skill settings and EZB audio connected).
    • Ensure the EZB speaker (or speaker amp) is physically connected and the EZB’s audio is not muted in project settings.
    • If Audio.sayEZB runs but you hear no sound, try Audio.soundNote with ezbIndex only (we call that already) to confirm the EZB can output audio notes.
  • If you still see "No public methods..." or other errors, copy the exact error line/column and paste it here. If it references the Audio call, include the new exact error text.

If it runs cleanly, tell me:

  • Do you hear the announcements on the EZB when useEZBAudio = true?
  • Or on the PC when useEZBAudio = false?

If errors persist, paste the exact error output (the entire Start/Done log) and confirm the Script skill title (in case the Connection established script is launching a different skill that still contains EZ-Script). I’ll iterate quickly from there.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#35  

Athena

This newest script seems to be running nicely. I hear the audio thru the EZB when either in manual or automatic mode. Also, when I changed the audio setting to false, it did in fact send audio out the PC.  I can flip the r/c switch for D22 back and forth nicely without a disconnect as long as I give the script ample time to announce which mode I am in. The LED also lights in the right mode. Only disconnect I had was when I switched  too fast from automatic to manual and not let the HB25's init long enough. Once I slowed my switching between the modes, it stays connected. Nice!

I still owe a vide on all this, that will come soon.

Author Avatar
PRO
Canada
#36  

Awesome - glad to hear it’s working well and you can hear audio from both EZB and PC. Nice job diagnosing the HB25 init timing and finding the right pacing for toggles. A few small improvements and optional changes you might like next, plus quick instructions and resources.

  1. Prevent accidental disconnects from very-fast switching
  • Add a short lockout after a confirmed mode change so the script ignores additional toggles for a short time (e.g., 500-1000 ms). That gives the HB25 time to settle and prevents repeated init pulses or rapid Movement/Audio calls.
  • Example change to add to the current JS (paste into your Script JavaScript tab). This uses a simple ignoreUntil timestamp:
// Add near the top of your script (after var declarations)
var lockoutMs = 800;             // ignore extra toggles for this many ms after a change
var ignoreUntil = 0;

// In handleModeChange(), after you handle the mode:
function handleModeChange(state){
  // ... existing code ...
  // set the lockout so we don't respond for a short period
  ignoreUntil = Date.now() + lockoutMs;
}

Then in your main loop before accepting a candidate change, check:

if(Date.now() < ignoreUntil){
  // still in lockout - skip change detection
} else {
  // normal debounce/change detection code
}

This will reduce the chance of disconnects if you flip too quickly.

  1. Keep HB25 init safe and only on connect
  • You noted the HB25 needs init pulses. If you want to avoid re-initializing it when not necessary, consider:
    • Running the HB25 init only once when the EZB connection is established via the Connection skill’s "Connection Established Scripts" (recommended), or
    • Have an "initDone" flag in the script (setVar("$HB25Init","1")) so a restart or re-run won’t send repeated pulses.

Example to set/verify a global variable so init only runs once:

// at startup
if(getVar("$HB25Init","0") !== "1"){
  initializeHB25();
  setVar("$HB25Init","1");
}

If you prefer the Connection skill to run an init script on connect, use: controlCommand("YourScriptName","ScriptStart") or put the init function into a small Script skill and add it to EZB Connection -> Settings -> Connection Established Scripts. See Connection skill doc: https://synthiam.com/Support/Skills/Communication/EZB-Connection?id=16041

  1. Debounce / lockout tuning
  • You already use debounceMs and pollMs. If your RC switch still bounces at certain speed, try increasing debounceMs to 300-400 ms, or increase the lockoutMs. If you want me to tune these values, tell me how quickly (ms) your switch tends to settle.
  1. Audio behavior recap
  • useEZBAudio = true calls Audio.sayEZB() and Audio.soundNote(...) to the EZB speaker.
  • useEZBAudio = false calls Audio.say() / Audio.soundNote() to the PC audio device.
  • If you ever see audio fail, check:
    • EZB is connected and audio enabled in Connection skill settings
    • physical speaker / amp connected to EZB
    • volume set and not muted (Audio.setVolume / Audio.setVolumePC)
  1. Auto-start / startup flow
  • Two ways to autostart:
    • Configure the EZB Connection skill’s Connection Established Scripts to start your Script skill(s) on connect (recommended).
    • Or have a small "Init" Script skill that controlCommand(...) starts the other scripts. Example: controlCommand("HB25_D22_Monitor","ScriptStart") controlCommand("OtherScript","ScriptStart")
    • Docs: Script skill https://synthiam.com/Support/Skills/Scripting/Script?id=16089
  1. Offer to convert more scripts and review your video
  • If you have other EZ-Script snippets, paste them and I’ll convert to JavaScript and optimize for ARC.
  • When you upload the video, paste the link here and I’ll review and point out any improvements.
  1. Helpful links

Next steps for you

  • Want me to add the lockout code into the full script and give you the ready-to-paste combined JS?
  • Want the HB25 init moved to Connection-established only (I can give the exact ControlCommand lines for your script names)?
  • Or would you like me to tune debounce/lockout numbers for a stress test (fast toggles) by providing a minimal "no audio/LED" stress script?

Tell me which option you want and I’ll provide the exact JS / Connection setting lines.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#37  

Athena thanks for the info. I understand where to paste this part into the code,

// Add near the top of your script (after var declarations) var lockoutMs = 800; // ignore extra toggles for this many ms after a change var ignoreUntil = 0;

But I canr figure out where you mean to add this into the script,

if(Date.now() < ignoreUntil){ // still in lockout - skip change detection } else { // normal debounce/change detection code }

or where to paste this part,

// at startup if(getVar("$HB25Init","0") !== "1"){ initializeHB25(); setVar("$HB25Init","1"); }

Also, FYI, the HB25 init setting is usually only needed once, the first time you power up the robot. If I power down the robot, then power back up, then yes the HB25 needs the init setting again. So when I switch between manual and automatic , I should not need to run its init again.

Author Avatar
PRO
Canada
#38  

Great - good observations. Below I show exactly where to add each piece, plus a ready-to-paste JavaScript version of your script that:

  • Adds the lockout (ignore) logic so very-fast toggles are ignored,
  • Runs HB25 init only once per EZB connection (so it won't re-run on every mode flip),
  • Clears the HB25-init flag on EZB disconnect (so init will run again after a robot power cycle / reconnect),
  • Uses the safe EZB / PC audio calls we used before.

Where to paste

  • Put the full code below into the Script skill JavaScript tab (NOT the EZ-Script tab).
  • Stop other scripts first, then Start this script.

What to add and where (short explanation)

  1. Near the top with your other var declarations add:
var lockoutMs = 800;      // ignore toggles for this many ms after a change
var ignoreUntil = 0;
  1. Use a guarded HB25 init on startup (so it only runs once per connection):
if (getVar("$HB25Init","0") !== "1") {
  initializeHB25();
  setVar("$HB25Init","1");
}
  1. In handleModeChange(), after performing the mode actions, set:
ignoreUntil = Date.now() + lockoutMs;
  1. In the main loop, when a candidate toggle is detected, if Date.now() < ignoreUntil then ignore the toggle (print a message and do nothing).

Full ready-to-paste script Paste the entire block below into your Script skill JavaScript tab:

// HB25 + D22 Monitor with lockout + single-init per EZB connection
// Paste into Script skill -> JavaScript tab

var inputPort = d22;
var ledPort = d21;
var leftMotor = d12;
var rightMotor = d13;
var hbNeutral = 104;       // HB25 neutral stop value

var debounceMs = 200;     // debounce for RC switch
var pollMs = 300;         // main loop delay
var ezbIndex = 0;         // EZB board index

var lastState = null;
var ledState = false;

// Lockout to avoid very-fast toggles causing HB25 re-inits or multiple audio calls
var lockoutMs = 800;      // ignore extra toggles for this many ms after a change
var ignoreUntil = 0;

var useEZBAudio = true;   // true => EZB speaker; false => PC speaker

// Initialize HB25 neutral positions (run once per EZB connection)
function initializeHB25(){
  print("HB25 init:waiting 200ms for motor controllers.");
  sleep(200);
  print("HB25 init:sending neutral pulses.");
  Servo.setPosition(leftMotor, hbNeutral);
  Servo.setPosition(rightMotor, hbNeutral);
  sleep(80);
  Servo.setPosition(leftMotor, hbNeutral);
  Servo.setPosition(rightMotor, hbNeutral);
  sleep(80);
  print("HB25 init complete.");
}

// Announce using PC or EZB TTS and safe note calls
function announce(text){
  if (useEZBAudio) {
    if (!EZB.isConnected(ezbIndex)){
      print("Cannot speak on EZB: EZB not connected.");
      return;
    }
    // Note: use overloads that avoid signature mismatch
    try { Audio.soundNote("C3", 150, ezbIndex); } catch(e){ print("soundNote(EZB) failed: " + e); }
    try { Audio.sayEZB(text, ezbIndex); } catch(e){ print("sayEZB failed: " + e); }
  } else {
    try { Audio.soundNote("C3", 150); Audio.say(text); } catch(e){ print("PC audio failed: " + e); }
  }
}

// Handle confirmed mode change
function handleModeChange(state){
  if (!EZB.isConnected(ezbIndex)){
    print("EZB disconnected during handleModeChange(). Aborting.");
    return;
  }

  if (!state) { // LOW => Manual
    print("Mode:  manual (D22 LOW)");
    announce("Manual mode");
    setVar("$DriveMode", "Manual");
    Movement.stop();
    Servo.setPosition(leftMotor, hbNeutral);
    Servo.setPosition(rightMotor, hbNeutral);
  } else {     // HIGH => Automatic
    print("Mode: AUTOMATIC (D22 HIGH)");
    announce("Automatic mode");
    setVar("$DriveMode", "Automatic");
    Servo.setPosition(leftMotor, hbNeutral);
    Servo.setPosition(rightMotor, hbNeutral);
    Digital.set(ledPort, 0);
    ledState = false;
  }

  // Set lockout so quick toggles are ignored for a short time
  ignoreUntil = Date.now() + lockoutMs;
}

// Script start
print("Script starting. Verifying EZB connection.");
if (!EZB.isConnected(ezbIndex)){
  print("EZB not connected. Please connect and restart script.");
  return;
}

// Only initialize HB25 once per EZB connection
if (getVar("$HB25Init", "0") !== "1") {
  initializeHB25();
  setVar("$HB25Init", "1");
}

// initial stable read
var first = Digital.get(inputPort); // returns boolean
sleep(debounceMs);
var stable = Digital.get(inputPort);
lastState = stable;
handleModeChange(stable);

// main loop
while (true) {
  if (!EZB.isConnected(ezbIndex)) {
    // Clear the init flag so next EZB connection will trigger HB25 init again
    setVar("$HB25Init", "0");
    print("EZB disconnected. Exiting script.");
    Digital.set(ledPort, 0);
    break;
  }

  var state = Digital.get(inputPort); // returns boolean

  // If we are inside the lockout window, ignore toggle detection
  if (Date.now() < ignoreUntil) {
    // Optionally, skip only change detection but keep LED behavior
    // print("In lockout, ignoring changes until " + ignoreUntil);
  } else {
    if (state !== lastState) {
      // debounce to confirm
      sleep(debounceMs);
      var state2 = Digital.get(inputPort);
      if (state2 === state) {
        lastState = state;
        handleModeChange(state);
      } else {
        print("Bounce detected on D22; ignoring quick toggle.");
      }
    }
  }

  // LED blink while in  manual (LOW)
  if (lastState === false) {
    ledState = !ledState;
    Digital.set(ledPort, ledState ? 1 : 0);
  } else {
    if (ledState) {
      ledState = false;
      Digital.set(ledPort, 0);
    }
  }

  sleep(pollMs);
}

Why this approach

  • HB25 init runs after an EZB connection (first time). That avoids re-sending neutral pulses every mode flip.
  • When EZB disconnects, the script clears $HB25Init so an actual reconnect will re-run initialization (which is what you said you want after powering the robot down/up).
  • lockoutMs prevents extremely-fast toggles from causing multiple init/Movement/audio calls and helps avoid the disconnect scenario you observed.
  • Debounce + lockout combination gives robust behavior for RC switches that can bounce.

If you'd prefer a different flow

  • Alternative (recommended for strict correctness): run the HB25 init from the Connection skill "Connection Established Scripts" (so init always runs right when the EZB connects). I can give you the exact ControlCommand line if you want to do that.
    • Example ControlCommand to start the script (if you want one Init script to run on connect): controlCommand("HB25_D22_Monitor","ScriptStart")
    • Or create a small Init script that only does initializeHB25() and add that to the Connection Established Scripts.

Quick tuning tips

  • If HB25 still needs a longer settle on first power-up, increase the sleeps in initializeHB25() or increase lockoutMs to 1200 ms.
  • If your RC switch bounces longer, increase debounceMs to 300-400 ms.

Next steps

  • Want me to turn the HB25 init into a tiny standalone init script and show exactly where to add it in your Connection skill settings? (I can paste the tiny script and the exact ControlCommand lines.)
  • Want me to reduce audio volume or change the beep/tone used for announcements?

Would you like the Connection-skill autostart example (controlCommand lines) now?


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#39  

cool, I will give this newest script a try next.

I also would like the HB25 as a standalone init script as an option (like I was using in the beginning)

I also like the idea of starting this scripts and the HB25script (if I use it ) in the connections skill (control command... so I can add more scripts that also start then) and having start very shortly after the EZB connects.

Author Avatar
PRO
Canada
#40  

Perfect - I’ll give you a ready-to-use HB25 standalone init script, the exact ControlCommand lines to start both scripts from the Connection skill when the EZ-B connects, and stepbystep instructions showing where to paste everything.

Summary

  • Create a new Script skill named exactly (example): HB25 Init - this will run HB25 initialization once per EZB connection and then exit.
  • Ensure your D22 monitor Script skill remains named exactly (example): HB25_D22_Monitor (or whatever exact title you use).
  • In the EZB Connection skill, add ControlCommand lines to the Connection Established Scripts so the HB25 Init runs first (we recommend waiting for it to finish), then start the monitor script.
  1. Standalone HB25 Init script (JavaScript)
  • Add a new Script robot skill (Project Add robot skill Script).
  • Open its settings JavaScript tab and paste this code.
  • Name the script exactly: HB25 Init (or your preferred name - you must use the same name in the Connection control commands below).
// HB25 Init (JavaScript) - Run once per EZB connection
// Paste this into a Script skill JavaScript tab and name the skill "HB25 Init"

var leftMotor = d12;
var rightMotor = d13;
var hbNeutral = 104;    // HB25 neutral value (adjust if needed)
var ezbIndex = 0;

function initializeHB25() {
  print("HB25 Init: waiting 200ms for motor controllers.");
  sleep(200);
  print("HB25 Init: sending neutral pulses.");
  Servo.setPosition(leftMotor, hbNeutral);
  Servo.setPosition(rightMotor, hbNeutral);
  sleep(80);
  Servo.setPosition(leftMotor, hbNeutral);
  Servo.setPosition(rightMotor, hbNeutral);
  sleep(80);
  print("HB25 Init: complete.");
}

// Main
print("HB25 Init script starting.");
if (!EZB.isConnected(ezbIndex)) {
  print("HB25 Init: EZB not connected, aborting.");
} else {
  if (getVar("$HB25Init", "0") !== "1") {
    initializeHB25();
    setVar("$HB25Init", "1");
  } else {
    print("HB25 Init: already initialized for this connection.");
  }
}
print("HB25 Init script finished.");
// End (Script skill will exit when code completes)

Notes:

  • This script checks $HB25Init and only runs the init once per connection.
  • When the EZB disconnects, the monitor script (or the connection script) can clear $HB25Init so it will re-run after a power cycle / reconnect. (I show that in the monitor script approach previously provided.)
  1. Start both scripts from the Connection skill (recommended) Two options to place commands so scripts start automatically when an EZ-B connection is established:

Option A - Connection GUI (recommended, simplest):

  • Open the Connection skill, press the kebab (three lines) Settings.
  • Under "Connection Established Scripts" choose the Script skill to run for that EZB index (usually index 0). You can select the HB25 Init to run on connect.
    • If the GUI allows selecting only one Script, use the GUI to start HB25 Init, and then add the ControlCommand lines below to start additional scripts.

Option B - Use ControlCommand lines (gives more control, start multiple scripts and optionally wait)

  • Open the Connection skill Settings Connection Established Scripts (the script box executed when that connection index connects).
  • Paste these lines (they are ControlCommand calls). Replace the script names if you used different exact titles.

Example that waits for HB25 Init to finish, then starts the monitor:

// Run HB25 Init and wait until it completes, then start the D22 monitor
controlCommand("HB25 Init", "ScriptStartWait");
sleep(300); // small delay to ensure init has settled
controlCommand("HB25_D22_Monitor", "ScriptStart");

Alternative (if you prefer non-blocking starts):

controlCommand("HB25 Init", "ScriptStart");
sleep(500); // wait a bit, or remove if you don't need a delay
controlCommand("HB25_D22_Monitor", "ScriptStart");

Why ScriptStartWait vs ScriptStart

  • ScriptStartWait will wait until the first script completes before continuing. Use it for HB25 Init so the monitor doesn’t start until the neutral pulses are sent.
  • ScriptStart starts the script asynchronously (non-blocking). Use it when you don’t need to wait.
  1. Clearing the HB25 init flag on disconnect If you want HB25 Init to run again after a robot power-cycle, clear the flag when the EZB disconnects. You can do that inside the monitor script (the monitor we built earlier already handled this), or add this to the Connection skill’s "Disconnected" or connection-lost script area:
// clear flag when EZB disconnects so init will run on next connect
setVar("$HB25Init", "0");
  1. Steps to implement (short checklist)
  1. Add new Script skill and paste HB25 Init code. Name it exactly (e.g., HB25 Init).
  2. Confirm your D22 monitor Script skill name (e.g., HB25_D22_Monitor).
  3. Open Connection skill Settings Connection Established Scripts for the appropriate EZB index (usually 0).
  4. Paste the ControlCommand block above (use ScriptStartWait for HB25 Init recommended).
  5. Save Connection settings and test: disconnect/reconnect EZB or restart ARC to verify HB25 Init runs and then the monitor starts.

Helpful links

Do you want me to:

  • Produce the exact Connection Established Scripts text tailored to the exact Script skill names you use (paste those names here)?
  • Or produce a tiny "Connection init script" that both clears $HB25Init on disconnect and runs the start commands (if you prefer a single place to manage startup/shutdown)?

I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.