LD SM0.0
= L60.0
LD SM0.0
= L63.7
LD L60.0
CALL MBUS_CTRL:SBR1, L63.7, 9600, 0, 1, M0.0, MB1
LD SM0.0
= L60.0
LD SM0.5
EU
= L63.7
LD L60.0
CALL MBUS_MSG:SBR2, L63.7, 10, 1, 40002, 1, &VB2000, M0.1, MB2
LD I0.0
O V2000.0
AN I0.1
= V2000.0
I0.0为0时 报文是0A 06 00 01 00 00 D9 71
I0.0为1时 报文是0A 06 00 01 01 00 D8 E1
中间这段数据看不明白 00 01 00 00? 00 01 01 00?
最佳答案
I0.0为0时 报文是0A 06 00 01 00 00 D9 71 含义向地址为10(00 01)的从站的01寄存器写入值0 (00 00)
I0.0为1时 报文是0A 06 00 01 01 00 D8 E1 含义向地址为10的从站的01(00 01)寄存器写入值256(01 00)
注:01寄存器在S7-200里指的是40002【CALL MBUS_MSG:SBR2, L63.7, 10, 1, 40002, 1, &VB2000, M0.1, MB2】,报文时16进制的
提问者对于答案的评价:
xiexie
专家置评
参考@WWCWWC的回答
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc174767.html