Asked
Resolved Resolved by Athena!

Batch File Automation For ARC Connection

Hello [Synthiam Community or ],

I am currently working on automating a project launch using startup scripts and have encountered an issue. My goal is to launch a project via a batch file instead of using the Windows Startup folder.

Here's the project setup: When I manually open the project in Synthiam ARC and click 'Connect' (with an IoTiny connected to 2 servos), everything works perfectly. The 'Connection Established Cmd' script executes successfully, and it triggers my additional scripts, confirming that both the project and scripts are correctly configured.

The problem arises with my batch file (named startup-servo-test.bat). I'm using the command:

"C:\Program Files (x86)\ARC\ARC.exe" "C:\Users\Path\To\MyProject.ezb"

This command opens ARC and loads the correct project, but it doesn't automatically connect to the IoTiny. As a result, I need to manually click 'Connect' for the scripts to execute. Notably, I haven't utilized the ARC Shortcut Creator for this process.

My question is: Is there a specific command-line argument or a setting within ARC that I might be missing which would force an automatic connection upon startup? I was under the impression that a connection would be established automatically once the project was loaded. The "Connection Established Cmd" script runs after the connection is made.

Thank you in advance for your assistance!


Related Hardware EZ-B v4
Related Controls EZB Connection Script

ARC Pro

Upgrade to ARC Pro

Discover the limitless potential of robot programming with Synthiam ARC Pro – where innovation and creativity meet seamlessly.

Author Avatar
PRO
Canada
#1  

Short answer: Yes - ARC can auto-run a script when a project is loaded. Use the second command-line parameter to specify a script name, and make that script call the EZB Connection ControlCommand to connect automatically.

What’s happening in your case

  • Launching ARC with only the project file will load the project but will not automatically trigger a connection unless a script runs that calls the Connection control commands (or the EZB has been configured to connect as a client and ARC is listening).
  • Your batch file example also has a typo in the path (missing space in "Program Files (x86)") and it doesn’t pass a script name parameter - so ARC loads the project but never runs a script to issue Connect.

Recommended fix (step-by-step)

  1. Create a JavaScript robot skill (name it exactly, e.g., AutoConnect)
  • Project Add robot skill Script choose JavaScript
  • Name it AutoConnect (or whatever you prefer - you will pass this exact name to ARC on the command line)
  1. Put this code in the AutoConnect script (example - tries to connect index 0, waits up to 10 seconds)
// AutoConnect script
print("AutoConnect: starting");

controlCommand("Connection", "Connect0"); // request connection of index 0
var tries = 0;
var connected = false;
while (tries < 50) { // 50 * 200ms = 10 seconds
  var status = controlCommand("Connection", "GetStatus", 0);
  if (status === true || status === "True") {
    print("AutoConnect: EZ-B index 0 connected");
    connected = true;
    break;
  }
  sleep(200);
  tries++;
}

if (!connected) {
  print("AutoConnect: failed to connect within timeout");
}
// The EZB Connection skill's "Connection Established Cmd" will then run after actual connect
print("AutoConnect: finished");

Notes:

  • This uses print() as recommended for ARC JavaScript.
  • Adjust Connect0 ConnectAll or Connect1..4 if your main controller uses a different index.
  • If your IoTiny/EZ-B is configured in client mode (it will connect into ARC), make sure the EZB Connection skill has the "EZ-B Connection Server" enabled so ARC is listening for the device.
  1. Save the project.

  2. Update your batch file to pass both the project file and the script name. Example batch file (correct quoting; first param = project file, second param = script name):

"C:\Program Files (x86)\ARC\ARC.exe" "C:\Users\YourUser\Path\MyProject.ezb" "AutoConnect"
  • Important: include both quoted parameters (project path and script name).
  • If ARC is already running, the behavior can vary (new instance may not start). Best to ensure ARC is not running before launching the batch file.
  1. Additional tips / troubleshooting

Would you like me to:

  • Prepare a single AutoConnect script that will try ConnectAll and then call/trigger other startup scripts, or
  • Check your exact batch file line and project/script names and produce a ready-to-run .bat for you?

Tell me which EZ-B index you use (0 by default), and whether your IoTiny is set as client (connects to ARC) or server, and I’ll give a tailored script and batch file.


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.
Author Avatar
PRO
Germany
#2  

Great, perfect it works , i just added the script named "AutoConnect".  the second parameter was missing in the command line. thank for your help:)

Author Avatar
PRO
Canada
#3  

Nice - glad to hear it works!

Quick recap and a couple of optional next steps you might find useful:

Want me to:

  • create a polished startup .bat for you (I’ll need the exact ARC path and project/script names), or
  • add retry logic to AutoConnect (ConnectAll, longer timeout, or repeated attempts) so it’s robust during boot?

Tell me which you prefer and I’ll prepare it.


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.