Skip to main content

machine-logic-sdk

Provides a programmatic interface in Python to control Vention hardware and coordinate automation programs. This SDK enables developers to build custom applications that interact with Vention's MachineMotion platform, robots, actuators, and I/O devices.

Features

  • Robot Control: Move robots, set tool center points, compute kinematics
  • Machine Automation: Control actuators, pneumatics, and motors
  • I/O Management: Read sensors and control digital outputs
  • Real-time Monitoring: Access live robot positions, states, and sensor data
  • Safety Integration: Built-in safety state monitoring and emergency stops

Installation

Install the machine-logic-sdk from PyPI:

pip install machine-logic-sdk

Compatibility:

Please pay close attention to the compatibility table provided in the Official machine-logic-sdk Documentation to determine which version of the sdk is compatible with your version of MachineMotion.

For development installations, see the Development section below.

Quick Start

Here's a simple example to get started: Assumptions:

  • Robot is configured with friendly name "Robot"
  • Digital Input is configured with friendlt name "Sensor_1"
from machinelogic import Machine

# Connect to your machine
machine = Machine()

# Get a robot and move it
robot = machine.get_robot("Robot")
target_position = [100.0, 200.0, 300.0, 0.0, 90.0, 0.0]  # [x, y, z, rx, ry, rz]
robot.movel(target_position)

# Read a digital input (assuming "Sensor_1" is configured)
input_device = machine.get_input("Sensor_1")
sensor_value = input_device.state
print(f"Sensor reading: {sensor_value}")

Requirements

  • Python 3.10.x (Python 3.10.12 is shipped on MachineMotionAI devices)
  • Python 3.9.x (Python 3.9 is shipped on MachineMotion v2 devices)
  • MachineMotion Controller or compatible Vention hardware
  • Network connection to your MachineMotion device

Note: Higher Python versions (up to 3.11) are supported for development, but Python 3.10 is recommended for compatibility with MachineMotionAI devices.

Basic Usage

Connecting to Your Machine

from machinelogic import Machine

# Connect to local machine (default)
machine = Machine()

or Connect to remote machine

from machinelogic import Machine

# Connect to a remote machine
machine = Machine(ip="192.168.7.2")

Robot Operations

from machinelogic import Machine

machine = Machine()

# Get robot instance
robot = machine.get_robot("Robot")

# Move to position (linear movement)
robot.movel([100, 200, 300, 0, 90, 0])

# Move joints directly
robot.movej([0, -90, 90, 0, 90, 0])

# Get current position
current_pose = robot.state.cartesian_position
joint_angles = robot.state.joint_angles

Actuator Control

from machinelogic import Machine, MotionProfile

machine = Machine()
my_actuator = machine.get_actuator("Actuator")


# Always home the actuator before starting to ensure position is properly calibrated.
my_actuator.home(timeout=10)

TARGET_POSITION = 150.0  # millimeters
VELOCITY = 150.0  # mm/s
ACCELERATION = 150.0  # mm/s^2
JERK = 150.0  # mm/s^3 OPTIONAL PARAMETER

my_actuator.move_absolute(
    position=TARGET_POSITION,  # millimeters
    motion_profile=MotionProfile(
        velocity=VELOCITY, acceleration=ACCELERATION, jerk=JERK
    ),
    timeout=10,  # seconds
)

I/O Operations

from machinelogic import Machine

machine = Machine()

my_input = machine.get_input("Input")

if my_input.state.value:
    print(f"{my_input.configuration.name} is HIGH")
else:
    print(f"{my_input.configuration.name} is LOW")

Examples

The SDK includes comprehensive examples in the examples/ directory.

These examples can also be found in the Official machine-logic-sdk Docs

  • Robot Control: Movement, kinematics, tool center points
  • Automation Sequences: Multi-step operations and coordination
  • I/O Integration: Sensor reading and output control
  • Error Handling: Safety and exception management

Browse the examples directory for complete, runnable** code samples.

**Note: You must ensure the devices in the example have been configured in the CAD and properly identified by the friendly name used in the example code.

Development

System Setup (Ubuntu/MachineMotion)

Install Python 3.10.12 on Ubuntu:

sudo apt install python3.10
python3 --version  # Verify installation

If you have multiple Python versions, ensure python3 points to 3.10:

cd /usr/bin
sudo unlink python3
sudo ln -s /usr/bin/python3.10 python3

Install required packages:

sudo apt-get install python3-apt python3-virtualenv python3.10-venv

Development Environment

Create and activate a virtual environment:

python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip

Documentation


Ready to automate? Install the SDK and check out the examples to get started with your first automation project!

Release files for machine-logic-sdk 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for machine-logic-sdk 3.1.0
File Size Uploaded
machine_logic_sdk-3.1.0.tar.gz 126.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for machine-logic-sdk 3.1.0
File Interpreter ABI Platform
machine_logic_sdk-3.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 313.0 kB

Release files / machine_logic_sdk-3.1.0.tar.gz

Download URL machine_logic_sdk-3.1.0.tar.gz
Size 126.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1bb8b85fd1298f3e65b1edbcd8100323a8cc8db57a3d8809b43042c5c78b3276
BLAKE2b-256 checksum
How to use checksums
27f871b29bf6eebf459cc6a3e9413297815baf89ac6ff2e3caeb0a98c975b075
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.10.12 Linux/6.17.0-1020-azure

Release files / machine_logic_sdk-3.1.0-py3-none-any.whl

Download URL machine_logic_sdk-3.1.0-py3-none-any.whl
Size 186.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2438d74ddd9495d8db81f8bc1f237237fa28cd507200cbcb23bcf49e52049a3
BLAKE2b-256 checksum
How to use checksums
19a1e81e143085f1c058b65593c5208e6a1789c4cb71ead49165c0432a2e2f76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.10.12 Linux/6.17.0-1020-azure

Release history Release notifications | RSS feed

This release

3.1.0 This release

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.14.1

2 release files

1.13.2

2 release files

1.13.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page