Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Excel GP-Connect

Excel OpenLink 2
ModBus Message Subset
PROTOCOL DOCUMENTATION

CONTENTS
CONTENTS ........................................................................................................................... 1

GENERAL ........................................................................................................................... 2

TIMING PARAMETERS ........................................................................................................................... 2

MODBUS FUNCTION SUBSET USED ........................................................................................................................... 3

CRC 16 CALCULATION ........................................................................................................................... 4

ENCODING OF ANALOG POINT VALUES (WORDS OR DOUBLE WORDS)........................................................................ 5


IEEE 32 Bit Format (2 ModBus Words)................................................................ 5
BCD 32 Bit Siemens Format................................................................................. 5
BCD 32 Bit Signed Format ................................................................................... 6
BCD 32 Bit Unsigned Format ............................................................................... 6
BCD 16 Bit Signed Format ................................................................................... 6
BCD 16 Bit Unsigned Format ............................................................................... 7
Binary 32 Bit Signed Format................................................................................. 7
Binary 32 Bit Unsigned Format............................................................................. 7
Binary 16 Bit Signed Format................................................................................. 8
Binary 16 Bit Unsigned Format............................................................................. 8

CORRESPONDENCE BETWEEN MODBUS AND S-BUS POINTS ........................................................................................ 8

COMPARISON OF MODBUS AND J-BUS FUNCTIONS (MESSAGES).................................................................................. 9

EN7C-0120 1095R0-MA
EXCEL GP-CONNECT

GENERAL
The Excel 5000® OpenLink 2 ModBus - link is RS485 2- wire and RS485 4- wire compatible.

• Coding system is:


Serial transmission,
8 bit, 1 startbit 1 stopbit, 1 optional parity bit (even / odd).
LSB is sent first.

• Baudrates:
2400, 4800, 9600 Baud

All messages are setup for RTU mode ( Remote Terminal Unit), which means that all characters are in binary format.
RTU Framing:

Slave Function Data ... CRC CRC


Address Code LSB MSB

In case of 16 bit Data elements being transmitted, the MSB is transmitted first.
In spite of that, the 16 bit CRC is transmitted with the LSB first.

For better understanding of the following definitions, the ModBus message specification should be known.

TIMING PARAMETERS
There are 2 relevant timing parameters adjustable:

• Non-response time-out. The maximum time between a request and the response from the slave.
The non-response timeout (maximum time waited by the converter for a response) can be set within a range of 10 to 65534
ms in 2 ms steps.

• Inactivity time-out. The minimum time the master waits after a response had been received to issue the next request.
The inactivity time (time between the last response or, if applicable, the non-response timeout and the next JBUS request)
can be set within a range of 0 to 65534 ms in 2 ms steps

Request Non-response
(converter) timeout
T

Response
(ModBus
control units) T
Inactivity timing

Fig. 1. Description of the ModBus timings

EN7C-0120 1095R0-MA 2
EXCEL GP-CONNECT

MODBUS FUNCTION SUBSET USED


• Function 1 : Read Coil Status (Read Output bits or internal Bits)
• Function 2 : Read Input Status (Read Input Bits)
Request Format:
Slave 1 or 2 Start address Start address Number of Bits Number of Bits CRC CRC
Address MSB LSB MSB LSB LSB MSB

Response Format:
Slave 1 or 2 Number of 1st Byte ... (n / 8) th Byte CRC CRC
Address Bytes returned LSB MSB
n = Number of Bytes

• Function 3 : Read Holding Registers (Read N Output Words or N internal Words)


• Function 4 : Read Input Registers (Read N Input Words)
Request Format:
Slave 3 or 4 Start address Start address Number of Number of CRC CRC
Address MSB LSB Words Words LSB MSB
MSB LSB

Response Format:
Slave 3 or 4 Number of
Address Bytes returned

1st Word 1st Word ... nth Word nth Word CRC CRC
MSB LSB MSB LSB LSB MSB
n = Number of Words

• Function 5 : Force Single Coil (Write Bit)


Request Format:
Slave 5 Bit address Bit address Data set = 1 Dummy byte = CRC CRC
Address MSB LSB reset = 0 0 LSB MSB

Response Format:
Slave 5 Bit address Bit address Data set = 1 Dummy byte = CRC CRC
Address MSB LSB reset = 0 0 LSB MSB

• Function 16: Preset Multiple Registers (Write N Words).


Request Format:
Slave 16 Start address Start address Number of Number of Number of
Address MSB LSB Words LSB Words MSB Bytes

1st Word 1st Word ... nth Word nth Word CRC CRC
MSB LSB MSB LSB LSB MSB
n = Number of Words
Response Format:
Slave 16 Start address Start address Number of Number of CRC CRC
Address MSB LSB Words LSB Words MSB LSB MSB

3 EN7C-0120 1095R0-MA
EXCEL GP-CONNECT

CRC 16 CALCULATION
C- Code example for generation of the 16 bit CRC:

#define POLY 0xA001


//*************************************************************
// inputs
// Data :pointer to Data Array to Checksum
// MessageLength :number of bytes to be taken into checksum
// output
// CRC : 16 bit CRC checksum
//*************************************************************
unsigned CalculateCRC(unsigned char *Data, unsigned MessageLength)
{
unsigned CRC;
unsigned ByteCount;
unsigned char Byte;
unsigned char Bit;

CRC = 0xFFFF;

// for all bytes of the message


for (ByteCount=0; ByteCount < MessageLength; ByteCount++)
{
Byte = *(Data+ByteCount); // get data byte
CRC ^= Byte; // exor CRC with actual Byte
for (Bit = 0; Bit < 8; Bit++)// for all bits of byte
{
if (CRC & 0x1) // carry expected ?
{
CRC >>= 1; // shift right
CRC ^= POLY; // exor with Polynom
}
else // no carry expected
{
CRC >>= 1; // just shift right
}
}
}
return(CRC);
}

EN7C-0120 1095R0-MA 4
EXCEL GP-CONNECT

ENCODING OF ANALOG POINT VALUES (WORDS OR DOUBLE WORDS)


16 bit values are accessed on a single ModBus Word- (or Register-) address, whereas 32 bit values (E.g. floating points)
accessed at 2 consecutive addresses.

In case of 32 bit values the high-order word is placed at the lower ModBus address.

The following figures give examples of each type of analog value:

IEEE 32 Bit Format (2 ModBus Words)

Sign
(0=+ 1=-) E (exponent) F (fraction of 23 bits)

MSB LSB

Conversion between a real IEEE and its coding : (-1) S x 1.F x 2 (E-127)

Example : 0 = 00 00 00 00 h
1 = 3F 80 00 00 h
-2.35 = C0 16 66 66 h

Fig. 2. IEEE 32 Bit Format

BCD 32 Bit Siemens Format

Sign Decimal Unit not


(0=+; 1=-) Integer (0000 .. 7999) (0,00..0,99) (not used) used

MSB LSB

Example : 0 = 00 00 00 00 h
1 = 00 01 00 00 h
-2.35 = 80 02 35 00 h

Fig. 3. BCD 32 Bit Siemens Format

5 EN7C-0120 1095R0-MA
EXCEL GP-CONNECT

BCD 32 Bit Signed Format

Sign
(0=+ 1=-) BCD coded number

MSB LSB

Example : 0 = 00 00 00 00 h
255 = 00 00 02 55 h
-255 = 80 00 02 55 h

Fig. 4. BCD 32 Bit Signed Format

BCD 32 Bit Unsigned Format

BCD coded number

MSB LSB

Example : 0 = 00 00 00 00 h
10 = 00 00 00 10 h
255 = 00 00 02 55 h

Fig. 5. BCD 32 Bit Unsigned Format

BCD 16 Bit Signed Format

Sign
(0=+ 1=-) BCD coded number

MSB LSB

Example : 0 = 00 00 h
255 = 02 55 h
-255 = 82 55 h

Fig. 6. BCD 16 Bit Signed Format

EN7C-0120 1095R0-MA 6
EXCEL GP-CONNECT

BCD 16 Bit Unsigned Format

BCD coded number

MSB LSB

Example : 0 = 00 00 h
10 = 00 10 h
255 = 02 55 h

Fig. 7. BCD 16 Bit Unsigned Format

Binary 32 Bit Signed Format

Sign
(0=+ 1=-) Binary number

MSB LSB

Example : 0 = 00 00 00 00 h
255 = 00 00 00 FF h
-1 = FF FF FF FF h

Fig. 8. Binary 32 Bit Signed Format

Binary 32 Bit Unsigned Format

Binary number

MSB LSB

Example : 0 = 00 00 00 00 h
0 = 00 00 00 0A h
255 = 00 00 00 FF h

Fig. 9. Binary 32 Bit Unsigned Format

7 EN7C-0120 1095R0-MA
EXCEL GP-CONNECT

Binary 16 Bit Signed Format

Sign
(0=+ 1=-) Binary number

MSB LSB

Example : 0 = 00 00 h
255 = 00 FF h
-255 = FF 01 h

Fig. 10. Binary 16 Bit Signed Format

Binary 16 Bit Unsigned Format

Binary number

MSB LSB

Example : 0 = 00 00 h
10 = 00 0A h
255 = 00 FF h

Fig. 11. Binary 16 Bit Unsigned Format

CORRESPONDENCE BETWEEN MODBUS AND S-BUS POINTS


The correspondence between the SBUS and MODBUS points is as follows:

SBUS points Programming MODBUS function


symbol Read Write
Alarms AL Function 2 None
Digital input EN Function 2 None
Digital output SN Function 1 Function 5
Analog input EA Function 4 None
Analog output SA Function 3 Function 16
Z register Z Function 3 Function 16

Table 1. Correspondence Between ModBus And S-Bus Points

EN7C-0120 1095R0-MA 8
EXCEL GP-CONNECT

COMPARISON OF MODBUS AND J-BUS FUNCTIONS (MESSAGES)

Function Function Name in ModBus Function Name in J-Bus Supported by Excel 5000
OpenLink 2

Yes No

1 Read Coil Status Read n Input Bits X


2 Read Input Status Read n Output Bits X
3 Read Holding Registers Read n Output Words X
4 Read Input Registers Read n Input Words X
5 Force Single Coil Write 1 Bits X
6 Preset Single Register Write 1 Word X
7 Read Exception Status Fast Read 8 Bits X
8 Diagnostics Diagnostics X
11 Fetch Common Event Counter Read Event Counter X
12 Fetch Common Event Log Read Trace Buffer X
15 Force Multiple Coils Write n Bits X
16 Preset Multiple Registers Write n Words X
17 Report Slave ID n.a. X
20 Read General Reference n.a. X
21 Write General Reference n.a. X
22 Mask Write 4X Regfister n.a. X
23 Read/Write 4X Register n.a. X
24 Read FIFO Queue n.a. X

Table 2. Comparison of ModBus and J-Bus Functions (Messages)

9 EN7C-0120 1095R0-MA
EXCEL GP-CONNECT

Helping You Control Your World


Honeywell Regelsysteme GmbH
Honeywellstrasse 2-6
63477 Maintal 1
Tel: 06181/401-1 DIN
Manufacturing location is certified according to
Fax: 06181/45456 ISO 9001

EN7C-0120 1095R0-MA 10

You might also like