How to through PLC WeChat collecting field data? - - - - - -

by:Coolmay     2020-06-20
With the popularity of mobile Internet, more and more users want to through the various states smartphone monitoring industry field, such as alarm data.

, for this small make up specially selected recent relatively hot the Python programming language, using its third-party libraries pyModbusTCP and itchat, in order to realize through WeChat the function of the PLC controller data. Principle is as follows:

PC need to write a small program, implemented:

PLC data obtained through the Modbus TCP

by itchat library to forward the data to WeChat environment:

64

python 3 Windows 7. 5 + pyModbusTCP + itchat

例程:从pyModbusTCP

。 client import ModbusClientimport itchatc = ModbusClient( '192. 168. 1. 2、端口= 502 auto_open = True) def read_var ( 首先,len) :    reg=c. read_holding_registers ( 首先,len) If reg: message = 'current PLC controller address is:' + & # 39; 192. 168. 1. 2 ' + ' n” 消息+ = ' %MW' +str( 开始) + ' Initial value is: the & # 39; +str( 注册) 其他:打印( “读取错误”) 返回messagedef发送( 内容) :itchat。 send( 内容,toUserName = ' filehelper” ) if __name__ = =” __main__ ' :    mes=read_var( 0, 4) itchat。 auto_login( hotReload = True) send( mes)

run this program, by scanning the pop-up login WeChat qr code, can receive files assistant send the PLC controller data

ps. Similar can be implemented through mobile phone text messages, e-mails and other ways to monitor other Ethernet device data.


Coolmay allocates customer service resources to the platform where their customers are most vocal.
If you are thinking of having a , then you must be first clear about the purpose, which is driving you to buy this device. Shenzhen Coolmay Technology Co., Ltd. offer quality for your needs with complete assurance of ability to serve your purpose.
In order to obtain the most suitable for your programmable control systems, you need to contact qualified suppliers which can produce super quality to your specifications and offer a friendly price.
In a nutshell, is actually an ultimate solution for plc controller price and underestimating its value cost you higher than anything else. So grab it before you miss the boat.
Custom message
Chat Online 编辑模式下无法使用
Chat Online inputting...