HIMA Z6011备件模块,工控模块
469仅支持RTU版本。使用读写寄存器命令可以实现监控、编程和控制功能。6.1.3数据帧格式和数据速率与469之间的异步传输的一个数据帧默认为1个起始位、8个数据位和1个停止位。这产生一个10位数据帧。这对于通过高比特率的调制解调器进行传输非常重要(在比特率大于300bps的情况下,Hayes调制解调器不支持11比特数据帧)。奇偶校验位可选为奇数或偶数。如果编程为奇数或偶数,则数据帧由1个起始位、8个数据位、1个奇偶校验位和1个停止位组成。Modbus协议可以以任何标准通信速度实现。469个RS485端口支持1200、2400、4800、9600和19200波特的操作。前面板RS232波特率固定为9600波特。6.1.4数据包格式完整的请求/响应序列由以下字节组成(作为单独的数据帧传输):•从属地址:这是每次传输的第一个字节。该字节表示接收主设备发送的消息的从属设备的用户分配地址。每个从设备必须被分配一个唯一的地址,并且只有被寻址的从设备响应以其地址开始的传输。在主请求传输中,从地址表示请求被发送到的从设备的地址。在从机响应传输中,从机地址表示发送响应的从机的地址。注意,从地址为0的主传输指示广播命令。广播命令可用于特定功能。主查询消息:从属地址:(1字节)功能代码:(1个字节)数据:(取决于功能代码的可变字节数)CRC:(2个字节)从属响应消息:从属位置:(1位字节)功能码:(1)字节数据:(根据功能代码的变化字节数)CRC:(2字节)6-2 469电机管理继电器GE Multilin 6.1 MODBUS协议6通信6•功能代码:此是每次传输的第二个字节。Modbus定义1至127的功能代码。469实现了其中的一些功能。在主请求传输中,功能代码告诉从设备要执行什么操作。在从机响应传输中,如果从机发送的功能码与主机发送的指示从机按请求执行功能的功能码相同。如果从设备发送的功能代码的高位为1(即,如果功能代码>127),则从设备未按要求执行功能,并发送错误或异常响应。•数据:取决于功能代码的可变字节数。这可能是主设备向从设备发送的实际值、设置点或地址,反之亦然。数据首先发送MSByte,然后发送LSByte。•CRC:这是一个两字节的错误检查代码。CRC首先发送LSByte,然后发送MSByte。Modbus的RTU版本包括每次传输的两字节CRC-16(16位循环冗余检查)。CRC-16算法本质上将整个数据流(仅数据位;忽略开始、停止和奇偶校验)视为一个连续的二进制数。该数字首先左移16位,然后除以特征多项式(11000000000101B)。除法的16位剩余部分被附加到传输的末尾,首先是LSByte。如果没有发生传输错误,则当在接收机处被相同多项式除时,包括CRC的结果消息将给出零余数。如果469 Modbus从设备接收到CRC-16计算指示错误的传输,则从设备不会对传输做出响应。CRC-16错误表示错误接收了传输的一个或多个字节,因此应忽略整个传输,以避免469执行任何错误操作。CRC-16计算是用于错误检测的行业标准方法。在没有标准CRC-16计算例程可用的情况下,这里包括一种算法来帮助程序员。6.1.5 CRC-16算法一旦完成以下算法,工作寄存器“A”将包含要传输的CRC值。注意,该算法要求特征多项式是反向位序的。特征多项式的MSbit被丢弃,因为它不影响余数的值。符号:-->数据传输A;阿罗;Ahigh 16位工作寄存器;A(16位工作寄存器)CRC 16位CRC-16结果的低位和高位字节i,j个循环计数器(+)逻辑异或运算符N数据字节总数Di第i个数据字节(i=0到N–1)G 16位特征多项式=1010000000000001(二进制),删除MSbit并按位序
Only the RTU version is supported by the 469. Monitoring, programming and control functions are possible using read and write register commands. 6.1.3 DATA FRAME FORMAT AND DATA RATE One data frame of an asynchronous transmission to or from an 469 is default to 1 start bit, 8 data bits, and 1 stop bit. This produces a 10 bit data frame. This is important for transmission through modems at high bit rates (11-bit data frames are not supported by Hayes modems at bit rates of greater than 300 bps). The parity bit is optional as odd or even. If it is programmed as odd or even, the data frame consists of 1 start bit, 8 data bits, 1 parity bit, and 1 stop bit. Modbus protocol can be implemented at any standard communication speed. The 469 RS485 ports support operation at 1200, 2400, 4800, 9600, and 19200 baud. The front panel RS232 baud rate is fixed at 9600 baud. 6.1.4 DATA PACKET FORMAT A complete request/response sequence consists of the following bytes (transmitted as separate data frames): • SLAVE ADDRESS: This is the first byte of every transmission. This byte represents the user-assigned address of the slave device that receives the message sent by the master. Each slave device must be assigned a unique address and only the addressed slave responds to a transmission that starts with its address. In a master request transmission the Slave Address represents the address of the slave to which the request is being sent. In a slave response transmission the Slave Address represents the address of the slave that is sending the response. Note that a master transmission with a Slave Address of 0 indicates a broadcast command. Broadcast commands can be used for specific functions. MASTER QUERY MESSAGE: SLAVE ADDRESS: (1 byte) FUNCTION CODE: (1 byte) DATA: (variable number of bytes depending on FUNCTION CODE) CRC: (2 bytes) SLAVE RESPONSE MESSAGE: SLAVE ADDRESS: (1 byte) FUNCTION CODE: (1 byte) DATA: (variable number of bytes depending on FUNCTION CODE) CRC: (2 bytes) 6-2 469 Motor Management Relay GE Multilin 6.1 MODBUS PROTOCOL 6 COMMUNICATIONS 6 • FUNCTION CODE: This is the second byte of every transmission. Modbus defines function codes of 1 to 127. The 469 implements some of these functions. In a master request transmission the Function Code tells the slave what action to perform. In a slave response transmission if the Function Code sent from the slave is the same as the Function Code sent from the master indicating the slave performed the function as requested. If the high order bit of the Function Code sent from the slave is a 1 (i.e. if the Function Code is > 127) then the slave did not perform the function as requested and is sending an error or exception response. • DATA: A variable number of bytes depending on the Function Code. This may be actual values, setpoints, or addresses sent by the master to the slave or vice versa. Data is sent MSByte first followed by the LSByte. • CRC: This is a two byte error checking code. CRC is sent LSByte first followed by the MSByte. The RTU version of Modbus includes a two byte CRC-16 (16-bit cyclic redundancy check) with every transmission. The CRC-16 algorithm essentially treats the entire data stream (data bits only; start, stop and parity ignored) as one continuous binary number. This number is first shifted left 16 bits and then divided by a characteristic polynomial (11000000000000101B). The 16-bit remainder of the division is appended to the end of the transmission, LSByte first. The resulting message including CRC, when divided by the same polynomial at the receiver will give a zero remainder if no transmission errors have occurred. If an 469 Modbus slave device receives a transmission in which an error is indicated by the CRC-16 calculation, the slave device will not respond to the transmission. A CRC-16 error indicates than one or more bytes of the transmission were received incorrectly and thus the entire transmission should be ignored in order to avoid the 469 performing any incorrect operation. The CRC-16 calculation is an industry standard method used for error detection. An algorithm is included here to assist programmers in situations where no standard CRC-16 calculation routines are available. 6.1.5 CRC-16 ALGORITHM Once the following algorithm is complete, the working register "A" will contain the CRC value to be transmitted. Note that this algorithm requires the characteristic polynomial to be reverse bit ordered. The MSbit of the characteristic polynomial is dropped since it does not affect the value of the remainder. Symbols: --> data transfer A; Alow; Ahigh 16-bit working register; low and high order bytes of A (the 16-bit working register) CRC 16 bit CRC-16 result i, j loop counters (+) logical EXCLUSIVE-OR operator N total number of data bytes Di i-th data byte (i = 0 to N – 1) G 16 bit characteristic polynomial = 1010000000000001 (binary) with MSbit dropped and bit order