Siemens s7-200smart and s7-1200PLC communication technology

Publisher:知者如渊Latest update time:2022-11-18 Source: elecfansKeywords:Siemens Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

This article takes one CPU1215C (6ES7215-1AG40-0AB0) and one S7-200SMART PLC as an example to introduce the S7 communication between them.


Hardware:
S7-1200CPU
S7-200 SMART CPU (firmware V2.0)
PC (with Ethernet card)
TP Ethernet cable


Software:
TIAV16
STEP 7 Micro/WIN SMART V2.1

Completed communication tasks:

The S7-1200 sends 200 bytes in the communication data area DB1 to the VB data area of ​​the S7-200SMART.

S7-1200 reads the VB data area in S7-200SMART and stores it in the data area DB2 of S7-1200.

S7-1200 hardware configuration and network configuration


1 Use TIAV16 software to create a new project, add an S7-1200 station and assign it a network and IP address, as shown in Figure 1-1.

a057f058-659c-11ed-8abf-dac502259ad0.png

Figure 1-1 Adding S7-1200 station in Botu software


2. Add a new connection for S7-1200CPU in the network view of TIA V16 software, as shown in Figure 1-2:

a07c2c84-659c-11ed-8abf-dac502259ad0.png

Figure 1-2 S7-1200 adding a new connection


In the pop-up "Create New Connection" dialog box, select "Unspecified", and then click the "Add" button to add a new connection, as shown in Figure 1-3.

a0b1fefe-659c-11ed-8abf-dac502259ad0.png

Figure 1-3 Selecting an unspecified connection


You need to specify the IP address and TSAP of the connection partner for the newly created connection. The setting method is shown in Figure 1-4 and Figure 1-5.

Note: TSAP on the S7-200SMART side can only be set to 03.00 or 03.01.

a0de5f26-659c-11ed-8abf-dac502259ad0.png

Figure 1-4 Setting the connection partner IP address

a11a0364-659c-11ed-8abf-dac502259ad0.png

Figure 1-5 Setting the TSAP address of the connection partner

TIA software program programming

1. Create a send data block DB1 (similar to the receive area data block DB2). The data block is defined as an array of 200 bytes and the "Optimized block access" option needs to be cancelled in the properties of the data block, as shown in Figure 1-6.

a15a8b1e-659c-11ed-8abf-dac502259ad0.png

Figure 1-6 Creating a data block and canceling optimized access


2. After the send data block and the receive data block are created, you can call the PUT/GET instruction in OB1 to perform S7 communication, as shown in Figure 1-7.

a1bc24e6-659c-11ed-8abf-dac502259ad0.png

Figure 1-7 Calling PUT/GET instructions


Table 1. PUT instruction parameter description

CALL "PUT" , %DB3 //Call PUT and use background DB block: DB3
REQ :=%M0.0 //The rising edge triggers the call of the program block
ID :=W#16#0100 //The connection number should be consistent with the connection configuration. The connection number when creating the connection is shown in Figure 1. Mark 7
DONE :=%M2.0 // When it is 1, the sending is completed
ERROR :=%M2.1 // When it is 1, a fault occurs
STATUS :=%MW4 // Status code
ADDR_1 :=P#DB1.DBX0.0 BYTE 200 // Address sent to the communication partner data area, corresponding to S7-200 SMART VB0-VB199
SD_1 :=P#DB1.DBX0.0 BYTE 200 // Local send data area

Table 2. GET command parameter description

CALL "GET" , %DB4 //Call GET, use background DB block: DB4
REQ :=%M0.1 //System clock 2 second pulse
ID :=W#16#0100 //The connection number should be consistent with the connection configuration. The connection number when creating the connection is shown in Figure 1. Mark 7
NDR :=%M2.2 //When it is 1, new data is received
ERROR :=%M2.3 //When it is 1, a fault occurs
STATUS :=%MW6 //Status code
ADDR_1 :=P#DB1.DBX200.0 BYTE 200 //The address to read data from the communication partner data area, corresponding to S7-200 SMART VB200-VB399
RD_1 :=P#DB2.DBX0.0 BYTE 200 //Local receiving data address

Based on the above steps, the programming of the S7-1200 hardware and software has been completed. Downloading only requires downloading the program to the S7-1200PLC.


Condition Monitoring

1. Connection status monitoring

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 executed correctly.


In the network view of the TIA software, switch the software to online mode to monitor the S7 connection status, as shown in Figure 1-8.

a242db08-659c-11ed-8abf-dac502259ad0.png

Figure 1-8 Monitoring S7 connection status


After the S7 connection is successfully established, the S7-1200 triggers the PUT/GET instruction. Through the TIA software monitoring table and the STEP7 Micro/WIN SMART software status table, you can monitor whether the data communication is normal.


Note: The V area in S7-200SMART corresponds to DB1, that is, the communication partner data area ADDR_1=P#DB1.DBX0.0BYTE 200 used in the PUT instruction corresponds to VB0~VB199 in S7-200SMART.


In this document, S7-200SMART acts as the S7 communication server, occupying the server connection resources of the S7-200SMART PLC. The S7-200SMART PLC itself does not need to write a communication program.


Another method for S7-1200 to communicate with S7-200SMART S7 is to use S7-200SMART PLC as the client and S7-1200 as the server. This method requires S7-200SMART to call PUT/GET instructions, and the S7-1200 side does not need to write a communication program.


Keywords:Siemens Reference address:Siemens s7-200smart and s7-1200PLC communication technology

Previous article:Three control methods of PLC servo motor
Next article:Research on the method of confirming the position of brushless motor Hall sensor and motor rotation direction

Recommended ReadingLatest update time:2024-11-16 12:58

Siemens Gamesa launches innovative volcanic rock energy storage system
Siemens and Gamesa Renewable Energy (SGRE) have pioneered an electric thermal energy storage system (ETES) that can store large amounts of energy efficiently and at low cost. The thermal storage facility uses about 1,000 tons of volcanic rock as the energy storage medium and converts electrical ener
[New Energy]
A brief discussion on the PID control technology function of Siemens S7-1200PLC
Characteristics of analog closed-loop control system-PID control: It does not require a mathematical model of the controlled object, has a simple structure, is easy to implement, is easy to use, and has strong flexibility and adaptability.
[Embedded]
A brief discussion on the PID control technology function of Siemens S7-1200PLC
Siemens launches cloud-native software for electrical design
Siemens launches cloud-native software for electrical design • Siemens launched the Capital Electra X solution to provide cloud-native software for electrical design to small and medium-sized enterprises. • This browser-based solution enables designers and engineers to create electrical schematics at a low cost us
[Industrial Control]
Siemens Healthineers' innovative technology uses AI for real-time cardiac MRI diagnosis
Intel and Siemens Healthineers* are collaborating on a breakthrough AI-based cardiac MRI (magnetic resonance imaging) segmentation and analysis model that has the potential to provide real-time cardiovascular disease diagnosis. Intel and Siemens Healthineers used 2nd Generation Intel® Xeon® Scalable processors for AI
[Internet of Things]
Siemens Healthineers' innovative technology uses AI for real-time cardiac MRI diagnosis
Application experience of PID function block of Siemens S7-300PLC
1. Automatic adjustment can be performed in the software; 2. The automatically adjusted PID parameters may not be the best for the system, so they need to be adjusted manually based on experience. If the P parameter is too small, it will take too long to reach dynamic balance; if the P parameter is too large, i
[Embedded]
Siemens touch screen and PLC Ethernet communication steps
In actual production, we often encounter situations where one PLC cannot meet process requirements, such as insufficient number of high-speed pulse channels or insufficient number of analog input/output channels. If a large PLC is replaced, the cost will increase significantly. At this time, we can consider using mu
[Embedded]
Siemens touch screen and PLC Ethernet communication steps
Design of variable frequency air conditioner electronic control system based on Siemens special single chip microcomputer C504
1 Introduction Air conditioning systems are now widely used in production and life. With the decreasing energy and the increasing air pollution, energy saving has become an issue that cannot be ignored. As we all know, variable frequency air conditioner is a new product that combines energy saving, comfort and
[Microcontroller]
Design of variable frequency air conditioner electronic control system based on Siemens special single chip microcomputer C504
Profibus-DP communication example between Siemens and ABB robots
1. Configuration of TIA Portal A Create a new project in the TIA Portal software. In this case, S7-300 is selected, and its model is 313C-2DP. This PLC is an integrated PLC with its own PROFIBUS-DP port. It can be used as a master station or a slave station. In this case, the PLC acts as a master station.
[robot]
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号