S7-1200 CPU and S7-200 SMART S7 communication

Publisher:vettykattyLatest update time:2023-09-21 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.

dfbf0260-e781-11ed-ab56-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.

dfce9978-e781-11ed-ab56-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.

dfdeb100-e781-11ed-ab56-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.

dfe77812-e781-11ed-ab56-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.

dff0842a-e781-11ed-ab56-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.

dff96a36-e781-11ed-ab56-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.

dffffa22-e781-11ed-ab56-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.

e0090540-e781-11ed-ab56-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.

e012dae8-e781-11ed-ab56-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.

e01df928-e781-11ed-ab56-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.

e0306aae-e781-11ed-ab56-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.

e03e153c-e781-11ed-ab56-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.

e048bc9e-e781-11ed-ab56-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.

e051440e-e781-11ed-ab56-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.

e0661d52-e781-11ed-ab56-dac502259ad0.png

Figure 15 DB8 data

e075a84e-e781-11ed-ab56-dac502259ad0.png

Figure 16 DB9 data


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

Previous article:6 Tips for PLC Program Encryption
Next article:Siemens S7-1500PLC MODBUS communication case

Recommended ReadingLatest update time:2024-11-16 09:31

Siemens S7-200 SMART and ultrasonic flow meter MODBUS communication
S7-200 Smart is a new controller developed by Siemens to replace S7-200. Its advantage is that it has a local serial communication interface and an Ethernet interface. It can realize MODBUS communication of conventional instruments, and can also communicate with the host computer via Ethernet or connect to profinet
[Embedded]
285,000 CPU cores + 10,000 GPUs, Microsoft launches world's top five supercomputer
According to foreign media reports, Microsoft announced at its annual developer conference Build 2020 that it has built a supercomputer ranked among the top five in the world.     Microsoft   Microsoft said it has built a top-five supercomputer in an exclusive partnership with OpenAI, an artificial intelligence n
[Internet of Things]
285,000 CPU cores + 10,000 GPUs, Microsoft launches world's top five supercomputer
Why are computer CPUs so expensive? Here are the reasons
The CPU you see looks like this:                                                  This is the packaged form. The shell and silicon circuit board are actually worthless. The most expensive part comes from the chip inside. The chip is in this wafer form before it is cut:    Those who have no idea about chips and the se
[Embedded]
Why are computer CPUs so expensive? Here are the reasons
Siemens S7-200PLC has integrated high-speed counting function
Siemens S7-200 PLC integrates high-speed counting function, which is a very important function of PLC. In the industrial field, pulse instruments, such as rotary encoders, are generally used to measure rotation speed and cycle. The frequency of such instruments is much greater than the acquisition frequency of PLC,
[Embedded]
S7 Communication Server Solution for S7-1200 PLC
The PROFINET communication port of S7-1200 can be used as the server or client of S7 communication (CPU V2.0 and above). S7-1200 only supports S7 unilateral communication. You only need to configure (as shown in Figure 1) and connect and program (as shown in Figure 2) on the client side, and the server side only nee
[Embedded]
CPU operating mechanism
MCU Architecture The architecture of MCU mainly consists of three parts: CPU, memory and peripherals. Among them, the study of CPU mainly needs to master the following aspects: Register Group instruction Stack Interrupt clock An overall architecture diagram of the CPU: In the above figure, you can clearly see the
[Microcontroller]
CPU operating mechanism
Method of measuring analog signal by using high-speed counter in S7-200PLC
1. Analog quantity acquisition requires a good signal environment, including good power supply for sensors and instruments! Try to avoid strong power cables and high, medium and low frequency interference in analog quantity transmission lines, such as: high frequency welding pipe machine, medium frequency heating fu
[Embedded]
Introduction to Siemens S7-200 SMART PLC programming software
The programming soft element of PLC is essentially a memory unit, and each unit has a unique address. In order to facilitate different programming functions, the memory unit is partitioned, so there are different types of programming elements. Soft elements are devices with certain functions inside the PLC. These de
[Embedded]
Introduction to Siemens S7-200 SMART PLC programming software
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号