A pkg to operate mitsubishi PLC by MCProtocol.
Project description
示例:
from CXCFmsMC import CXCFmsMC mc = CXCFmsMC.CXCFmsMC('10.0.1.236') print(mc.readBitFromPLC(0, 'M', 16)) print(mc.readWordFromPLC(0, 'D', 6)) print(mc.writeBiToPLC(210, 'M', 8, '00000000')) print(mc.writeWordToPLC(200, 'D', 3, [0, 0, 0]))
方法解析
- readBitFromPLC(self, startAddr, varType, length)从PLC中批量读取位数据,目前只支持M线圈的读取。参数:startAddr(起始地址,类型:int)varType(线圈类型,类型:str)length(传输数据位数,类型:int)返回值: dict
- readWordFromPLC(self, startAddr, varType, length)从PLC中批量读取字数据,目前只支持D寄存器的读取。参数:startAddr(起始地址,类型:int)varType(线圈类型,类型:str)length(传输数据位数,类型:int)返回值: dict
- writeBiToPLC(self, startAddr, varType, length, data)向PLC中批量写入位数据,目前只支持M线圈的写入。参数:startAddr(起始地址,类型:int)varType(线圈类型,类型:str)length(传输数据位数,类型:int)data(写入的数据,类型:str)返回值: str
- writeWordToPLC(self, startAddr, varType, length, data)向PLC中批量写入字数据,目前只支持D寄存器的单字(16 Bit)写入。参数:startAddr(起始地址,类型:int)varType(线圈类型,类型:str)length(传输数据位数,类型:int)data(写入的数据,类型:list)返回值: str
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for CXCFmsMC-binbin6106-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f575411576a08bdb82661b3977e48ab29a7737383572371443dbd14e0087f2fe |
|
MD5 | 0f83b1b36320e815e8753ace178e6bd5 |
|
BLAKE2b-256 | 19bde47ef6580ec3fe3db3d16e906acba5d19276000583edd9f7d8b2c8bb55ac |
Close
Hashes for CXCFmsMC_binbin6106-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6afec48a05152dbef72d6c20c1f76cd1acf051142bb3a211e8e67d826912e54 |
|
MD5 | c01837ef7778f691f22348c28b99363e |
|
BLAKE2b-256 | 2618d2e8be514ef93bbf434000360a7664f181d72f0b5e3006b22bec4add687e |