Skip to main content

A Python driver to communicate with an Omron MX2 inverter through Modbus

Project description

pymx2

This is a python driver to communicate with an Omron MX2 inverter through Modbus (manufacturer's page). It is based on datasheet rev.2 (Jan 2013).

Requirements

What is provided

  • Commands to handle low-level functions provided by the inverter:
    • Read coil status (01h)
    • Read holding register (03h)
    • Write in coil (05h)
    • Write in holding register (06h)
    • Loopback test (08h)
    • Write in coils (0Fh)
    • Write in holding registers (10h)
    • Read/write in holding registers (17h)
  • A list of available coils and registers in the form of enums in mx2.enums:
    • Coil: list of coil addresses
    • ModbusRegisters: registers available only through Modbus
    • StandardFunctions: A group registers as described in datasheet pp. 90-120
    • FineTuningFunctions: B group registers (pp. 121-153)
    • IntelligentTerminalFunctions: C group registers (pp. 153-171)
    • MonitoringFunctions: D group registers (pp. 74-88)
    • MainProfileParameters: F group registers (p. 89)
    • MotorConstantsFunctions: H group registers (pp. 172-178)
    • OtherParameters: P group registers (pp. 179-190)
    • SecondMotorFunctions: registers from different groups assigned to 2nd motor configuration
  • Data types to handle returned values and keep tracks of associated coils and registers:
    • CoilValue: holds a reference to a coil address and a boolean value
    • RegisterValue: holds a reference to a register address and an integer value

There are so many separate coils and registers that I didn't find appropriate to create a class method for each of them. Allowed values and units for each register can be found in the relevant datasheet pages. Register sizes are handled automatically. An exception is made for fault monitors, for which as specific class method is provided. Several examples are available in the examples folder. API documentation can be found within the code or in the docs folder (see below). Don't hesitate to report bugs here.

Setup

From command line, use:

python -m setup.py install

or for Linux/OSX:

sudo python -m setup.py install

Examples

See examples folder.

Tests

The tests folder contains unit tests for most of the aspects of this package. To run them, use:

python -m unittest

API

You can find docs in the docs folder (generated from python docstrings). Alternatively, you can rely on python docstrings

  1. either from the command line, use pydoc:
python -m pydoc mx2
  1. or from within python:
import mx2; help(mx2)

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

pymx2-0.1.1.tar.gz (49.9 kB view details)

Uploaded Source

Built Distribution

pymx2-0.1.1-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file pymx2-0.1.1.tar.gz.

File metadata

  • Download URL: pymx2-0.1.1.tar.gz
  • Upload date:
  • Size: 49.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.10

File hashes

Hashes for pymx2-0.1.1.tar.gz
Algorithm Hash digest
SHA256 91a4e42481b7b05db746a831a09508c6a0c58e06c68031613c5753a6d9dd2ccd
MD5 b8b76e542a32f5ac103ab124f5f13f60
BLAKE2b-256 fde9b74d44bf0dd57e4c0c664d1df51f5b03aee3eb096e67fbded9d3ea8178f2

See more details on using hashes here.

Provenance

File details

Details for the file pymx2-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pymx2-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 27.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.10

File hashes

Hashes for pymx2-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a3295803d0b18c00170e2f42a1ab2cc0267e97ae549796e7821bccaab2cbbb9e
MD5 ba5ecf7a463e8511eed0a21b26d96646
BLAKE2b-256 df37be1ea0cff169492e5923a0fbb3dc412ad2ed2ccda0c7ab454f06c89420b5

See more details on using hashes here.

Provenance

Supported by

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