S7 200與s7 300之間采用MPI通訊方式時,S7 200 PLC中不需要編寫任何與通訊有關(guān)的程
序,只需要將要交換的數(shù)據(jù)整理到一個連續(xù)的V存儲區(qū)當中即可,而S7 300中需要在OB1
(或是定時中斷組織塊OB^)當中調(diào)用系統(tǒng)功能X—GET(SFC67)和X—PUT(SFC68),實現(xiàn)
S7 300與S7 200之間的通訊,調(diào)用SFC67和SFC68時VAR—ADDR參數(shù)填寫S7-200的數(shù)據(jù)地址
區(qū),由于S7-200的數(shù)據(jù)區(qū)為v區(qū),這里需填寫P#DB1.XXX BYTE n對應(yīng)的就是S7 200 V
存儲區(qū)當中VBXX到VB(XX+n)的數(shù)據(jù)區(qū)。
首先根據(jù)的硬件配置,在STEP7當中組態(tài)S7-300站并且下載,注意S7-200和 S7-300出廠默認的MPI地址都是2,所以必須先修改其中一個PLC的站地址,例子程序當中將 S7-300 MPI地址設(shè)定為2,S7-200地址設(shè)定3,另外要分別將S7-300和S7-200的通訊速率設(shè)定 一致,可設(shè)為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