Skip to content

DISCONNECT

Disconnects the Mecademic robot arm via its API.Params:ip_address : TextBlobThe IP address of the robot arm.Returns:out : None
Python Code
from flojoy import TextBlob, flojoy
from PYTHON.utils.mecademic_state.mecademic_state import query_for_handle


@flojoy(deps={"mecademicpy": "1.4.0"})
def DISCONNECT(ip_address: TextBlob) -> None:
    """
    Disconnects the Mecademic robot arm via its API.

    Parameters
    ----------
    ip_address : TextBlob
        The IP address of the robot arm.

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

    robot = query_for_handle(ip_address.text_blob)

    robot.WaitIdle()

    robot.DeactivateRobot()
    robot.WaitDeactivated()

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

    return None

Find this Flojoy Block on GitHub

Example

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.