您的位置:首页 > 理论基础 > 计算机网络

三菱PLC、FX5U MODBUS/TCP与PC通信格式范例

2020-04-05 12:13 6088 查看
/*03连续读取FX-5UPLC的多个字PLC保持寄存器的指令范例
*00 00 00 00 00 06 0A 03 00 09 00 0A
*整句的意思是读取“00 09”开始的10个地址长度,“00 0A”是10个地址的意思
*读取PLC的D10、D10、D11、D12、D13、D14、D15、D16、D17、D18、D19
*第1个“00 00”是TransactionID,Used by the master for matching of the response
*message from the slave.
*第2个“00 00”是ProtocolID(Indicates the protocol of the PDU (protocol data
*unit)),Stores 0 in the case of MODBUS R/TCP.
*第3个“00 06”是Message length,Stores the message size in byte unit.就是“第4个”+“第5个”的总长
*The message length after this field is stored. (See the above figure.)
*第4个“0A”是Module ID,Used to specify the slave connected to the other
*line, e.g. MODBUS R serial protocol.
*第5个“03 00 09 00 OA ”是PDU(Protocol data unit),参照“4.3 PDU Formats by Functions”
*其中“00 09”是MODBUS的起始地址,
*其中“00 0A”是读取的点数
*正确返回:00 00 00 00 00 17 0A 03 14 0001 0001 0002 0003 0058 0006 0007 0008 0009 000A
*错误返回:00 00 00 00 00 03 0A 83 02
***************************************************
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: