How to collect on-site PLC data via WeChat?

With the popularization of the mobile Internet, more and more users hope to monitor various status, alarm, and other data on the industrial site through smart phones.

To this end, Xiao Bian specifically selected the most recent hot programming language Python, using its third-party libraries pyModbusTCP and itchat, in order to achieve the collection of on-site PLC data through WeChat.

The principle is as follows:

A small program needs to be written on the PC to achieve:

Get PLC data via Modbus TCP

Forward data to WeChat through itchat library

surroundings:

Win7 64

Python 3.5+pyModbusTCP+itchat

Routines:

From pyModbusTCP.client import ModbusClientimport itchatc = ModbusClient("192.168.1.2", port=502,auto_open=True)def read_var(start,len): reg=c.read_holding_registers(start,len) if reg: message="Current PLC The address is: "+'192.168.1.2'+'' message+='%MW'+str(start)+' The starting value is:'+str(reg) else: print("Read error") return messagedef send (content): itchat.send(content, toUserName='filehelper') if __name__=='__main__': mes=read_var(0,4) itchat.auto_login( hotReload = True) send(mes)

Run this program and scan the pop-up QR code to log in WeChat to receive the PLC data sent by the file assistant.

Similarly, ps. can also monitor other Ethernet device data through SMS, email, etc.

Leather USB Flash Disk

High-end USB 3.0 Flash Pen Drive leather Storage Card Disk 8gb 16GB 32gb 64gb 128gb Pen drive.

Customize:
1) Do Customer's logo on USB Flash Drive.
Method: digital Print, Silk screen Print, Laser engraving, doming etc.
2) Make USB flash drive with Customer's design.
3) Preload Erasable data or unerasable data.
4) Do Auto-Play. Such as playing your vedio or open your website while connecting to the computer.
5) Make Customer design Package or Lanyard.


Leather Usb Flash Disk,Usb Memory Stick Housing,Rectangle Leather Usb Flash Drive,Rectangle Leather Custom Pendrivde

MICROBITS TECHNOLOGY LIMITED , https://www.hkmicrobits.com