PPI协议
PPI是一种主--从协议:主站器件发送要求到从站器件,从站器件响应,参见图7-7。从站器件不发信息,只是等待主站的要求并对要求作出响应。
主站靠一个PPI协议管理的共享连接来与从站通讯。PPI并不限制与任意一个从站通讯的主站数量,但是在一个网络中,主站的个数不能超过32。
图7-7 PPI 网络
如果在用户程序中使能PPI主站模式,S7--200 CPU在运行模式下可以作主站。(参见附录B中SMB30的描述)在使能PPI主站模式之后,可以使用网络读写指令来读写另外一个S7--200。当S7--200作PPI主站时,它仍然可以作为从站响应其它主站的请求。
PPI高级允许网络设备建立一个设备与设备之间的逻辑连接。对于PPI高级,每个设备的连接个数是有限制的。S7--200支持的连接个数如表7-3所示。所有的S7--200 CPU都支持PPI和PPI高级协议,而EM277模块仅仅支持PPI高级协议。
表7-3 S7--200 CPU和EM277模块的连接个数模块波特率连接数
表7-3 S7--200 CPU和EM277模块的连接个数 模块 S7--200CPU 通讯口0 通讯口1 EM277 波特率 9.6k、19.2k或187.5k 9.6k、19.2k或187.5k 9.6k到12M 波特率连接数 4 4 6(每个模块) MPI协议
MPI允许主--主通讯和主--从通讯,参见图7-8。与一个S7--200 CPU通讯,STEP 7--Micro/WIN建立主--从连接。MPI协议不能与作为主站的S7--200 CPU通讯。
网络设备通过任意两个设备之间的连接通讯(由MPI协议管理)。设备之间通讯连接的个数受S7--200CPU或者EM277模块所支持的连接个数的限制。S7--200支持的连接个数如表7-3所示。
对于MPI协议,S7--300和S7--400 PLC可以用XGET和XPUT指令来读写S7--200的数据。要得到更多关于这些指令的信息,参见S7--300或者S7--400的编程手册。
6
图7-8 MPI网络
PROFIBUS协议
PROFIBUS协议通常用于实现与分布式I/O(远程I/O)的高速通讯。可以使用不同厂家的PROFIBUS设备。这些设备包括简单的输入或输出模块、电机控制器和PLC。
PROFIBUS网络通常有一个主站和若干个I/O从站,参见图7-9。主站器件通过配置可以知道I/O从站的类型和站号。主站初始化网络使网络上的从站器件与配置相匹配。主站不断地读写从站的数据。图7-9 PROFIBUS网络。
图7-9 PROFIBUS网络
当一个DP主站成功配置了一个DP从站之后,它就拥有了这个从站器件。如果在网上有第二个主站器件,那么它对第一个主站的从站的访问将会受到限制。
TCP/IP协议
通过以太网扩展模块(CP243--1)或互联网扩展模块(CP243--1 IT),S7--200将能支持TCP/IP以太网通讯。表7-4列出了这些模块所支持的波特率和连接数。
表7-4 以太网模块(CP243--1)和互联网模块(CP243--1 IT)的连接数。
7
表7-4 以太网模块(CP243--1)和互联网模块(CP243--1 IT)的连接数 模块 以太网(CP243--1)模块 互联网(CP243--1 IT)模块 波特率 10到100兆 1个STEP 7--Micro/WIN连接 连接数 8个普通连接 若需更多信息,可参考SIMATIC NET CP243--1工业以太网通讯处理器手册或SIMATIC NETCP243--1 IT工业以太网及信息技术通讯处理器手册。
8
英文资料原文
Understanding the Basics of S7-200 Network Communications Selecting the Communication Interface for Your Network
by Moniruzzaman, Mohammad.; M.A.Sc.; Concordia University (Canada).; 2006;
The S7-200 is designed to solve your communications and networking needs by supporting not only the simplest of networks but also supporting more complex networks. The S7-200 also provides tools that allow you to communicate with other devices, such as printers and weigh scales which use their own communications protocols.
The S7-200 supports many different types of communication networks. The selection of a network is performed within the Set PG/PC Interface property dialog. A selected network is referred to as an Interface. The different types of interfaces available to access these communication networks are:
1. PPI Multi-Master cables 2. CP communication cards 3. Ethernet communication cards
To select the communication interface for STEP 7--Micro/WIN, you perform the following steps. See Figure 7-1.
1. Double-click the icon in the Communications Setup window. 2. Select the interface parameter for
Figure 7-1 STEP 7--Micro/WIN Communications Interface
PPI Multi-Master Cables
1 2 The S7-200 supports communication through two different types of PPI Multi-Master cables. These cable types permit communication through either an RS-232 or a USB interface.
As shown in Figure 7-2, selecting the PPI Multi-Master cable type is simple. You perform the following steps:
1. Click the Properties button on the Set PG/PC Interface property page.
9
2. Click the Local Connection tab on the Properties page. 3. Select the USB or the desired COM port.
Figure 7-2 PPI Multi-Master Cable Selection
Tip
Please note that only one USB cable can be used at a time. Tip
Examples in this manual use the RS-232/PPI Multi-Master cable. The RS-232/PPI Multi-Master cable replaces the previous PC/PPI cable. A USB/PPI Multi-Master cable is also available. Refer to Appendix E for order numbers.
Using Master and Slave Devices on a PROFIBUS Network
The S7-200 supports a master-slave network and can function as either a master or a slave in a PROFIBUS network, while STEP 7--Micro/WIN is always a master. Masters
A device that is a master on a network can initiate a request to another device on the network. A master can also respond to requests from other masters on the network. Typical master devices include STEP 7--Micro/WIN, human-machine interface devices such as a TD 200, and S7-300 or S7-400 PLCs. The S7-200 functions as a master when it is requesting information from another S7-200 (peer-to-peer communications). Tip
A TP070 will not work on a network with another master device. Slaves
A device that is configured as a slave can only respond to requests from a master device; a slave never initiates a request. For most networks, the S7-200 functions as a slave. As a slave device, the S7-200 responds to requests from a network master device, such as an operator panel or STEP 7--Micro/WIN. Setting the Baud Rate and Network Address
The speed that data is transmitted across the network is the baud rate, which is typically measured in units of kilo baud (kbaud) or mega baud (Mbaud). The baud rate measures how much data can be transmitted
10
1 2 3