Skip to content

CONNECT

Establish a connection to the Mecademic robot arm via its API.Params:ip_address : strThe IP address of the robot arm.Returns:out : StringThe IP address of the robot arm.
Python Code
from flojoy import TextBlob, flojoy
from PYTHON.utils.mecademic_state.mecademic_state import add_handle, init_handle_map


@flojoy(deps={"mecademicpy": "1.4.0"})
def CONNECT(ip_address: str) -> TextBlob:
    """
    Establish a connection to the Mecademic robot arm via its API.

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

    Returns
    -------
    String
       The IP address of the robot arm.
    """
    init_handle_map(allow_reinit=True)
    add_handle(ip_address)
    return TextBlob(text_blob=ip_address)

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 CONNECT node establishes a connection with the MECADEMIC MECA500 robot arm.

The node takes in the IP address of the robot arm as an input. It initializes the handle map and adds a handle for the given IP address.

Upon successful connection, the node returns the IP address, confirming that the robot arm is now connected and ready for further operations.

The CONNECT node is used at the beginning of a workflow to ensure that a connection is established before any other operations are carried out.