How to Use Signal Interface IV 485 Communication Protocol本功能使用485通讯,直接修改调用内部参数,应用于机器人/工控机PLC控制【信号接口4】 This function uses 485 communication to directly modify and call internal parameters, and is applied to PLC control of robot/industrial computer [signal interface 4]. 1. 硬件接口定义 我司手持焊产品对外通信接口为 RS485 接口,采用 DB9 母头插座。该 DB9 插座接口定 义见表 1.1。 1. Hardware interface definition The external communication interface of our hand-held welding products is RS485 interface and adopts DB9 female socket. See Table 1.1 for the definition of the DB9 socket interface. 2. 通信格式 本协议兼容 Modbus RTU 规范。 2.1 通信模块基本参数 2. Communication format This protocol is compatible with Modbus RTU specification. 2.1 Basic parameters of communication module 2.2 寄存器地址定义 2.2 register address definition 注:R/W—表示该参数能读能写;R—表示该参数只能读;W—表示该参数只能写 Note: R/W— indicates that this parameter can be read and written; R— indicates that the parameter can only be read; W— indicates that the parameter can only be written. 2.3 数据帧格式 (1)发送、回执(成功响应)基本数据格式 2.3 data frame format (1) Basic data format of sending and receipt (successful response) 从机地址:手持焊默认地址为 0x09,暂不支持修改。 功能码:见表 2.5。 0x03 读 1 个或多个寄存器,对应的异常回执功能码为 0x83; 0x10 写 1 个或多个寄存器,对应的异常回执功能码为 0x90。 数据区:n 个字节,双字节数据时,高字节在前,低字节在后。 错误校验码:校验方式采用 CRC16(Modbus),高字节在前,低字节在后。CRC 计算包含从“从机地址”开始,直到 CRC 校验码前的所有数据,计算方法参见附录 A。 Slave address: The default address of handheld welding is 0x09, and modification is not supported for the time being. Function code: See Table 2.5. 0x03 reads one or more registers, and the corresponding abnormal receipt function code is 0x83;; 0x10 writes one or more registers, and the corresponding abnormal receipt function code is 0x90. Data area: n bytes. In case of double-byte data, the high byte comes first and the low byte comes last. Error checking code: CRC16(Modbus) is used for checking, with the high byte in front and the low byte in the back. CRC calculation includes all data from "slave address" to CRC check code. See Appendix A for calculation method. CRC 校验过程:发送方计算待发送数据的 CRC 后,将计算出的 CRC 值加入发送 帧。接收方接收到数据帧后,重新计算接收到的数据的 CRC 值,并与接收到的 CRC 值 比较,如果两个 CRC 值相同,认为正常,否则异常。 CRC checking process: After the sender calculates the CRC of the data to be sent, it adds the calculated CRC value to the transmission frame. After receiving the data frame, the receiver recalculates the CRC value of the received data and compares it with the received CRC value. If the two CRC values are the same, it is considered normal, otherwise it is abnormal. (2)错误回执基本数据格式 (2) Basic data format of error receipt 异常功能码对应回执关系: 0x03—0x83 当功能值异常时,回执功能码高位置 1,即:0x83。 0x10—0x90 当功能值异常时,回执功能码高位置 1,即:0x90。 错误代码: 0x01—非法功能; 0x02—非法寄存器地址; 0x03—非法寄存器值。 注:从机地址错误、CRC 校验错误、功能码错误时,手持焊不响应。 Relationship of receipt corresponding to abnormal function code: 0x03—0x83 When the function value is abnormal, the high position of the function code of the receipt is set to 1, that is, 0x83. 0x10—0x90 When the function value is abnormal, the high position of the function code of the receipt is 1, that is, 0x90. Error code: 0x01— illegal function; 0x02— illegal register address; 0x03— Illegal register value. Note: Hand-held welding does not respond when the slave address is wrong, CRC check is wrong, and function code is wrong. Please download the PDF version on the download page for details. |