Skip to content

DISCONNECT

Download Flojoy Studio to try this app
DISCONNECT disconnects the Mecademic robot arm via its API. This is required if the arm is to be used without rebooting. Params: ip_address : String The IP address of the robot arm. Returns: out : None
Python Code
from flojoy import flojoy, String
from PYTHON.utils.mecademic_state.mecademic_state import query_for_handle


@flojoy(deps={"mecademicpy": "1.4.0"})
def DISCONNECT(ip_address: String) -> None:
    """
    DISCONNECT disconnects the Mecademic robot arm via its API. This is required if the arm is to be used without rebooting.
    Parameters
    ----------
    Parameters
    ----------
    ip_address: String
        The IP address of the robot arm.

    Returns
    -------
    None
    """

    robot = query_for_handle(ip_address.s)

    robot.WaitIdle()

    robot.DeactivateRobot()
    robot.WaitDeactivated()

    robot.Disconnect()
    robot.WaitSimDeactivated()
    robot.WaitDisconnected()

    return None

Find this Flojoy Block on GitHub

Example App

Having problems with this example app? Join our Discord community and we will help you out!
React Flow mini map

In this example, the DISCONNECT node terminates the connection with the MECADEMIC MECA500 robot arm.

After ensuring the robot arm is idle, the node deactivates the robot and waits for confirmation of deactivation. It then disconnects from the robot arm entirely.

The DISCONNECT node should always used at the end of a workflow to safely terminate the connection and ensure that the robot arm is in a deactivated state.