DISCONNECT
The DISCONNECT node disconnect the Mecademic robot arm via its API.Inputs
------
ip_address
The IP address of the robot arm.Params:Returns:
Python Code
from flojoy import flojoy, TextBlob
from PYTHON.utils.mecademic_state.mecademic_state import query_for_handle
@flojoy(deps={"mecademicpy": "1.4.0"})
def DISCONNECT(ip_address: TextBlob) -> None:
"""
The DISCONNECT node disconnect the Mecademic robot arm via its API.
Inputs
------
ip_address
The IP address of the robot arm.
"""
robot = query_for_handle(ip_address.text_blob)
robot.WaitIdle()
robot.DeactivateRobot()
robot.WaitDeactivated()
robot.Disconnect()
robot.WaitSimDeactivated()
robot.WaitDisconnected()
return None
Example
Having problem with this example app? Join our Discord community and we will help you out!
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.