Skip to main content

OPC-UA client classes for m-tec machines (Mixingpump, Printhead, Dosingpump)

Project description

mtecconnect3dcp Python Library

This library provides a simple interface to connect and control m-tec machines via OPC UA and Modbus. It supports different machine types such as Mixingpump (duo-mix 3DCP (+), SMP 3DCP), Printhead (flow-matic PX), Dosingpump (flow-matic) via OPC-UA, and Pumps (P20, P50) via Modbus.

Developer Friendliness & IDE Support

This library uses comprehensive Python docstrings and type annotations. As a result, modern IDEs such as Visual Studio Code provide automatic tooltips, autocompletion, and inline help (IntelliSense). This gives you immediate guidance on parameters, return values, and usage of functions and classes while coding.

Note: For the best experience, it is recommended to use VS Code or another IDE with Python IntelliSense support.

Installation

  1. Install this library:
pip install mtecconnect3dcp

Example

See /Python/example.py for an example of a print process. Below is a minimal usage guide:

from mtecconnect3dcp import Printhead, Dosingpump, Pump, Duomix, DuomixPlus, Smp

# Connect to a m-tec connect duo-mix 3DCP
mp = Duomix()
mp.connect("10.129.4.73") # 10.129.4.73 is the default ip
mp.speed = 50  # Set speed to 50Hz (20-50Hz range)
mp.run = True  # Start the mixingpump

# Connect to a Pump (P20/P50 via Modbus)
pump = Pump()
pump.connect(port="COM7")
pump.speed = 25  # Set speed to 25Hz
pump.run = True  # Start the pump

Supported Properties and Functions by Machine

Control

Function/Property Get Set Type Description Pump (P20 & P50) duo-mix 3DCP duo-mix 3DCP+ SMP 3DCP SMP 3DCP+ Dosingpump (flow-matic PX) Printhead (flow-matic PX)
run bool Start/stop machine
reverse bool Set/Get running reverse
emergcency_stop() function Execute Emergency Stop
speed float/int Set/Get speed
dosingpump bool Start/stop dosingpump
dosingspeed float Set dosingpump speed
water float Set water flow (l/h)
cleaning bool Start/stop cleaning water
setDigital(pin, value) function Set digital output
setAnalog(pin, value) function Set analog output

Measure (GET)

Function/Property Type Description Unit Pump (P20 & P50) duo-mix 3DCP duo-mix 3DCP+ SMP 3DCP SMP 3DCP+ Dosingpump (flow-matic PX) Printhead (flow-matic PX)
m_speed float speed
m_dosingspeed float speed of pump %
m_pressure float pressure bar ✅ (optional)
m_water float water flow l/h
m_water_temperature float water temperature °C
m_temperature float mortar temperature °C
m_valve float valve position %
m_silolevel float Silo level %
m_voltage bool Voltage
m_current bool Current
m_torque bool Torque
getDigital(pin) function Digital input bool
getAnalog(pin) function Analog input 0 - 65535

Status (GET)

Function/Property Type Description Pump (P20 & P50) duo-mix 3DCP duo-mix 3DCP+ SMP 3DCP SMP 3DCP+ Dosingpump (flow-matic PX) Printhead (flow-matic PX)
s_error bool error state
s_error_no int error number
s_ready bool Ready for operation
s_mixing bool mixing
s_pumping bool pumping
s_pumping_forward bool pumping forward
s_pumping_reverse bool pumping reverse
s_pumping_net bool pumping via net
s_pumping_fc bool pumping via FC
s_remote bool hardware remote connected
s_solenoidvalve bool solenoid valve open
s_waterpump bool pumping waterpump running
s_emergency_stop bool emergency stop ok
s_on bool machine powered on
s_safety_mp bool mixingpump safety ok
s_safety_mixer bool mixer safety ok
s_circuitbreaker_fc bool Frequency Converter circuit breaker ok
s_circuitbreaker bool other circuit breaker ok
s_fc bool frequency converter ok
s_operating_pressure bool pressure ok
s_water_pressure bool water pressure ok
s_hopper_wet bool wet material hopper ok
s_hopper_dry bool dry material hopper ok
s_running bool Machine running
s_airpressure bool airpressure ready
s_phase_reversed bool phase reversed
s_rotaryvalve bool rotary valve running
s_compressor bool compressor running
s_vibrator_1 bool vibrator 1 running
s_vibrator_2 bool vibrator 2 running

Subscriptions

Description Pump (P20 & P50) duo-mix 3DCP duo-mix 3DCP+ SMP 3DCP SMP 3DCP+ Dosingpump (flow-matic PX) Printhead (flow-matic PX)
Subscribe to variable changes

You can subscribe to OPC UA variables for real-time updates:

def callback(value, parameter, subscription): # value and parameter (origial OPC-UA variable name) are optional
    print(f"{parameter} changed to {value}")
    if value:
        print("we are ready to go")
        subscription.delete()
mp = Duomix()
mp.connect("10.129.4.73")
mp.s_ready = callback # set a variable to you callback to subscribe

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mtecconnect3dcp-2.1.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mtecconnect3dcp-2.1.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file mtecconnect3dcp-2.1.0.tar.gz.

File metadata

  • Download URL: mtecconnect3dcp-2.1.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mtecconnect3dcp-2.1.0.tar.gz
Algorithm Hash digest
SHA256 4751351da3fd8132e2e3c5e7253fc549c725b73ada55202dd918501d40b948d1
MD5 8048f37f955b677b97d0fe4c4e209ce8
BLAKE2b-256 3a6283788d56a2c5d322a0b1b841c389d88b04e8ad4890a457b2c5810da7c6fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtecconnect3dcp-2.1.0.tar.gz:

Publisher: publish-to-pypi.yml on m-tec-com/mtecconnect3dcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtecconnect3dcp-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mtecconnect3dcp-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ce008c18a41cb59aefdab743dfd125f0ea309caa16d9071516f9f99733aede1
MD5 4a96e1f0277d0db2bc06a12f8167af29
BLAKE2b-256 0ba09821af50df20bf2ce98f93e855c0c6403b9aa9f4d9dec3998d3b03145402

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtecconnect3dcp-2.1.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on m-tec-com/mtecconnect3dcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page