S7 200与s7 300之间采用MPI通讯方式时,S7 200 PLC中不需要编写任何与通讯有关的程
序,只需要将要交换的数据整理到一个连续的V存储区当中即可,而S7 300中需要在OB1
(或是定时中断组织块OB^)当中调用系统功能X—GET(SFC67)和X—PUT(SFC68),实现
S7 300与S7 200之间的通讯,调用SFC67和SFC68时VAR—ADDR参数填写S7-200的数据地址
区,由于S7-200的数据区为v区,这里需填写P#DB1.XXX BYTE n对应的就是S7 200 V
存储区当中VBXX到VB(XX+n)的数据区。
首先根据的硬件配置,在STEP7当中组态S7-300站并且下载,注意S7-200和 S7-300出厂默认的MPI地址都是2,所以必须先修改其中一个PLC的站地址,例子程序当中将 S7-300 MPI地址设定为2,S7-200地址设定3,另外要分别将S7-300和S7-200的通讯速率设定 一致,可设为9.6K,19.2K,187.5K三种波特率

When MPI communication mode is adopted between S7 200 and S7 300, there is no need to write any communication related program in S7 200 PLC
Sequence, you only need to sort the data to be exchanged into a continuous V storage area, while S7 300 needs to be in ob1
(or timed interrupt organization block ob^), call the system functions x-get (sfc67) and x-put (sfc68) to realize
For the communication between S7 300 and S7 200, when calling sfc67 and sfc68, the var-addr parameter fills in the data address of S7-200
Area, because the data area of S7-200 is area V, p#db1 needs to be filled here XXX byte n corresponds to S7 200 V
The data area from vbxx to VB (xx+n) in the storage area.
First, according to the hardware configuration of S7-300, configure the S7-300 station in STEP7 and download it. Note that the factory default MPI address of S7-200 and S7-300 is 2, so you must first modify the station address of one PLC. In the example program, set the S7-300 MPI address to 2 and the S7-200 address to 3. In addition, set the communication rate of S7-300 and S7-200 to be consistent, which can be set to 9.6K, 19.2k and 187.5k baud rates







客服1