![APS 6RL Series Скачать руководство пользователя страница 126](http://html1.mh-extra.com/html/aps/6rl-series/6rl-series_operation-manual_2956801126.webp)
6RL SERIES OPERATION MANUAL
SECTION 7: REMOTE PROGRAMMING
Entire Contents Copyright
2018 by Adaptive Power Systems, Inc. (APS) • All Rights Reserved • No reproduction without written authorization from APS.
6RL Series Regenerative DC Load Operation Manual
Page 126 of 204
Byte 0
Byte 1
Bytes 2+3
Bytes 4+5
Bytes 6+7
Addr
FC
Start reg.
Data
CRC
0x00
0x05
0...65535
Written value echoed
Checksum ModBus-CRC16
(1
Expected response for WRITE Multiple Registers:
Byte 0
Byte 1
Bytes 2+3
Bytes 4+5
Bytes 6+7
Addr
FC
Start reg.
Data
CRC
0x00
0x10
0...65535
Number of written registers
Checksum ModBus-CRC16
(1
Expected response for READ Holding Registers:
Byte 0
Byte 1
Byte 2
Bytes 3-253
Letzte 2 Bytes
Addr
FC
Data length in bytes
Data
CRC
0x00
0x03
2...250
Queried registers content
Checksum ModBus-CRC16
(1
Expected response for READ Coils:
Byte 0
Byte 1
Byte 2
Bytes 3+4
Bytes 5+6
Addr
FC
Data length in bytes
Data
CRC
0x00
0x01
2
Queried bit as 1 register
(always 16 coils)
Checksum ModBus-CRC16
(1
Unexpected response (communication error):
Byte 0
Byte 1
Byte 2
Letzte 2 Bytes
Addr
FC
CRC
0x00
Function code + 0x80
Error code
Checksum ModBus-CRC16
(1
Note: A communication error can have several reasons, like a wrong checksum or when
attempting to switch a unit to remote control that has been set to “Local” or if it is
already remotely controlled by another interface. See the communication error
code list in section 7.9.4, “Communication Errors” on page 127.
7.9.3
The ModBus Checksum
The checksum at the end of ModBus RTU messages is a 16 bit checksum, but is not
calculated as the usual CRC16 checksum. Furthermore, the byte order of the checksum in
the message is reversed. Information about ModBus CRC16 and source code for
implementation and calculation are available on the Internet, for example here:
Sample C Code:
// Compute the MODBUS RTU CRC
UInt16 ModRTU_CRC(byte[] buf, int len)
{
UInt16 crc = 0xFFFF;
for (int pos = 0; pos < len; pos++) {
crc ^= (UInt16)buf[pos]; // XOR byte into least sig. byte of crc
for (int i = 8; i != 0; i--) { // Loop over each bit
if ((crc & 0x0001) != 0) { // If the LSB is set
crc >>= 1; // Shift right and XOR 0xA001
crc ^= 0xA001;
Содержание 6RL Series
Страница 203: ......