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
- Official machine-logic-sdk Documentation - Complete API reference
- Examples Directory - Runnable code examples for all features
Ready to automate? Install the SDK and check out the examples to get started with your first automation project!
Metadata
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| machine_logic_sdk-3.1.0.tar.gz | 126.2 kB | Without provenance | Details for machine_logic_sdk-3.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| machine_logic_sdk-3.1.0-py3-none-any.whl | Python 3 | none | any | Details for machine_logic_sdk-3.1.0-py3-none-any.whl |
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
|
Security for machine-logic-sdk 3.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.