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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Figure 12 Components
7. Programming
Call the NET_EXE subroutine in the Main function and assign related pin parameters, as shown in Figure 13.
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.
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.
Figure 15 DB8 data
Figure 16 DB9 data
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
- Popular Resources
- Popular amplifiers
- Siemens PLC Programming Technology and Application Cases (Edited by Liu Zhenquan, Wang Hanzhi, Yang Kun, etc.)
- Siemens PLC from Beginner to Mastery with Color Illustrations (Yang Rui)
- Experience and skills in using Siemens S7-200PLC (Shang Baoxing)
- Siemens S7-1200-PLC Programming and Application Tutorial (3rd Edition) (Edited by Shi Shouyong)
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Four-axis special PID parameter tuning method and principle
- [Hua Diao Experience] 10-line empty board hardware control pinpong library series test (Part 3)
- Can this schematic control the LDO enable and disable through transistors?
- Huada HC32F4A0 replaces STM32F405/407/427 series chips--simple replacement comparison
- How to deal with unused pins of STM32L151 low power consumption
- What is the principle of this temperature measuring water cup? Doesn't it need to replace the battery?
- Why can byte addresses overlap with bit addresses?
- Creative Cube
- 10 ways to dissipate heat from PCB!!!
- LOTO Lesson 3: Frequency Response Curve Plotting --- 3 groups of RC low-pass filter tests with different parameters