PLC1和PLC2建立S7连接,本地ID为100
谢谢!
L W#16#100
T "PLC1SENDPLC2".Static_1.PLC1SENDPLC2_LEN
NOP 0
CALL BSEND , "BSEND_DB"
ptr_type:=Variant
REQ :=true
R :="PLC1SENDPLC2".Static_1.PLC1SENDPLC2_R
ID :=W#16#100
R_ID :=DW#16#1
DONE :="PLC1SENDPLC2".Static_1.PLC1SENDPLC2_DONE
ERROR :="PLC1SENDPLC2".Static_1.PLC1SENDPLC2_ERROR
STATUS :="PLC1SENDPLC2".Static_1.PLC1SENDPLC2_STATUS
SD_1 :=P#DB51.DBX0.0 BYTE 100
LEN :="PLC1SENDPLC2".Static_1.PLC1SENDPLC2_LEN
L W#16#100
T "PLC1RECVPLC2".Static_1.PLC1RECVPLC2_LEN
NOP 0
CALL BRCV , "BRCV_DB"
ptr_type:=Variant
EN_R :=TRUE
ID :=W#16#100
R_ID :=DW#16#2
NDR :="PLC1RECVPLC2".Static_1.PLC1RECVPLC2_NDR
ERROR :="PLC1RECVPLC2".Static_1.PLC1RECVPLC2_ERROR
STATUS :="PLC1RECVPLC2".Static_1.PLC1RECVPLC2_STATUS
RD_1 :=P#DB52.DBX0.0 BYTE 100
LEN :="PLC1RECVPLC2".Static_1.PLC1RECVPLC2_LEN
--------ID:s7 connection的local ID
R _ID: 接收到的数据是对方具有相等R_ID数值的那个发送所发出的数据,不同的发送/接收对使用不同的R_ID值
欢迎光临 工控编程吧 (https://www.gkbc8.com/) | Powered by Discuz! X3.4 |