S7 communication between S7-1200 CPU and S7-200 SMART

Publisher:清新生活Latest update time:2023-05-06 Source: elecfansKeywords:S7-1200  CPU  S7-200  SMART Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

S7-1200 CPU communicates with S7-200 SMART S7 (S7-1200 as server)

For S7-200 SMART CPU firmware version V2.0 and above, the integrated PROFINET communication interface supports S7 communication, which can be achieved through the wizard or using GET/PUT instructions. Up to 16 S7 connections can be established, including: 8 clients and 8 servers.


The PROFINET communication interface integrated in the S7-1200 CPU can be used as a server for S7 communication. S7-1200 only supports S7 unilateral communication. As a client, you only need to configure the connection and program it, while as a server, you only need to prepare the communication data. As an S7 server, S7-1200 can use 6 dynamic connection resources.


This article takes S7-200 SMART as the client to perform S7 communication with S7-1200 through the wizard as an example to illustrate.


Hardware and software requirements and communication tasks performed

Hardware:

① S7-200 SMART standard CPU firmware version V2.5 (S7-ST40 DC/DC/DC order number in the document: 6ES7288-1ST40-0AA0)

② S7-1200 CPU firmware version V4.4 (S7-1215 DC/DC/DC order number in the document: 6ES7215-1AG40-0XB0)

③ PC (with Ethernet card), TP cable (Ethernet cable)

Software:

① STEP7-MicroWIN SMART V2.5

② TIA STEP7 V16

The communication tasks completed are as follows:

① S7-200 SMART sends the data in the 20 bytes starting from VB0 to the 20 bytes in the communication data area DB8 of S7-1200.

② S7-200 SMART reads the 20 bytes of data in DB9 of S7-1200 and stores them in the 20 bytes starting from VB100.

S7-1200 side configuration and programming


1. Create a new project

In the project, add S7-1215 DC/DC/DC, add a subnet to it and assign an IP address, as shown in Figure 1.

9ad8dd62-bce1-11ed-bfe3-dac502259ad0.png

Figure 1 S7-1215 DC/DC/DC

2. Create a DB

According to the requirements, create a DB data area and establish corresponding arrays, named Write and Read respectively, as shown in Figure 2.

9af2f634-bce1-11ed-bfe3-dac502259ad0.png

Figure 2 Creating a DB

3. Create DB1

As an S7 client, S7-200 SMART can only access the V area of ​​the server, but S7-1200 does not have a V area. The V area corresponds to DB1 in S7-1200, and can only correspond to DB1. Therefore, it is necessary to transfer the data in DB9 to DB1, and transfer the data in DB1 to DB8, thereby indirectly realizing the write and read operations of S7-200 SMART on S7-1200 DB8 and DB9; create DB1 and establish related variables, as shown in Figure 3.

9b11dd6a-bce1-11ed-bfe3-dac502259ad0.png

Figure 3 Creating DB1

4. Optimized block access

In the properties of the data block, you need to select non-optimized block access (uncheck the default). This operation is required for DB1, but not for DB8 and DB9, as shown in Figure 4. Note: You can see the offset only after compiling.

9b337178-bce1-11ed-bfe3-dac502259ad0.png

Figure 4 Optimized block access

5. Associated variables

Associate the variables that need to be written and read in DB8 and DB9 with the data in DB1, as shown in Figure 5.

9b56eaea-bce1-11ed-bfe3-dac502259ad0.png

Figure 5: Associated variables

6. Connection Mechanism

S7-1200 performs S7 communication as a server. For CPU firmware versions later than V4.0, you need to check "Allow PUT/GET communication access from remote objects". Otherwise, communication cannot be established, as shown in Figure 6.

9b78991a-bce1-11ed-bfe3-dac502259ad0.png

Figure 6 Connection mechanism

Notice:

The V area in S7-200 SMART corresponds to DB1 in S7-1200, and can only correspond to DB1.

S7-200 SMART side configuration and programming

1. System Block

Double-click "System Block" and set the IP address of the S7-200 SMART CPU, as shown in Figure 7.

9b98025a-bce1-11ed-bfe3-dac502259ad0.png

Figure 7 System block

2. Wizard

Use the wizard function to program GET/PUT communication and add two operations, named Read and Write respectively. After completion, click "Next", as shown in Figure 8.

9bafbc10-bce1-11ed-bfe3-dac502259ad0.png

Figure 8 Wizard

3. Configure Read Data

By selecting the operation type GET, setting the IP address of the remote CPU, setting the local CPU data area, and setting the remote CPU data area configuration Read data, after the operation is completed, click "Next", which means: S7-200 SMART reads 20 consecutive bytes of data with DB1.DBB0 as the starting address in S7-1200 DB1 and stores them in 20 consecutive bytes starting with VB100, as shown in Figure 9.

9bcacef6-bce1-11ed-bfe3-dac502259ad0.png

Figure 9 Configuring Read Data

4. Configure Write data

By selecting the operation type PUT, setting the IP address of the remote CPU, setting the local CPU data area, and setting the remote CPU data area configuration Wrtie data, after the operation is completed, click "Next", which means: S7-200 SMART sends the data in the 20 consecutive bytes starting from VB0 to the 20 consecutive bytes starting from DB1.DBB20 in the S7-1200 communication data area DB1, as shown in Figure 10.

9bfea640-bce1-11ed-bfe3-dac502259ad0.png

Figure 10 Configuring Write Data

5. Storage Area Allocation

Here, specify the starting address of the configuration in the V storage area. It is recommended to use a larger value to avoid conflict with other data. After the operation is completed, click "Next", as shown in Figure 11.

9c1afc5a-bce1-11ed-bfe3-dac502259ad0.png

Figure 11 Storage area allocation

6. Components

Here you can see the components automatically generated after configuration. Click "Generate" to complete the GET/PUT wizard configuration, as shown in Figure 12.

9c2e6178-bce1-11ed-bfe3-dac502259ad0.png

Figure 12 Components

7. Programming

Call the NET_EXE subroutine in the Main function and assign related pin parameters, as shown in Figure 13.

9c54e3c0-bce1-11ed-bfe3-dac502259ad0.png

Figure 13 Programming

At this point, the configuration and programming of S7-200 SMART as client and S7-1200 for S7 communication is complete.

Communication test

Connection Status

The successful establishment of the S7 connection is the basis for calling the PUT/GET instruction. Only after the S7 connection is successfully established can the PUT/GET instruction be correctly executed. In the network view of the TIA software, go online to monitor the S7 connection status, as shown in Figure 14.

9c6a6ce0-bce1-11ed-bfe3-dac502259ad0.png

Figure 14 S7 connection status

Data Interaction

Check whether the data interaction between the two is correct through online monitoring, as shown in Figure 15 and Figure 16.

9c7f62c6-bce1-11ed-bfe3-dac502259ad0.png

Figure 15 DB8 data

9cc4873e-bce1-11ed-bfe3-dac502259ad0.png

Figure 16 DB9 data


Keywords:S7-1200  CPU  S7-200  SMART Reference address:S7 communication between S7-1200 CPU and S7-200 SMART

Previous article:Brushless DC Motor Speed ​​Regulation Principle
Next article:Reasons why the brushless motor cannot start Reasons why the brushless DC motor loses step

Recommended ReadingLatest update time:2024-11-16 16:32

BiRen Technology begins to develop DPU, CPU and autonomous driving
Focusing on the industrial ecology, BiRen Technology has begun to deploy DPU, CPU and autonomous driving and other fields BiRen Technology, a domestic high-end general-purpose GPU chip company, recently participated in the angel round of investment of hundreds of millions of yuan in the domestic DPU s
[Automotive Electronics]
Compared with Intel and Huawei, how is the performance of Russia's most powerful CPU?
Russian processor developer Baikal Electronics wants to show the world that its chips can compete with Intel and Huawei, the best CPUs on the market. In a series of benchmark tests conducted by the company and shared with Russian news outlet Cnews, the fabless semiconductor vendor compared its Baikal-S server processo
[Embedded]
Compared with Intel and Huawei, how is the performance of Russia's most powerful CPU?
Principle and simulation of transfer instructions for RISC CPU
1 Introduction  In the design of RISC CPU, the processing of transfer instructions has a critical impact on the performance of the processor. Transfer instructions determine the execution order of the program and are frequently used in the program. In RISC CPU, the program is executed in a pipeline manner. When the
[Microcontroller]
Principle and simulation of transfer instructions for RISC CPU
S7-1200 counters include 3 types of counters
S7-1200 Counters The counters of S7-1200 are IEC counters. The number of counters that can be used in the user program is limited only by the memory capacity of the CPU. This is a software counter, and the maximum counting rate is limited by the execution rate of the OB in which it is located. The ex
[Embedded]
S7-1200 counters include 3 types of counters
CPU Learning Experience Sequel 2
        I have been trying to understand the operation of the program using circuits, but in the end I still can't figure it out.         The core of digital circuits is a variety of gates, a bit like Zhuge Liang's Bagua formation. The CPU is naturally a complex digital circuit, filled with a large number of gates. No
[Microcontroller]
Geely welcomes Smart, Daimler and Geely Group will form a joint venture
There is big news today (now there is big news every week in the automotive industry). Geely welcomes Smart. Daimler and Geely Group will form a joint venture to jointly operate the Smart brand globally. Here we will not talk about the joint venture equity ratio, but just want to talk about how to make the future pure
[Embedded]
Geely welcomes Smart, Daimler and Geely Group will form a joint venture
Introducing the implementation method of Smart Line touch screen and V20 inverter communication via MODBUS
Normally, to achieve communication between the HMI device and the V20 inverter, a PLC that supports USS communication or MODBUS communication is required, such as the S7-200 series PLC. The communication cable connection is shown in Figure 1. One communication port of the PLC is connected to the touch screen, and th
[Embedded]
Introducing the implementation method of Smart Line touch screen and V20 inverter communication via MODBUS
Signal sampling amplification and A/D conversion circuit design of temperature control system
one. Introduction   This temperature control and display system is a closed-loop feedback control system. It uses a temperature sensor to amplify the detected temperature signal, convert it into A/D and then send it to the computer. It compares it with the set value to obtain the deviation. This deviation is correct
[Analog Electronics]
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号