ASI ModBus Protocol Rev 1.22
ASI ModBus Protocol Rev 1.22
Protocol
Modbus
Communications between the ASI display and motor controller is based on the MODBUS
application layer messaging protocol. Not all of the MODBUS functionality is supported.
MODBUS is a request/response protocol and offers services specified by function codes.
MODBUS function codes are elements of MODBUS request/response packets. The objective
of this document is to describe the function codes used within the ASI implementation of
MODBUS.
VERSION 1.22
FEBRUARY 2022
[Type here]
CONTENTS
Overview ................................................................................................................................3
Modbus 2
OVERVIEW
Communications between the ASI display and motor controller is based on the
MODBUS application layer messaging protocol. Not all of the MODBUS functionality
is supported. MODBUS is a request/response protocol and offers services specified by
function codes. MODBUS function codes are elements of MODBUS request/response
packets. The objective of this document is to describe the function codes used within
the ASI implementation of MODBUS
Modbus 3
1.0 MODBUS FUNCTIONS SUPPORTED
2.0 Function Function Code
Byte Definition
Feature Description
8-bit binary
1 Start bit
Byte Format
1 Stop bit
No parity
Timing
Feature Value
Modbus 4
Logic Levels
State Level
Low 0V
High 5V
Table 4 - Logic level definitions
Modbus 5
2.0 DEFINITIONS
3.0
4.0 Item Description
Modbus 6
3.0 FRAME DESCRIPTIONS
This function is used to read the values stored in selected registers within
the controller.
The valid Number of Registers that can be read using a single read request
packet is from 1 to 125. If the number of registers requested is outside of this
range, an error response will be returned by the controller.
The valid address range is from 0 to 511. When reading multiple registers with a
single request, the Start Address + Number of Registers must not result in the
reading of an address above 511. Attempts to do so will result in an error
response from the controller.
Below is a byte wise description of the packet frames used to perform a Function
0x03 read operation.
Modbus 7
3.3 REQUEST (MASTER TO SLAVE)
Modbus 8
3.6 WRITE MULTIPLE REGISTERS (FUNCTION 0X10)
This function is used to write values into select registers within the controller.
The valid Number of Registers that can be written using a single write request is
from 1 to 123. If the number of registers written to is outside of this range, an error
response will be returned by the controller.
The valid address range is from 0 to 511. When writing multiple registers with a
single write request packet, the Start Address + Number of Registers must not
result in the writing of an address above 511. Attempts to do so will result in an
error response from the controller.
Below is a byte wise description of the packet frames used to perform a Function
0x10 write operation.
Byte 8 Byte … Byte 2xN+7 Byte 2xN+8 Byte 2xN+9 Byte 2xN+10
* *
Register 1 Register N Register N CRC CRC
…
(Low Byte) (High byte) (Low Byte) (Low Byte) (High Byte)
Table 9 - Request (master to slave)
Modbus 9
3.9 ERROR RESPONSES (SLAVE TO MASTER)
Byte 0 Byte 1 Byte 2 Byte 3 Byte 4
Exception Code:
Error
Slave 0x02 = Invalid Address CRC CRC
Code
ID 0x03 = Invalid Number of (Low Byte) (High Byte)
(0x90)
Registers
Table 11 - Error responses (slave to master)
Modbus 10
4.0 CRC GENERATION
The Cyclical Redundancy Checking (CRC) field is two bytes, containing a 16–bit
binary value. The CRC value is calculated by the transmitting device, which appends
the CRC to the message. The receiving device recalculates a CRC during receipt of
the message and compares the calculated value to the actual value it received in the
CRC field. If the two values are not equal, an error will result.
The CRC is started by first preloading a 16–bit register to all 1’s. Then a process
begins of applying successive 8–bit bytes of the message to the current contents of
the register. Only the eight bits of data in each character are used for generating the
CRC. Start and stop bits and the parity bit, do not apply to the CRC.
During generation of the CRC, each 8–bit character is exclusive ORed with the
register contents. Then the result is shifted in the direction of the least significant bit
(LSB), with a zero filled into the most significant bit (MSB) position. The LSB that
was shifted off is extracted and examined. If the LSB was a 1, the register is then
exclusive ORed with a preset, fixed value. If the LSB was a 0, no XOR takes place.
This process of shifting, extracting and XORing on an LSB value of 1 is repeated
seven more times, so a total of 8 shift/extraction/exclusive OR on ‘1’ steps have
been performed.
After the last (eighth) repetition, the next 8–bit character is exclusive ORed with the
CRC register’s current value, and the process repeats for eight more shifts as
described above. The final content of the register, after all the characters of the
message have been applied, is the CRC value.
Modbus 11
Parameter Address List
For a complete list of parameters, please refer to the object dictionary file
“ASIObjectDictionary.xml”, which resides in the c:\Accelerated Systems\BacDoor\
directory, which is created when installing ASI’s BacDoor configuration software.
This file specifies the name, address, and scale factor for all available configuration
parameters in the BAC controller.
Modbus 12
X.0 DOCUMENT HISTORY
Table 12 definitions
change to correspond
1.1 08/31/2011 Craig MacKinnon
to BAC software release
4.xx and earlier
Remove Table 12 and
1.2 07/21/2014 Terry Stone refer to object
dictionary file
Update to CRC
1.22 2/28/2022 Nick Oudyk generation section for
clarity.
Modbus 13