关于西门子cup314作为从站组态连接到cpu412主站的方法:
软件编写要注意事项----在cpu412的程序OB1或OB35组织块里,
CALL "DPRD_DAT" // SFC 14, read data from cp342-5!
LADDR :=W#16#0 // This is start input address in cpu412!
RET_VAL:=MW2
RECORD :=P#I 0.0 BYTE 28
CALL "DPWR_DAT" // SFC15, write data to cp342-5!
LADDR :=W#16#0 // This is start output address in cpu412!
RECORD :=P#Q 0.0 BYTE 28
RET_VAL:=MW4
同样, 在cpu314的程序OB1或OB35组织块里,
CALL "DP_SEND" // FC1, send data to cpu412!
CPLADDR:=W#16#100 // This is hardware address 256 of cp342-5!
SEND :=P#M 10.0 BYTE 28
DONE :=M1.0
ERROR :=M1.1
STATUS :=MW2
CALL "DP_RECV" // FC2, recieve data from cpu412
CPLADDR :=W#16#100 // This is hardware address 256 of cp342-5!
RECV :=P#M 50.0 BYTE 28
NDR :=M1.2
ERROR :=M1.3
STATUS :=MW4
DPSTATUS:=MB6
06-05-22 10:28