M101-M & M102-M Modbus Protocol 1TNC911505M0203
M101-M & M102-M Modbus Protocol 1TNC911505M0203
M101-M & M102-M Modbus Protocol 1TNC911505M0203
M101-M/M102-M
Modbus Protocol Implementation for M101-M/M102-M
Table of Contents
1 OBJECTIVE ................................................................................................................................... 2
3 OVERVIEW .................................................................................................................................... 2
4 PROTOCOL IMPLEMENTATION................................................................................................... 2
5 MEMORY MAP............................................................................................................................... 8
1
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
Notes:
1 Objective
This manual provides detailed information on technical implementation of Modbus protocol in M101 and
M102. The products with Modbus protocol here are M101-M and M102-M. It is primarily intended for the
PCS application programmer's implementation and to provide help during installation and
commissioning of the System interfacing.
The knowledge of MODBUS protocol is an added advantage to the reader of this manual.
2 Related Documentation
1TNC911112D0203 M101-M/M102-M User Guide
1TNC911105M0202 M101-M/M102-M Parameter Description
3 Overview
Modbus is one of the protocols employed in M101 and M102. The devices with Modbus are named as
M101-M and M102-M respectively and RS485 is the only physical interface type provided. There are
two identical RS485 interfaces arranged on each device to make the redundant design possible. Via
RS485 interfaces all functions are supported, e.g. parameterization, control, supervisions, etc.
Both M101-M and M102-M implement a subset of the Modicon Modbus RTU serial communication
standard. Modbus is a single master/multiple slave type of protocol suitable for a multi drop
configuration as provided by RS485 hardware. Only a Modbus slave, not a Modbus master, can be
assigned to a M101/M102 device. A Modbus master is usually a PC or a PLC.
Both monitoring and control are possible using read and write register commands. Other commands are
supported to provide additional functions.
4 Protocol implementation
Characteristic RTU
Number of bits per character 10 or 11
Start bits 1
Data bits 8
Parity Even or Odd parity, or no parity
Stop bits 1
Error checking CRC (Cyclical Redundancy Check)
Modbus protocol can be implemented at any standard communication speed. M101-M and M102-M
support operation at 1200, 2400, 4800, 9600, 19200 baud.
2
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
4.2 Timing
Data packet synchronization is maintained by timing constraints. The receiving device must measure
the time between the reception of characters. If 3.5 character times elapse without a new character or
completion the packet, then the communication link must be reset (i.e. all slaves start listening for a new
transmission from the master). Thus at 9600 baud a delay of greater than 4.01ms
(3.5X1/9600X11X1000) will cause the communication link to be reset.
3
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
Notes:
The slave response to this function code is the slave address, function code, a count of the number of
data bytes to follow, the data itself and the CRC. Each data item is sent as a two-byte number with the
high order byte sent first.
For example, to request slave 1 to respond with 1 register starting at address 1021. For this example
the value in this register (1021) is 0023.
Address(Hex) Data(Hex)
0023 00DB
0024 00DA
0025 00DB
4
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
5
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
6
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
Address(Hex) Data(Hex)
Notes:
1036 0190
Notes: 1037 0005
7
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
The data stored is grouped into two areas: Parameters and Actual values. Parameters can be read and
written by a master. Actual values can be read only. All parameters and actual values are stored as two
byte values. That is, each register is the address of two byte value.
8
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
9
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
10
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
11
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
12
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
13
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
14
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
15
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
Data format
FORMAT CODE DESCRIPTION BITMASK
F1 Alarm Status Flag1 FFFF
Thermal Capacity 0001
Overload 0002
Phase Failure 0004
Phase unbalance 0008
Underload 0010
Noload 0020
Earth Fault 0040
PTC *(see note1) 0080 *(see note1)
Undervoltage *(see note1) 0100 *(see note1)
Autoreclose *(see note1) 0200 *(see note1)
--- ---
--- ---
--- ---
--- ---
--- ---
--- ---
F2 Alarm Status Flag2 FFFF
Contactor Feedback 0001
--- ---
Welded Contactor 0004
--- ---
Drive Failed to Start *(see note1) 0010
Drive Failed to Stop *(see note1) 0020
Start limitation 0040
Serial Communication 0080
Running time 0100
Start number 0200
Programmable input 0 0400
Programmable input 1 0800
Programmable input 2 1000
--- ---
--- ---
16
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
--- ---
Notes: F3 Trip Status Flag1 FFFF
TOL 0001
Stalled rotor 0002
Phase Failure 0004
Phase unbalance 0008
Underload 0010
Noload 0020
Earth fault 0040
PTC *(see note1) 0080 *(see note1)
Undervoltage *(see note1) 0100 *(see note1)
--- ---
--- ---
--- ---
--- ---
--- ---
--- ---
--- ---
F4 Trip Status Flag2 FFFF
Contactor Feedback 0001
--- ---
Programmable Input0 0004
Programmable Input1 0008
Programmable Input2 0010
Serial Communication failure 0020
Start limitation 0040
Feeder Trip 0080
--- ---
--- ---
--- ---
--- ---
--- ---
--- ---
--- ---
--- ---
F5 Stop Trigger Source FFFF
RCU stop 0001
Stop I/O input *(see note1) 0002 *(see note1)
MDStop 0004
PCS(fieldbus control) Stop 0008
Programmable input0 stop 0010
Programmable input1 stop 0020
Programmable input2 stop 0040
Limit1 input stop *(see note1) 0080 *(see note1)
Limit2 input stop *(see note1) 0100 *(see note1)
Emergency stop 0200
--- ---
--- ---
--- ---
--- ---
--- ---
--- ---
F7
17
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
--- ---
--- ---
--- ---
--- ---
--- ---
--- ---
--- ---
--- ---
F11 Motor Type FFFF
0= Single Phase 0000
1=Three Phase 0001
18
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
0=NOP 0000
Notes: 1=Start (CW) 0001
2=Start (CCW) 0002
3=Trip 0003
4=Reserved… ---
5=Reserved… ---
F14 Thermal Model FFFF
0=Standard 0000
1=EEx e -0001
19
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
1=Start1 0001
Notes: 2=Start2 0002
3=Stop 0003
4---Reserved--- 0004
5---Reserved--- 0005
6=Process interlock 1 0006
7=Process interlock 2 0007
8=Test Position 0008
9=Emergency Stop 0009
10=PLC control 000A
11=Trip reset 000B
12=Serial control disable 000C
13=Torque switch 000D
15=NOP 000F
F20 MODBUS Baud Rate FFFF
1=1200 0001
2=2400 0002
3=4800 0003
4=9600 0004
5=19200 0005
F21 Programmable input operation FFFF
0=Stop 0000
1=Latched trip 0001
20
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
For convenience default User Map values have been added. However, the User
Definable Memory Map is still fully customizable. The defaults are separated into
three sections. Regular polling data items, data that is read when a trip, stop or
alarm occurs, and data that can be monitored as time permits.
21
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
The M101-M and the M102-M contains a User Definable area in the memory map. This area allows
re-mapping of the addresses of any Actual Values or Parameters registers. The User Definable area
has two sections:
1. A Register Index area (memory map addresses 1100H-114FH) that contains 80 Actual Values or
Parameters registers addresses.
2. A Register area (memory map addresses 0050H-009FH) that contains the data at the addresses
in the Register Index.
Register data that is separated in the rest of the memory map may be re-mapped to adjacent register
addresses in the User Definable Registers area. This is accomplished by writing to register addresses in
the User Definable Register Index area. This allows for improved throughput of data and can eliminate
the need for multiple read command sequences. The User Definable Register Index is stored as a
Parameter and therefore it is “remembered” even when the power is removed.
For example, if Motor Status (register address 0019H) and the values of phase L1 current (register
address 0029H) are required to be read from the slave device, their addresses may be re-mapped as
follows:
1. Write 0019H to address 1101H (User Definable Register Index 0000) using function code 06H
or 10H.
22
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
2. Write 0029H to address 1100H (User Definable Register Index 0001) using function code 06H
Notes: or 10H.
It is now possible to read these two data registers with one read, at addresses 0050H, 0051H. Address
0500H will contain Motor status and address 0051H will contain Phase L1 Current.
The MCUsetup software can also be used to write these data to the User Definable Resister Index.
Note! Important!
(1) The functions and registers marked with ‘ * (see note1)’ are only provided on M102-M
and for reservation on M101-M;
(2) For parameter ‘Power’, the range of setting is 0.01—1000KW; M102 deal with the values
in two steps as illustrated, a) the values <1KW, the MSB of the integer data is set ‘1’ and
the real value is ‘value read out’ times 0.01KW. e.g. the data 8001( HEX) means that the
value (1000 0000 0000 0001) is less than 1KW and the real value is 0.01KW (1X0.01KW);
b) If 1KW < the value < 1000KW ( 1KW included), the MSB of the integer data is ‘0’ and
the real value equals to ‘value read out’ times 0.1KW. e.g. the data 00A0(HEX) means
16KW (160X0.1KW);
(3) The ‘Local Remote Switch’ function is provided only on M102-M; On M101-M that is
‘11=RCU Mode’;
(4) Motor current setting is related to Internal CT setting( register 1022). If Internal CT
setting (range 0.1-63A) <1A, the scale of the current is x0.01A; If Internal CT setting >1A
( 1A included), the scale is 0.1A. For example, if CT value read is ‘2’ (that is 0.2A) and
the motor current value is ‘8’ then the current real value shall be 0.08A, ie 8x0.01A;
Samely, if CT setting value is 10 (1A), the motor current value read ‘8’ then the real
value shall be 0.8A, ie 8x0.1A.
7 Appendix B CRC-16
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 16bit remainder of the division is appended to
the end of the transmission, MSByte 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 a 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 that one or
more bytes of the transmission were received incorrectly and thus the entire transmission should be
ignored in order to avoid the device performing any incorrect operation.
a) CRC-16 ALGORITHM
Flowchart of the algorithm:
23
ABB
1TNC911505M0203 Edition June 2004
Modbus Protocol Implementation for M101-M/M102-M
FFFFH -> A
Notes:
0 -> i
0 -> j
Di XOR AL -> AL
j = j + 1
shr(A)
CY?
G XOR A -> A
j = 8 ?
i = i + 1
i = N?
A -> CRC
24
ABB
1TNC911505M0203 Edition June 2004