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
- An RS-485 adapter
- pySerial
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
You can download a release from pypi using pip or clone this repository and install manually.
From pypi
From command line, use:
python -m pip install pymx2
From repository
From command line, use:
git clone https://github.com/vpaeder/pymx2.git
cd pymx2
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
- either from the command line, use pydoc:
python -m pydoc mx2
- or from within python:
import mx2; help(mx2)
Metadata
Release files for pymx2 0.1.6
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 |
|---|---|---|---|---|
| pymx2-0.1.6.tar.gz | 58.6 kB | Without provenance | Details for pymx2-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pymx2-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for pymx2-0.1.6-py3-none-any.whl |
Total release size: 86.7 kB
Release files / pymx2-0.1.6.tar.gz
| Download URL | pymx2-0.1.6.tar.gz |
|---|---|
| Size | 58.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9039b8d49f10e3005bb00fee6fddc2a24323e15cd98a68f7fcd8d295fa43515b
|
|
BLAKE2b-256 checksum How to use checksums |
f5353877a2f03da83989685b19a3e490e82d719c5742ef2da265dffe59b89db4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.10
|
Release files / pymx2-0.1.6-py3-none-any.whl
| Download URL | pymx2-0.1.6-py3-none-any.whl |
|---|---|
| Size | 28.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
44dabb5c4f00eca7d539f825d18bc8cc16d4f5bb1ea8967d029a3cf5bfc13f4d
|
|
BLAKE2b-256 checksum How to use checksums |
d902886191210cf42e75606ad61642e915805600a197e9c9a8803887e55b5f4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.10
|
Security for pymx2 0.1.6
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.