Alarm Modbus Protocol Uk PDF
Alarm Modbus Protocol Uk PDF
Users Manual
Revision: 050714 SELCO A/S Betonvej 10 - DK-4000 Roskilde Denmark Phone: 45 7026 1122 - Fax: 45 7026 2522 e-mail: [email protected] www.selco.com
Table of Contents
1 2 3 4
PREFACE ....................................................................................................................................4 PHYSICAL INTERFACE ...........................................................................................................5 2.1 3.1 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 RS485 CONFIGURATION .......................................................................................................5 ADDRESSES ...........................................................................................................................7 SYNTAX ................................................................................................................................8 ERROR CODES .......................................................................................................................8 FUNCTIONS ...........................................................................................................................8 EXCEPTION STATUS ..............................................................................................................9 LED STATES .......................................................................................................................10 VIRINP STATES .................................................................................................................10 ALARM CONTROL ...............................................................................................................10 5-LED ADDRESSING ...........................................................................................................12 ANALOG READINGS ............................................................................................................12 READ BIT (FUNCTION 01H OR 02H).....................................................................................13 Read the state of the siren relay on unit 1 (which is inactive) .......................................13 Read the state of LED 8 on unit 1 (which is flashing)...................................................14 Do a LED test on unit 1 .................................................................................................14 Write short flash (cable failure) to all LEDs on unit 1...................................................15 Set LED 14 (0Eh) on unit 1 to quick flash.....................................................................15 Check if unit 1 responds (check communication to unit 1 of type 01) ..........................16 Set all 24 LEDs (and the siren relay) to a mixed pattern ...............................................17 READ WORDS (FUNCTION 03H OR 04H) ..............................................................................13 WRITE A BIT (FUNCTION 05H) ............................................................................................14 WRITE A WORD (FUNCTION 06H) .......................................................................................15 MODBUS PROTOCOL ..............................................................................................................6 MODBUS FRAMES ...................................................................................................................8
EXAMPLES...............................................................................................................................13 5.1 5.2 5.3 5.4 5.1.1 5.2.1 5.3.1 5.4.1 5.4.2 5.5 5.6 5.5.1 5.6.1
READ EXCEPTION STATUS (FUNCTION 07H) .......................................................................16 WRITE N WORDS (FUNCTION 10H)......................................................................................16
SELCO A/S
MODBUS Protocol
MODBUS MEMORY MAPS....................................................................................................19 6.1 6.2 6.3 6.4 6.5 6.6 6.7 M1000 ALARM ANNUNCIATOR...........................................................................................19 M2000 ENGINE CONTROLLER .............................................................................................20 M3000 ALARM ANNUNCIATOR...........................................................................................21 M4700-80 INDICATOR PANEL .............................................................................................24 H1500 INDICATOR PANEL ...................................................................................................26 H3000 ANALOG ALARM ANNUNCIATOR.............................................................................27 H3010 SMOKE ALARM ANNUNCIATOR ...............................................................................29
Revision: 050714
Page 3 of 29
SELCO A/S
MODBUS Protocol
1 Preface
This document describes the features and functions of the RS485 based serial communication interface of the SELCO M1000C Alarm Annunciator (new edition), the SELCO M2000C Engine Controller (new edition), the SELCO M3000 Analog Alarm Annunciator (new edition), the SELCO M4700-80 Indicator Panel, the SELCO H1500 Indicator Panel and the SELCO H3000 Analog Alarm Annunciator. The serial communication interface is RS485 and the communication protocol is MODBUS RTU.
Revision: 050714
Page 4 of 29
SELCO A/S
MODBUS Protocol
2 Physical Interface
The physical interface consists of a two wire half-duplex RS485 interface. The connection terminals of the RS485 interface plug are marked A and B. Terminal A is positive, while terminal B is negative. RS485 works with a single master (e.g. a PLC or a PC). The master controls all communication on the bus. The SELCO units operate as slaves and will simply respond to commands issued by the master. The two-wire RS485 bus is working in half-duplex mode. As half duplex does not allow simultaneous transmission and reception, its required that the master control direction of the data flow. It is also possible to use a master with a full duplex RS485 interface; however it is necessary to connect the two positive and negative signals together. Thus Tx+ and Rx+ become A, while Txand Rx- becomes B.
Upon delivery the SELCO units are configured as follows: 9600 Baud, None parity, 8 data bits and 1 stop bits.
Revision: 050714
Page 5 of 29
SELCO A/S
MODBUS Protocol
3 MODBUS Protocol
The communication protocol used on the RS485 bus is MODBUS RTU. Modicon originally defined the MODBUS protocol. MODBUS RTU is a simple bit based protocol. A MODBUS system consists of a single master, which in turn interrogates each slave connected to the bus. All SELCO units operate as slaves on the MODBUS. The master unit is typically the SELCO H0300 Logger, a PLC or PC equipped with an RS485 Interface card. A MODBUS message (a MODBUS frame) consists of the following elements.
Element Start (SOM) Address Function Data (n bytes) CRC Check End (EOM) Meaning Signals the start of a new message. A silent period Address of the recipient (slave address) Function (e.g. Read bit/word) Data used for the particular function Checksum (used for validation) Signals the end of a message. A silent period
The MODBUS protocol can be used in two different modes - ASCII and RTU. ASCII stands for American Standard Code of Information Interchange. RTU stands for Remote Terminal Mode. MODBUS ASCII is a clear text protocol, which means that frames are made up from a string of ASCII characters which can be transmitted directly from a standard terminal (e.g. Windows HyperTerminal). The advantage of ASCII mode is that messages are easy to generate, the disadvantage is that the frames are relatively large and inefficient. In RTU mode every element is represented by 8 bits - except Data, which can consist of a variable number of successive bytes). RTU mode provides far better efficiency compared to ASCII, as frames are shorter and thus requires fewer bits. The drawback is that data cannot easily be entered from a standard terminal. RTU mode also requires that the elements be provided in a continuous and steady flow. SELCO unit works only in the bit based RTU mode.
Start (SOM) >= 3.5 bytes of Silence Address 00000001 Function 00011111 Data xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx CRC Check ???????? ???????? End (EOM) >= 3.5 bytes of Silence
Notice that the above message is started and ended by 3.5 bytes of silence. The silent period enables the master or slave to identify the start and end of a frame. The Address and Function elements each consist of 8 bits (1 byte). The Data element is typically made up from a variable number of bytes, depending on the Function of the frame. The CRC element consists of two bytes (16 bits) and it is used to validate the contents of the frame.
Revision: 050714
Page 6 of 29
SELCO A/S
MODBUS Protocol
3.1 Addresses
With MODBUS every slave must have an address (a number). The master uses the address to target a specific slave from interrogation. SELCO units can be addressed from 1 to 64 (01h 40h). Address 0 (00h) is used for broadcast frames (e.g. LED test on all connected units). Broadcast messages targets all slaves on the MODBUS simultaneously. Broadcast frames works without reply, as a reply from multiple units would cause collision on the bus.
Revision: 050714
Page 7 of 29
SELCO A/S
MODBUS Protocol
4 MODBUS Frames
4.1 Syntax
Below is an example of the MODBUS frame syntax. Please note that the Data element can consist of a variable number of bytes, while the length of the Address, Function and CRC elements are fixed to one or two bytes.
Address 1 Byte Function 1 Byte Data n Bytes CRC 2 Bytes
Error codes are only returned if the CRC is correct. The SELCO units will only report errors under the conditions described above. An error code response frame will have the following syntax. Response:
Address Panel Function Recognised Function + 128 Data Error Code Value CRC CRC16
4.3 Functions
Value 01h and 02h 03h and 04h 05h 06h 07h 10h Description Read a Bit Read words Write a Bit Write a Word Speed read 8 Bits Write n Words
It is possible to read and write the contents of any address in the MODBUS Memory Map, provided that the operation is allowed (e.g. the contents of the address is not write protected).
Revision: 050714
Page 8 of 29
SELCO A/S
MODBUS Protocol
Reply:
Address 01h Function 07h Data Unit Status & Type CRC ??h ??h
Unit Status:
Bit 7 (MSB) 6 5 40 Meaning 1 = New events since last read 0 = No new events since last read 1 = No logging of new events 0 = Logging of new events Not used (for future use) Unit type: 00000 = H0300 (when used as a Slave) 00001 = M1000 00010 = M2000 00100 = M3000 00101 = H3000/H3010 01000 = M4700-80 01001 = H1500
Revision: 050714
Page 9 of 29
SELCO A/S
MODBUS Protocol
Writing the state of a LED directly through the MODBUS will always overwrite the LED indication of a contact input (a physical alarm). The MODBUS controlled LED state will remain until it is again changed with another MODBUS message. The indication of the related contact input will not show unless the LED is turned off through the MODBUS. LED states can be read and written on the SELCO M4700-80 Indicator Panel. On the remaining SELCO units it is only possible to read the state of the LEDs. Please note that the M3000 and H3000 presents the individual alarms as opposed to the specific LEDs. On the M3000 and H3000 alarm states are described similar to LED states, despite that an alarm may not be allocated to a LED.
It is possible to control virtual inputs on both the SELCO M1000 and the SELCO M4700-80. Other SELCO units do not support virtual inputs.
Revision: 050714
Page 10 of 29
SELCO A/S
MODBUS Protocol
The following write operations are valid on the SELCO MODBUS capable alarm annunciators:
Address Panel Function 06h Data Alarm address Alarm function CRC CRC16
Please note that alarms and LEDs are directly related on the M1000, while they are separated on the M3000 and H3000. Alarm functions are addressed through the LEDs on the M1000, while the alarms are addressed directly on the M3000. The writable alarms are marked by a (*) on the memory map of the unit.
Revision: 050714
Page 11 of 29
SELCO A/S
MODBUS Protocol
Each address consists of 16 bits (a Word). The final value of each address is calculated from the sum of the binary value of the address contents (the sum of the bit values). Please notice that the most significant bit (MSB) is not used (must be set to zero). The value of each bit is described in the table below.
Word (16 bits) Byte (8 bits) LED Word Byte Example NA 0 0 0 16384 64 1 N+4 8192 32 0 4096 16 0 2048 8 1 n+3 1024 4 0 512 2 0 256 1 0 n+2 128 128 1 64 64 1 32 32 0 Byte (8 bits) n+1 16 8 16 8 1 0 n 4 4 0 2 2 0 1 1 1
The above 16 bits can be used to set the state of 5 LEDs. Transmitting five successive words in a row will set a total of 24 LEDs.
Revision: 050714
Page 12 of 29
SELCO A/S
MODBUS Protocol
5 Examples
5.1 Read Bit (Function 01h or 02h)
Request:
Address Unit Function Read Bits Data Address of first bit Number of bits to read CRC CRC16
Reply:
Address Unit Function Read Bits Data Number of Bytes Read (always 1) Byte with returned bits CRC CRC16
5.1.1
Request:
Address 01h Function 01h Data 00h 40h 00h 01h CRC FCh 1Eh
Reply:
Address 01h Function 01h Data 01h 00h CRC 51h 88h
Reply:
Address Unit Function Read words Data Number of bytes read Value of word 1 .. .. Value of word n CRC CRC16
Revision: 050714
Page 13 of 29
SELCO A/S
MODBUS Protocol
5.2.1
Request:
Address 01h Function 03h Data 00h 08h 00h 01h CRC 05h C8h
Reply:
Address 01h Function 03h Data 02h 00h 02h CRC 39h 85h
The address of a bit is expressed by two bytes. The state of the bit is returned in the most significant of the two following bytes (Bit on = FFh, Bit off = 00h). Reply:
Address Unit Function Write Bit Data Address of the bit New value of the bit CRC CRC16
5.3.1
Request:
Address 01h Function 05h Data 00h 42h FFh 00h CRC 2Ch 2Eh
Reply:
Address 01h Function 05h Data 00h 42h FFh 00h CRC 2Ch 2Eh
Revision: 050714
Page 14 of 29
SELCO A/S
MODBUS Protocol
Reply:
Address Unit Function Write Word Data Address of the word New value of the word CRC CRC16
5.4.1
Request:
Address 01h Function 06h Data 00h 00h 00h 02h CRC 08h 0Bh
Reply:
Address 01h Function 06h Data 00h 00h 00h 02h CRC 08h 0Bh
5.4.2
Request:
Address 01h Function 06h Data 00h 0Eh 00h 03h CRC A8h 08h
Reply:
Address 01h Function 06h Data 00h 0Eh 00h 03h CRC A8h 08h
Revision: 050714
Page 15 of 29
SELCO A/S
MODBUS Protocol
Reply:
Address Unit Function Read Exception Status Data Unit Status CRC CRC16
5.5.1
Request:
Address 01h Function 07h CRC 41h E2h
Reply:
Address 01h Function 07h Data 01h CRC E3h F0h
Reply:
Address Unit Function Write n words Data Address of first word Number of words CRC CRC16
Revision: 050714
Page 16 of 29
SELCO A/S
MODBUS Protocol
5.6.1
And the siren relay shall be deactivated. The value of each address can be calculated as follows (MSB is not used). Address 19h
19h LED State 0 X LED number 5 001 4 000 3 010 2 001 1 000 = Address value Binary 00010000 10001000 Hex (byte) 10h 88h Hex (word) 1088h
Address 1Ah
1Ah LED State 0 X LED number 10 000 9 001 8 010 7 010 6 000 = Address value Binary 00000010 10010000 Hex (byte) 02h 90h Hex (word) 0290h
Address 1Bh
1Bh LED State 0 X LED number 15 001 14 010 13 011 12 100 11 011 = Address value Binary 00010100 11100011 Hex (byte) 14h E3h Hex (word) 14E3h
Address 1Ch
1Ch LED State 0 X LED number 20 000 19 100 18 011 17 100 16 011 = Address value Binary 00001000 11100011 Hex (byte) 08h E3h Hex (word) 08E3h
Revision: 050714
Page 17 of 29
SELCO A/S
MODBUS Protocol
Address 1Dh
1Dh LED Status 0 X LED number Rely 001 24 100 23 001 22 000 21 010 = Address value Binary 00011000 01000010 Hex (byte) 18h 42h Hex (word) 1842h
Reply:
Address 01h Function 10h Data 00h 19h 00h 05h CRC D1h CDh
Revision: 050714
Page 18 of 29
SELCO A/S
MODBUS Protocol
42h
Bit
R/W
43h
Bit
R/W
50h 51h
Word Bit
R/W R/W
82h
Word
A1h A2h A3h A4h A5h A6h A7h A8h A9h AAh B9h BAh
Word Word Word Word Word Word Word Word Word Word Word Word
R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W
* It is not possible to write the state of an alarm. However, the write operation can be used to alter the function of the alarm or to command, e.g. a channel specific reset.
Revision: 050714
Page 19 of 29
SELCO A/S
MODBUS Protocol
42h
Bit
R/W
43h
Bit
R/W
44h
Bit
R/W
45h
Bit
R/W
50h 82h
Word Word
R/W R
A1h A2h A3h A4h A5h A6h A7h A8h A9h AAh B9h BAh
Word Word Word Word Word Word Word Word Word Word Word Word
R R R R R R R R R R R R
Revision: 050714
Page 20 of 29
SELCO A/S
MODBUS Protocol
Revision: 050714
Page 21 of 29
SELCO A/S
MODBUS Protocol
Access Read/Write R R R R R
Description Status of Alarm 30, 31, 32, 33 & 34 Status of Alarm 35, 36, 37, 38 & 39 Status of Alarm 40, 41, 42, 43 & 44 Status of Alarm 45, 46, 47 & 48 Siren Output 00h = Deactivated FFh = Activated LED Test FFh = Do LED Test Read: Returned value = 00h Reset FFh = Do Reset Read: Returned value = 00h Dimming 01h FFh (1 100%) LED Synchronization FFh = Synchronize LEDs Read: Returned value = 00h Slave Address 01h 3Fh Status of OUT 1 Status of OUT 2 Status of OUT 3 Status of OUT 4 Status of OUT 5 Status of OUT 6 Status of OUT 7 Status of OUT 8 Status of OUT 9 Status of OUT 10 Status of OUT 11 Status of OUT 12 Status of OUT 13 Status of OUT 14 Status of OUT 15 Status of OUT 16 Status of OUT 1, 2, 3, 4 & 5 Status of OUT 6, 7, 8, 9 & 10 Status of OUT 11, 12, 13, 14 & 15 Status of OUT 16 Analog Value IN1 ** Analog Value IN2 ** Analog Value IN3 ** Analog Value IN4 ** Analog Value IN5 ** Analog Value IN6 ** Analog Value IN7 ** Analog Value IN8 ** Analog Value IN9 ** Analog Value IN10 ** Analog Value IN11 ** Analog Value IN12 ** Analog Value IN13 ** Analog Value IN14 ** Analog Value IN15 ** Analog Value IN16 **
42h
Bit
R/W
43h
Bit
R/W
50h 51h
Word Bit
R/W R/W
82h
Word
A1h A2h A3h A4h A5h A6h A7h A8h A9h AAh ABh ACh ADh AEh AFh B0h B9h BAh BBh BCh D0h D1h D2h D3h D4h D5h D6h D7h D8h D9h DAh DBh DCh DDh DEh DFh
Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word
R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R
Revision: 050714
Page 22 of 29
SELCO A/S
MODBUS Protocol
I/O Address E0h E1h E2h E3h E3h E4h E5h E6h E7h 90h 91h 92h 93h 94h 95h 96h 97h 98h 99h 9Ah 9Bh 9Ch 9Dh
Parameter Type Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word
Access Read/Write R R R R R R R R R R R R R R R R R R R R R R R
Description Analog Value IN17 ** Analog Value IN18 ** Analog Value IN19 ** Analog Value IN20 ** Analog Value IN20 ** Analog Value IN21 ** Analog Value IN22 ** Analog Value IN23 ** Analog Value IN24 ** Status of OUT 1, 2, 3, 4 & 5 *** Status of OUT 6, 7, 8, 9 & 10 *** Status of OUT 11, 12, 13, 14 & 15 *** Status of OUT 16 *** Status of Alarm 1, 2, 3, 4 & 5 *** Status of Alarm 6, 7, 8, 9 & 10 *** Status of Alarm 11, 12, 13, 14 & 15 *** Status of Alarm 16, 17, 18, 19 & 20 *** Status of Alarm 21, 22, 23 & 24 *** Status of Alarm 25, 26, 27, 28 & 29 *** Status of Alarm 30, 31, 32, 33 & 34 *** Status of Alarm 35, 36, 37, 38 & 39 *** Status of Alarm 40, 41, 42, 43 & 44 *** Status of Alarm 45, 46, 47 & 48 ***
* It is not possible to write the state of an alarm. However, the write operation can be used to alter the function of the alarm or to command, e.g. a channel specific reset. ** Analog values are read out as words. 20mA corresponds to: 744h (1860 decimal). Max. is 7FFh (2047 decimal), equal to: 22mA. 10V DC corresponds to: 6AAh (1706 decimal). Max. is 7FFh (2047 decimal), equal to: 12V DC. 24V DC corresponds to: 5A5h (1445 decimal) Max. is 7FFh (2047 decimal), equal to: 34V DC. *** The maximum block you can read out at the time is 12 words. Therefore the packed data is repeated in one block at this position (90h 9Dh). With the 12 word read block limit you can now decide to read in one block: 1. Read outputs 1-16 and alarms 1-39 - 12 words. 2. Read outputs 6-16 and alarms 1-44 - 12 words. 3. Read outputs 11-16 and alarms 1-48 - 12 words.
Revision: 050714
Page 23 of 29
SELCO A/S
MODBUS Protocol
41h
Bit
R/W
42h
Bit
R/W
43h
Bit
R/W
50h 51h
Word Bit
R/W R/W
A1h A2h A3h A4h A5h A6h A7h A8h A9h AAh ABh ACh
Word Word Word Word Word Word Word Word Word Word Word Word
R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W
Revision: 050714
Page 24 of 29
SELCO A/S
MODBUS Protocol
I/O Address ADh AEh AFh B0h B1h B2h B3h B4h B9h BAh BBh BCh
Parameter Type Word Word Word Word Word Word Word Word Word Word Word Word
Access Read/Write R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W
Description Status of VIRINP 13 Status of VIRINP 14 Status of VIRINP 15 Status of VIRINP 16 Status of VIRINP 17 Status of VIRINP 18 Status of VIRINP 19 Status of VIRINP 20 Status of VIRINP 1, 2, 3, 4 & 5 Status of VIRINP 6, 7, 8, 9 & 10 Status of VIRINP 11, 12, 13, 14 & 15 Status of VIRINP 16, 17, 18, 19 & 20
Revision: 050714
Page 25 of 29
SELCO A/S
MODBUS Protocol
50h 51h
Word Bit
W W
Revision: 050714
Page 26 of 29
SELCO A/S
MODBUS Protocol
42h
Bit
R/W
43h
Bit
R/W
50h
Word
R/W
Revision: 050714
Page 27 of 29
SELCO A/S
MODBUS Protocol
I/O Address D0h D1h D2h D3h D4h D5h D6h D7h D8h D9h DAh DBh DCh DDh DEh DFh
Parameter Type Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word Word
Access Read/Write R R R R R R R R R R R R R R R R
Description Analog Value IN1 Analog Value IN2 Analog Value IN3 Analog Value IN4 Analog Value IN5 Analog Value IN6 Analog Value IN7 Analog Value IN8 Analog Value IN9 Analog Value IN10 Analog Value IN11 Analog Value IN12 Analog Value IN13 Analog Value IN14 Analog Value IN15 Analog Value IN16
Revision: 050714
Page 28 of 29
SELCO A/S
MODBUS Protocol
Status of Alarms 1, 2, 3, 4 & 5 Status of Alarms 6, 7, 8, 9 & 10 Status of Alarms 11, 12, 13, 14 & 15 Status of Alarms 16, 17, 18, 19 & 20 Siren Relay 00h = Deactivated FFh = Activated LED Test FFh = Do LED Test Reset FFh = Do Reset Dimming 01h FFh (1 100%) Status of Output 1 Status of Output 2 Status of Output 3 Status of Output 4 Status of Output 5 Status of Output 6 Status of Output 7 Status of Output 8 Status of Outputs 1, 2, 3, 4 & 5 Status of Outputs 6, 7, & 8
A1h A2h A3h A4h A5h A6h A7h A8h B9h BAh
Word Word Word Word Word Word Word Word Word Word
R R R R R R R R R R
Revision: 050714
Page 29 of 29