【IIOT】Siemens PLC data acquisition S7-200


foreword

The Industrial Internet is one of China's new infrastructures, so data collection must be one of the infrastructures of the Industrial Internet. No matter how many high-end things you can think of, such as digital twins, digital management, predictive maintenance, etc., etc. Inseparable from one word: data!

The magnitude of the data is very large, including the data of the whole value chain and the whole industry chain such as people, machines, objects, and systems; if you zoom out and only look at the data of the machines at the workshop level, the objects of data collection can be enumerated: PLC , CNC, ROBOT, smart instrument/sensor, industrial computer.

Therefore, the author intends to publish a series of articles on the data acquisition scheme of PLC in the near future. Welcome to pay attention and exchange!


1. Workshop-level digital acquisition system architecture

At present, there are two methods of data collection: ① "Edge Gateway" collects one-to-one, and then transmits the data back to the server for summary; ② "Acquisition package software" collects one-to-N, and one collection package realizes the data collection of one workshop.

Both approaches have pros and cons. The first type of hardware is extremely expensive, but it is stable, and even if the workshop network fails, it will not affect the local collection; the second type is extremely low in cost, and the "data collection package + implementation plan" can realize the data collection of the entire workshop equipment. However, excessive dependence on the stability of the workshop network, network failure will lead to the interruption of data acquisition in a large area or even the entire workshop.

Workshop-level digital acquisition system architecture diagram:

insert image description here


2. Introduction of Siemens PLC

If you want to learn about Siemens PLC related knowledge, you can be more familiar with the above three links!


3. S7-200 product description

The S7-200 series has been discontinued at present, and its replacement upgrade product is S7-200 SMART; but because the equipment in many factories is relatively old, S7-200 will still be encountered when doing projects.

If you want to learn S7-200 systematically, you can view: "S7-200 System Manual"

3.1. CPU specifications

The S7-200 CPU has the following 6 types:
insert image description here

3.2. Internal registers

  1. I/O image area related to actual I/O signal:

I: Digital input (DI)
Q: Digital output (DO)
AI: Analog input
AQ: Analog output

  1. internal data store

V: variable storage area, you can access the data in V area by bit, byte, word or double word
M: bit storage area, you can access the data in M ​​area by bit, byte, word or double word
T: Timer The storage area is used for time accumulation, and the resolution is divided into three types: 1ms, 10ms, and 100ms.
C: The counter storage area is used to accumulate the number of times the pulse level of its input terminal changes from low to high. The CPU provides three types of counters: one can only count up; one can only count down; the other can count up and down

3.3. Support agreement

insert image description here


4. Data collection plan

The principle of data acquisition: realize the networking of workshop equipment at the lowest cost!
How do you understand this minimum cost? For example, make as few modifications to the original PLC program as possible, and do not buy expansion modules if you can buy expansion boards.

4.1. Select protocol

Combining the protocol summary table and data collection principles in 3.3, it is found that the optimal upper-level collection protocols are: S7 protocol, PPI, MPI ; the comparison of the three protocol collection schemes is as follows:

protocol PLC side interface position PLC side interface type Transmission medium Communication line Host computer interface type Set communication parameters Default Communication Parameters
S7 agreement 1. Module: CP243-1 RJ45 ethernet cable RJ45 IP port 102
S7 agreement 2. Module: CP243-1 IT RJ45 ethernet cable RJ45 IP port 102
PPI 1.CPU:Port 0/1 DB-9 holes RS485 RS232 to PPI DB-9 pin (RS232) Baud rate, station number 8E1
MPI 1.CPU:Port 0/1 DB-9 holes RS485 RS232 to MPI DB-9 pin (RS232) Baud rate, station number 8E1
MPI 2. Module: EM277 DB-9 holes RS485 RS232 to MPI DB-9 pin (RS232) Baud rate, station number 8E1

TIPS1: The IP in the above table refers to "IP address, subnet mask, default gateway"
TIPS2: S7 protocol, PPI, MPI three protocols do not need to modify the PLC program, only modify the "set communication parameters" in the above table

Therefore, if the data acquisition supplier wants to realize the full-scenario data acquisition of the S7-200 series, it must support three protocols: S7 protocol, PPI, and MPI; and in order to realize the conversion between the serial port and the network port, it must also support: PPI over TCP, MPI over TCP.

4.2. Hardware Architecture

Hardware architecture according to data flow direction:
data acquisition server → workshop network environment → network module/edge gateway → communication line → communication port expansion module → device controller

A single scene is agreed here to facilitate the display of the hardware architecture:

  • Data acquisition method: acquisition package software
  • Workshop network environment: Ethernet
  • Collection object: S7-200 CPU221 and Port 0 is free

According to the above scenarios, determine the acquisition plan: ① Deploy the acquisition package software on the "acquisition server"; ② Select the protocol: PPI over TCP; ③ Hardware procurement and installation, the following architecture; ④ PLC terminal configuration, network module configuration; ⑤ Test data acquisition.



Copyright Statement ©
Please indicate the source for reprinting.
It is not easy to be original, and it is only a modest contribution to the Industrial Internet!

Guess you like

Origin blog.csdn.net/weixin_45658354/article/details/124512691