A pkg to operate mitsubishi PLC by MCProtocol.
Project description
诚信昌FMS项目三菱PLC通信工具
支持三菱Q系列和Fx系列,采用MC协议
示例:
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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2331bd7509b2fe782ba4cb56eaacd50f027a255ce4e79aefacffd59903bf7b2c |
|
MD5 | fcfcde5725098998e3ca759e1e85a6ee |
|
BLAKE2b-256 | e55cebc06bd5d045bfe6ea92b39fc2f181056632ee6eb8c332d73131cc0cd306 |
Close
Hashes for CXCFmsMC_binbin6106-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01b3f664d41192da133a1e3b07f48c6a8c4339e912fbab459a2bc129dff6469c |
|
MD5 | 9fd6564b5ca67344832a6c8ccd0387e8 |
|
BLAKE2b-256 | f67ff23229d760ad0ec78c0ca494c4c100044f9564c7982e7b1fe125d4fd9770 |