Welcome to Synthiam!

Program robots using technologies created by industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation, and artificial intelligence easy.

Get Started
United Kingdom
Asked — Edited

Auto Connect Script

I couldn't see one in the EZ-Script section so here is the one I just wrote.

This will check all 5 connections, if any are not connected it will attempt to connect to all. Looping around to constantly check. I have not tested this to see how much resources the loop uses so all comments are appreciated.

To change from all 5 boards to just 1 board or a couple of boards is pretty straight forward, just edit the IF statement and the ControlCommand statement.

Code:


# Auto Connect/Reconnect Script
# Version: 1.0

:start
# Check if EZBs are connected
IF (IsConnected(0) = FALSE or IsConnected(1) = FALSE or IsConnected(2) = FALSE or IsConnected(3) = FALSE or IsConnected(4) = FALSE)
# Visual output
PRINT("Connection Error: Attempting Reconnection")
# If any are not connected attempt to connect all
ControlCommand("Connection", ConnectAll)
# End of if statement
ENDIF
# Return to the start
GOTO(start)

AI Support Bot
Related Content
Synthiam
#1  
Thanks RichMr2. This will come in handy. I have noticed that at times I'll loose a connection to one of my boards for what ever reason. This will keep them connected!
PRO
USA
#2  
When using the auto connect script with an init script, if one of the ezb board gets disconnected and the the auto connect script reconnects the ezb will it also rerun the init script?

Ps, I do have this script in the connect of ever ezb board I'm using.

Thx
#3  
No @merne. This only connects the EZB's It will not start any other script.

The only reason your ESB's connect when you start ARC (from a shortcut created by ARC) is because that shortcut will start ARC and the INI script. That INI script then connects the EZB's (if you have the connect commands listed).

Hope this is clear. :)
#4  
@merne
If you have a script that you want to run when an EZB board gets connected, or reconnected, put that script in the Connection Control

User-inserted image


User-inserted image


Regards,
Frank