scada-tuna
Generic PLC client.
Usage
main.py
from scada_tuna import Tuna
# 用法总结:
tuna = Tuna('modbus://10.8.7.6:502?timeout=5.0&series=H5U').connect()
# tuna = Tuna('mc_3e://172.16.1.153:8100?timeout=5.0&series=L').connect()
print(tuna)
# 单次写入各种类型的数据
tuna.write('R100', 'int', 87)
tuna.write('D100', 'int', 86)
tuna.write('D200', 'long', 50054)
tuna.write('D205', 'float', [23.23, 34.56])
tuna.write('D210', 'string', 'hello world!')
print(tuna.read('R100', 'int'))
print(tuna.read('D100', 'int'))
print(tuna.read('D200', 'long'))
print(tuna.read('D205', 'float', 2))
print(tuna.read('D210', 'string', 12))
# 批量写入多种类型的数据
buffer = Buffer().append(89, 'int').append(12.23, 'float').append("hello world")
tuna.write('D500', None, buffer)
print(tuna.read('D500', 'int'))
print(tuna.read('D502', 'float'))
print(tuna.read('D504', 'string', 11))
# 批量读取多种类型的数据
buffer = tuna.read('D500', None, 20)
print(buffer.read('D500', datatype='int'))
print(buffer.read('D502', datatype='float'))
print(buffer.read('D504', datatype='string', length=11))
Release files for scada-tuna 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| scada_tuna-0.0.3.tar.gz | 5.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scada_tuna-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.4 kB
Release files / scada_tuna-0.0.3.tar.gz
| Download URL | scada_tuna-0.0.3.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43ad0f5e915d7ca716133e3840f3ca4893c1932530d0db8a132248e8958a178e
|
|
BLAKE2b-256 checksum How to use checksums |
013c9e2600759e982a8b9408b3ddadfd14b5dbfdacae3ed870b4d0d71f14df9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.13.0
|
Release files / scada_tuna-0.0.3-py3-none-any.whl
| Download URL | scada_tuna-0.0.3-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
32065d11c8f5e8c1ec2c6b482a485fd25b9c505d44a645c4ab3ee7069e15c56c
|
|
BLAKE2b-256 checksum How to use checksums |
0ac1c5b42d2722428aaf74be92035618c917fc6d5a2fbc87978c9a377e2e58a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.13.0
|