|
Project Information
Featured
Downloads
Links
|
Although this location will not be removed, The code is now being hosted at https://github.com/bashwork/pymodbus About PymodbusPymodbus is a full Modbus protocol implementation using twisted for its asynchronous communications core. It can also be used without any third party dependencies (aside from pyserial) if a more lightweight project is needed. Furthermore, it should work fine under any python version > 2.3 with a python 3.0 branch currently being maintained as well. In terms of features, the library currently supports the following: Client Features
Server Features
Use CasesAlthough most system administrators will find little need for a Modbus server on any modern hardware, they may find the need to query devices on their network for status (PDU, PDR, UPS, etc). Since the library is written in python, it allows for easy scripting and/or integration into their existing solutions. Continuing, most monitoring software needs to be stress tested against hundreds or even thousands of devices (why this was originally written), but getting access to that many is unwieldy at best. The pymodbus server will allow a user to test as many devices as their base operating system will allow (allow in this case means how many Virtual IP addresses are allowed). For more information please browse the project documentation. Example CodeFor those of you that just want to get started fast, here you go: from pymodbus.client.sync import ModbusTcpClient
client = ModbusClient('127.0.0.1')
client.write_coil(1, True)
result = client.read_coils(1,1)
print result.bits[0]
client.close()For more advanced examples, check out the repository. If you have created any utilities that meet a specific need, feel free to submit them so others can benefit. Also, if you have questions, please ask them on the mailing list so that others can benefit from the results and so that I can trace them. I get a lot of email and sometimes these requests get lost in the noise. InstallingYou can install using pip or easy install by issuing the following commands in a terminal window (make sure you have correct permissions or a virtualenv currently running): easy_install -U pymodbus pip install -U pymodbus Otherwise you can pull the trunk source and install from there: svn checkout http://pymodbus.googlecode.com/svn/trunk/ pymodbus-read-only cd pymodbus-read-only python setup.py install Either method will install all the required dependencies (at their appropriate versions) for your current python distribution. Current Work In ProgressSince I don't have access to any live modbus devices anymore it is a bit hard to test on live hardware. However, if you would like your device tested, I accept devices via mail or by IP address. That said, the current work mainly involves polishing the library as I get time doing such tasks as:
License InformationPymodbus is built on top of code developed from by:
Released under the BSD License
|