https://github.com/plugarut/modicon
Modicon TM251
https://github.com/plugarut/modicon
Last synced: 19 days ago
JSON representation
Modicon TM251
- Host: GitHub
- URL: https://github.com/plugarut/modicon
- Owner: PlugaruT
- Created: 2016-08-27T13:35:21.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-27T13:37:10.000Z (almost 10 years ago)
- Last Synced: 2025-03-06T18:17:30.738Z (over 1 year ago)
- Language: Python
- Size: 29.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.rst
Awesome Lists containing this project
README
Overview
--------
Python library for getting readings from Modicon TM251 logic controller,
via Modbus, over a serial port.
Installation
^^^^^^^^^^^^
::
pip install git+ssh://git@github.com/PlugaruT/modicon.git
Example of use
^^^^^^^^^^^^^^
Reading int, float values from register:
::
from modicon import Modicon
m = Modicon()
result = m.read_register_value('OUT_POZITIE_MV3_1') # register name as parameter
print(result)
Reading specific bit state:
::
from modicon import Modicon
m = Modicon()
result = m.get_bit_state('TENSIUNE_UPS') # bit name as parameter
print(result)
Reading all bit states from all registers:
::
from modicon import Modicon
m = Modicon()
result = m.get_all_bits_state()
print(result)
Reading bit states from specific register:
::
from modicon import Modicon
m = Modicon()
result = m.get_bits_states_from_reg('ALARME_DWORD_4') # register name as parameter
print(result)
References
^^^^^^^^^^
- http://pymodbus.readthedocs.org/en/latest/library/sync-client.html -
examples of Modbus clients