X-zone 5000 RS-485 Modbus RTU communication protocol. PRELIMINARY For development purposes only. May change without notice

Document title: X-zone 5000 RS-485 Modbus RTU communication protocol File name: X-zone Modbus.doc Project: Smartbox Storage location: Project d...
Author: Pauline Nash
33 downloads 0 Views 515KB Size
Document title:

X-zone 5000 RS-485 Modbus RTU communication protocol

File name:

X-zone Modbus.doc

Project:

Smartbox

Storage location:

Project directory

File format:

Microsoft Word doc

Responsible:

W.-G. Traving

History:

Rev.

Datum

1

19.05.2014

Change Initial version

Author W.-G. Traving

X-zone 5000 RS-485 Modbus RTU communication protocol

PRELIMINARY For development purposes only. May change without notice.

Applies to software versions X-zone 2.24 X-am V6.8

1

Table of Contents 1.

Basic communication parameters ............................................................................................... 3

2.

Example Configurations............................................................................................................... 3

2.1.

Redlion Panel G308A2 aka Dräger RVP 5000 .......................................................................... 3

2.2.

MOXA MGate MB3180 ............................................................................................................ 3

3.

Definitions ................................................................................................................................... 7

3.1.

Gas names ............................................................................................................................... 7

3.2.

Measurement units ................................................................................................................. 7

4.

Modbus Register Mapping .......................................................................................................... 9

4.1.

Holding Registers (Function Code 0x03) ................................................................................. 9

4.1.1.

General information ........................................................................................................ 9

4.1.2.

GSM communication status overview........................................................................... 12

4.1.3.

Reserved registers ......................................................................................................... 14

4.1.4.

Gas name and unit table ............................................................................................... 14

4.1.5.

Local X-am gas measurement values ............................................................................ 16

4.1.6.

Group maximum concentrations .................................................................................. 20

4.1.7.

Alarm messages summary ............................................................................................. 23

4.2. Implementation hints for a GSM based communication and logging device connected through Modbus................................................................................................................................ 27 4.2.1.

Initial setup (read and write) ......................................................................................... 27

4.2.2.

Writing interval.............................................................................................................. 28

4.2.3.

Detection interval .......................................................................................................... 28

4.2.4.

Slow logging interval ..................................................................................................... 29

4.2.5.

Fast logging interval....................................................................................................... 30

4.2.6.

Cloud update interval .................................................................................................... 30

2

1.

Basic communication parameters

Please set the following modbus configuration parameters using the CC-Vision configuration software for the X-zone: •

RS-485 half duplex asynchronous communication



115200 Baud, 1 start bit, 8 data bits, 1 even parity bit, 1 stop bit



Modbus slave address = 2 (allowed range 1..247)



Modbus enabled on XEXT2 Socket (upper, male, yellow) : Pin1=D+ Pin2=DPin 3=GND (Screening)

The GND connection is DC coupled to the system ground via 100kOhm and a capacitor and intended for screening purposes only. Every X-zone has two RS-485 interfaces. Electrical wise they are identical, but XEXT1 (the lower one with color coding in red) is a female socket and XEXT2 (the upper one, color coding yellow) is a male one. A proprietary data packet (not Modbus) for wired X-zone to X-zone communication is transmitted every 500 ms on the lower socket, if it is not used for Modbus. The lower socket is also the charge socket for conducted charging. This has to be connected to the upper socket of the next daisychained X-zone. The upper socket (when not configured for Modbus) is handled as a slave and will not transmit any packet without being asked. Only on reception of a valid packet it will immediately answer with its information packet. One out of the two sockets may be configured for Modbus communication. This Modbus socket can be connected to a Modbus master speaking the Modbus RTU protocol, responding according to the Modbus protocol. It will never send any data without being asked. The timing specifications of the Modbus RTU protocol are not fully implemented. Especially the block end timeout is fixed to four characters, i.e. 0.38ms at 115200 baud. Smaller gaps of less than four characters are ignored. The maximum block length for Modbus RTU packets is 256 bytes.

2.

Example Configurations Configurations

2.1.

Redlion Panel G308A2 aka Dräger RVP 5000

Use the RS485 PORT A (rightmost RJ-45 socket). RJ-45 Pin 1 TxB goes to XEXT2 Pin 1 D+ (standard color white with orange line) RJ-45 Pin 2 TxA goes to XEXT2 Pin 2 D- (standard color solid orange) RJ-45 Pin 6 COMMON goes to XEXT2 Pin 3 GND (Screening only)

2.2.

MOXA MGate MB3180

Hints for using the Modbus RTU/TCP gateway MOXA MGate MB3180 Moxa configuration on standard IP address 192.168.127.254 3

RS-485 two wire connections (DB-9 connector): Pin 3 = D+ Pin 4 = DPin 5 = GND

4

Remark: Select Baudrate and Parity as configured in the X-zone (i.e. 115200 baud, even parity)

Remark: Set Channel No. to 02 when using the default configuration 5

6

3.

Definitions

3.1.

Gas names

A valid gas name consists of exactly 4 characters. The name of a gas is the short name followed by blanks if this is shorter than 4 characters (example: “ch4 “, “O2 “, “H2S “, “CO “). Digits (0 to 9) are allowed as well as capital (A to Z) and small (a to z) letters and space (0x20). Superand Subscripts are not allowed, neither special characters like +, *, #, ä, é, %, &, etc. If zero (0x00) is written – e.g. to indicate the end of a string – it will be replaced by space (0x20).

3.2.

Measurement units

A gas unit string is the unit of the associated measurement value. The following entries are valid: "Vol%"

"ppm"

"%UEG"

"%LEL"

"%LIE"

"mg/m3"

"ppb"

"mbar"

When read these strings are zero terminated, but it is not necessary to write the zero termination. Additional spaces as postfix are ignored. Any invalid setting will be indicated by a question mark ‘?’ appended to the unit. If the written string is already five characters long, the fifth character will be overwritten by the question mark.

3.2.1.1. Alarm states The alarm state registers are signed integers (16 bit), showing the alarm state. The lower byte is ordered by increasing priority. Higher prioritized alarms override lower prioritized ones. Bit 0: 0acknowledged, 1-unacknowledged. Bit 3-1: alarm main type. The upper byte is a bit field with additional information concerning the corresponding measurement value. Lower Byte

Value

Description

ALARM_OK

0x0

No alarm

ALARM_A1_Q

0x2

A1 alarm acknowledged (“quittiert”)

ALARM_A1

0x3

A1 alarm (concentration pre-alarm)

ALARM_ERR_Q

0x4

Device error acknowledged

ALARM_ERR

0x5

Device error

ALARM_A2_Q

0x6

A2 alarm acknowledged

ALARM_A2

0x7

A2 alarm (concentration main alarm)

ALARM_EVAC

0x9

Evacuation alarm

Upper Byte

Bitmask Description

ALARM_OVERFLOW

0x0100 (Bit 8)

ALARM _BLOCKING

0x0200 (Bit 9)

Range overflow, measurement value above highest measurable level. Corresponding concentration register will show +2147483647 = 0x7FFFFFFF Sensor blocked and channel switched off until X-am switched off and on again due to severe, wrong environmental conditions. Corresponding concentration register will show +2147483647 = 0x7FFFFFFF 7

ALARM_UNDERFLOW 0x0400 (Bit 10)

Range underflow, measurement value below lowest detectable level. Corresponding concentration register will show -2147483648 = 0x80000000

3.2.1.2. Device Alarm Flags The following flags give an indication of the reason for the device alarm. A device alarm is either located in the X-am such as channel/sensor failures or in the X-zone, for example a blocked pump, low battery or loss of contact to any grouped X-zone. Co de

X-zone error flags

Description

Hex bit mask

1

ERR_XAM_ALKALINE

X-am 5000/5600 with alkali supply unit

(00 00 00 01)

2

ERR_XAM_COM

No communication with X-am 5000

(00 00 00 02)

3

ERR_XZONE_ACCU_COM

Communication error with battery controller X-zone 5000.

(00 00 00 04)

4

ERR_XAM_BATTERY_A2

Main battery alarm X-am 5000/5600

(00 00 00 08)

5

ERR_XAM_BATTERY_A1

Battery pre-alarm X-am 5000/5600

(00 00 00 10)

6

ERR_XAM_CHARGE

Charging current X-am 5000/5600 too low

(00 00 00 20)

7

ERR_PUMP_NOPUMP

Holder (pump) detected, but no pump fitted

(00 00 00 40)

8

ERR_PUMP_FLOW

Flow fault

(00 00 00 80)

9

ERR_PUMP_ADAPTER

Holder status change (pump) during operation

(00 00 01 00)

10

ERR_FLASH_CODE

Check sum error program code

(00 00 02 00)

11

ERR_FLASH_DW

Check sum error operating parameter

(00 00 04 00)

12

ERR_FLASH_USER

Check sum error operating parameter

(00 00 08 00)

13

ERR_FLASH_MAINT

Check sum error operating parameter

(00 00 10 00)

14

ERR_RAM_TEST

Working memory test error

(00 00 20 00)

15

ERR_ADC_CONVERSION

Faulty ADC conversion

(00 00 40 00)

16

ERR_PAIRING

No contact with main device in grouping mode

(00 00 80 00)

17

ERR_CHARGE_CIRCUIT

Charging electronics faulty

(00 01 00 00)

18

ERR_DEEP_DISCHARGE

Battery completely discharged

(00 02 00 00)

19

ERR_XZONE_BATTERY_A2

Battery main alarm of the X-zone 5000

(00 04 00 00)

20

ERR_XZONE_BATTERY_A1

Battery pre-alarm of the X-zone 5000.

(00 08 00 00)

21

ERR_XAM_INSTRUMENT

Device error X-am 5000/5600

(00 10 00 00)

22

ERR_XAM_ALARM_INFO

Alarm pattern X-am 5000/5600 faulty

(00 20 00 00)

23

ERR_XAM_FW_INCOMPATIBLE

Incorrect software version in the X-am

(00 40 00 00) 8

5000/5600 24

ERR_XZONE_UNKNOWN_ GAS_OR_UNIT

Gas type or unit unknown

(00 80 00 00)

25

ERR_GROUP_GASTYPE_ OVERFLOW

More than 8 different gases in one group

(01 00 00 00)

26

ERR_MODBUS_TIMEOUT_BIT

Modbus communication error

(02 00 00 00)

27

Not used yet.

28

Not used yet.

29

ERR_SILENT_XZONE_BATT_A2

Battery main alarm

(10 00 00 00)

30

ERR_SILENT_DEEP_DISCHARGE

Battery completely discharged

(20 00 00 00)

31

ERR_SILENT_CHARGE_CIRCUIT

Charging electronics faulty

(40 00 00 00)

32

ERR_SILENT_ACCU_COM

Communication error with battery controller X-zone 5000

(80 00 00 00)

4.

Modbus Register Mapping

Note: All registers are 16 bit wide. All unused registers are read as 0x0000. Slave Address: Configurable with CC-Vision. Default is 0x02.

4.1.

Holding Registers (Function Code 0x03)

Legend #

Number of consecutive registers

Strings

ASCII chars, two per register, big endian

R

read only register

R/W

read and writable register

4.1.1.

General information

Register # Parameter Name (dec)

Format

R/W

400001

1 X-zone Modbus implementation version number major * 256 + minor

I16

R

400003

4 X-zone part number

8 chars (8th is 0x00)

R

400007

5 X-zone serial number

10 chars with hyphen R and 0x00

400012

4 X-am part number

8 chars (8th is 0x00)

400016

5 X-am serial number

10 chars with hyphen R and 0x00

R

9

400021

1 X-zone radio net number

I16 (0...255)

R

400022

1 Closed network sequence number 0 = open network >0 = closed network

I16

R

400023

1 Main device (in closed network): device count Otherwise: 0

I16

R

400024

1 closed network: device number (0 = main device, >0 = group device)

I16

R

open network: 255 400025

1 X-zone local alarm state

I16

R

400026

1 X-zone net alarm state

I16

R

400027

1 Read only copy of reg. 400498 “Gas update flag” Gas name and unit table update flag

I16

R

400028

1 Read only copy of reg. 404002 “Alarm summary changed” flag

I16

R

400029

1 X-zone evacuation alarm

U16

R/W

400030

2 X-zone error flags

U32

R

400032

1 X-zone battery voltage (mV)

I16

R

400033

1 Temperature (units of 1°C)

I16

R

400034

1 Alarm global acknowledge

I16

R/W

400035

1 Communication watchdog

U16

R/W

400036

1 X-am battery voltage (mV)

I16

R

400037

1 Alarm Hold

U16

R/W

U16

R

0 = disable 1 = enable 2 = reset and enable 400038

1 Contact Switch State 0 = contact switch open 1 = contact switch closed

4.1.1.1. Local and net alarm state The alarm state registers are signed integers (16 bit), showing the alarm state, ordered by increasing priority. Higher prioritized alarms override lower prioritized ones. The register “X-zone local alarm state” reflects the status of the X-zone itself and any X-am sensor of the local X-am attached on the X-zone. This alarm will raise a main alarm flashing red (“Mutteralarm”). You may get the per sensor alarm state in register set 4014xx.

10

The register “X-zone net alarm state” is the overall alarm state of all other units in the X-zone wireless/wired network, but excluding the local alarm state. This will raise a secondary alarm flashing red/green (“Tochteralarm”), if there is no higher priority main alarm.

4.1.1.2. X-zone error flags in case of device device alarm The device alarm is either located in the X-am such as channel/sensor failures or in the X-zone, for example a blocked pump, low battery or loss of contact to any grouped X-zone. A detailed error flag may be read in register 400030 “X-zone error flags”.

4.1.1.3. Evacuation alarm Writing anything else than 0 triggers the net wide evacuation alarm for 20 seconds. To prolong the alarm, it has to be retriggered about every 2 seconds. It is allowed to write any value instead of 0 and 1 only because there are Modbus master devices which prevent writing the same value multiple times. In this case it would be impossible to keep the alarm retriggered by writing 1 again since the Modbus master device ignores these writing actions. The solution is to alternately write different values except 0. (e.g. a repeating sequence of 1 and 2)

4.1.1.4. Communication watchdog watchdog The register “Communication watchdog” is zero (watchdog off) after system start. Any value greater than one will start a countdown, i.e. the value will be decreased by one each second. It has to be rewritten (watchdog retrigger) regularly. If the count value is one (through automatic decrement or set directly by purpose), a device alarm (“Gerätefehler”) is generated and the countdown stops (at count value one). Rewriting a value > 1 will stop the alarm and restart the countdown. Writing a zero will also stop the alarm and stop the watchdog.

4.1.1.5. Alarm hold The “Alarm hold” register defines the way in which the data is updated and held in the registers for local values and maximum values. If the “Alarm hold register” is 0 then the registers contain only the current, valid sensor values (including values with valid timeout). For all gas/unit combinations each new gas concentration replaces the old one. Hence, on request the Modbus master will always get the newest values, which are not older than 20 seconds. Setting the “Alarm hold” register from 0 to 1 or 2 enables the “Alarm hold” mechanism, where for each gas/unit combination only the worst value is stored until the “Alarm hold”-register is changed (by writing 0 or 2) or until the “Alarm hold”-timeout occurs. The “Alarm hold”-timeout is 35 minutes and will reset all values to current values. Then, the timeout is set to 35 minutes automatically and the “Alarm hold”-mechanism stays active. In order to decide which value is worse, the alarm type of the new data is compared to the old alarm type and if these are equal, the concentration values are compared. This means that the Modbus master will always get the same values as long as no worse value occur and the register is not written. If the “Alarm hold” register is set from 1 to 2, all local and maximum values are reset to the current values and the “Alarm hold” register is set to 1 again. If the “Alarm hold” register is set from 1 to 1, then only the “Alarm hold”-timeout will be reset to 35 minutes without changing any local and maximum value.

11

4.1.2.

GSM communication communication status overview

The register set “Communication status overview” has to be set by an attached long range communication device (called X-com throughout this document), during link setup to give the X-zone or the modbus master status information about the communication link and some configuration parameters of the communication device. All registers with “char” in the format column can only by set to printable ASCII characters (0x20 to 0x7E). Additionally, zero (0x00) can be written.

Register # (dec)

Parameter Name

Format

R/W

400101

1

Communication type 0: none 1: GSM 2: WLAN 3: ISM

I16

R/W

400110

1

GSM status 0: not connected 1: active CSD connection 2: HSCSD connection 3: ECSD connection 4: GPRS connection 5: EGPRS connection 6: HSDPA connection

I16

R/W

400111

1

GSM registration 0: not registered 1: registered 2: roaming

I16

R/W

400112

8

GSM IMEI

16 chars R/W

400120

5

GSM subscriber number prefix /area code

10 chars R/W

400125

6

GSM subscriber number

12 chars R/W

400131

4

GSM operator short name

8 chars

400135

8

GSM operator long name

16 chars R/W

400143

1

GSM MCC country code

I16

R/W

400144

1

GSM MNC network code

I16

R/W

400145

1

GSM RSSI level - received signal strength indication 0 - (-113) dBm or less 1 - (-111) dBm 2..30 - (-109)dBm..(-53)dBm / 2 dBm per step 31 - (-51)dBm or greater 99 - not known or not detectable

I16

R/W

400146

1

GSM cell id

I16

R/W

R/W

12

400147

1

GSM active band

I16

R/W

400148

1

GSM tx power

I16

R/W

400149

1

GSM last error

I16

R/W

400150

1

WiFi status 0: not connected 1: 2.4GHz connection 2: 5GHz connection

I16

R/W

400151

16 WiFi network ssid

32 chars R/W

400167

4

WiFi ap bssid

U64

R/W

400171

1

WiFi channel

I16

R/W

400172

1

WiFi RSSI level

I16

R/W

400173

1

WiFi security type 0: none 1: WEP 2: WPA PSK 3: WPA2 PSK

I16

R/W

400174

1

WiFi last error

I16

R/W

400180

5

X-com name 10 chars R/W (user defined identifier) Valid characters are: letters (a-z and A-Z), numbers (0-9), minus (-), plus (+) Dependent on the width of the written characters, it may occur that not all characters are shown on the X-am

400187

3

X-com software version

6 chars

R/W

400190

2

X-com ip address

U32

R/W

400192

5

X-com variable text (to be displayed on a X-am status page)

10 chars R/W

400200

3

GPS time of position fix “hhmmss” 24h format local time

6 chars

R/W

400203

3

GPS date of position fix “yymmdd” local time

6 chars

R/W

400206

1

GPS time offset to UTC in minutes (e.g. for CET this would give +60, CEST +120)

I16

R/W

400207

6

GPS Latitude of position e.g. “05350.267,N\0”

12 chars R/W

400213

6

GPS Longitude of position e.g. “01039.683,E\0”

12 chars R/W

400219

1

GPS fix quality 0: no GPS fix 1: GPS fix 2: DGPS fix

I16

R/W

13

400220

1

GPS number of satellites being tracked

I16

R/W

400221

1

GPS height above mean sea level (meters)

I16

R/W

400222

1

GPS last error

I16

R/W

400230

1

X-com status bits

U16

R/W

Flags for icon control on X-am status page: 0x01 – eMail upload configured 0x02 – SMS notification configured 0x04 – log data upload (cloud) configured

4.1.3.

Reserved registers

The following address range is reserved for assignment and use by the attachable X-com communication device: Register 400251 … 400400

4.1.4.

Gas name and unit table

These two writable sections contain a list of gases whereas each gas is defined by the combination of its name (Gas_fixed_n) and its unit (Unit_fixed_n), i.e. gases with the same name and different units are treated as different gases. Valid gas names and units are described above. The registers “Gas_fixed_n” and “Unit_fixed_n” define the ordering of the values in section “Local Xam gas measurement values” (401xxx) and “Group maximum concentrations” (402xxx). Gas concentrations are written at the index of the gas they belong to, i.e. Conc_n belongs to Gas_fixed_n and Unit_fixed_n. If the modbus master does not write anything into the gas list, it will be filled out by the system, when the X-zone gets to know the gases of the own X-am or from other X-zones in the network. The list is than filled in a non-predictable order. New gases are appended and the order will stay constant until the next power cycle or when invalidating an entry through a Modbus write access. To use a certain order the registers can be preset by the Modbus master. In this case the contents of the corresponding registers (local and group maximum concentration values) are adopted accordingly. In order to cancel an assignment (i.e. remove an entry out of the fixed table) the name entry may be overwritten by four blanks (4x 0x20) “ “. This will automatically also invalidate the corresponding Unit_fixed_n register to an empty unit (five blanks + 0x00). To check the gas names used by a system, do a test run without presetting this table and read the register contents.

Register # Parameter Name Format R/W (dec) 400401

2 Gas_fixed_1

4 chars

R/W

400403

2 Gas_fixed_2

4 chars

R/W

400405

2 Gas_fixed_3

4 chars

R/W 14

400407

2 Gas_fixed_4

4 chars

R/W

400409

2 Gas_fixed_5

4 chars

R/W

400411

2 Gas_fixed_6

4 chars

R/W

400413

2 Gas_fixed_7

4 chars

R/W

400415

2 Gas_fixed_8

4 chars

R/W

400417

2 Gas_fixed_9

4 chars

R/W

400419

2 Gas_fixed_10

4 chars

R/W

400421

2 Gas_fixed_11

4 chars

R/W

400423

2 Gas_fixed_12

4 chars

R/W

400498

1 Gas update flag

I16

R/W

400499

1 Overflow

I16

R

Overflow will be set to a value not equal zero, if there are more gases known by the system, than free table entries. Every combination of the same gas name with different units counts as one extra entry. Writing any entry by another valid gas name will automatically reset all corresponding (and outdated) measurement data in the local and group maximum tables below by setting its timeout value to zero. If there is any change in any of the 4004xx registers from the “Gas name and unit tables”, the “Gas update flag” register will be set to one. This can be used to notify the Modbus master of any change in this table. If Modbus master recognizes a “Gas update flag” == 1, it should take the following actions: - Reset the “Gas update flag” to zero - Read the whole table 400xxx one time - Check if the “Gas update flag” is still zero - If not, repeat the whole sequence, until the “Gas update flag” is zero As long as the “Gas update flag” is still zero, the Modbus master information about the gas sensors in the system and the order of the table is valid. So the Modbus master needs only to check the “Gas update flag”, when pulling the measurement data. A gas unit “Unit_fixed_n” string is the unit of the associated measurement value. By writing an empty unit (5 blanks + 0x00) into a Unit_fixed_n register, the entry for Index n will be invalidated and automatically reused again. Also the corresponding fixed gas name Gas_fixed_n names will be cleared (i.e. reset to four blanks) automatically and the measurement values invalidated.

Register # Parameter Name Format R/W (dec) 400501

3 Unit_fixed_1

6 chars

R/W

400504

3 Unit_fixed_2

6 chars

R/W 15

400507

3 Unit_fixed_3

6 chars

R/W

400510

3 Unit_fixed_4

6 chars

R/W

400513

3 Unit_fixed_5

6 chars

R/W

400516

3 Unit_fixed_6

6 chars

R/W

400519

3 Unit_fixed_7

6 chars

R/W

400522

3 Unit_fixed_8

6 chars

R/W

400525

3 Unit_fixed_9

6 chars

R/W

400528

3 Unit_fixed_10

6 chars

R/W

400531

3 Unit_fixed_11

6 chars

R/W

400534

3 Unit_fixed_12

6 chars

R/W

4.1.5.

Local XX-am gas measurement values

Important: A local gas measurement value is defined by the following information: timeout, concentration, alarm type, gas type and unit. The letter two parameters can be found in the registers “Gas name and unit table” above at the same index. For example if the fifth entries in the tables above contain “O2” and “ppm” all O2 concentrations that are given in ppm, the corresponding timeout, alarms etc. will be in the fifths row of every following register array. Every gas measurement value is represented by a tuple of registers, i.e. value_n consists of (Timeout_n, Conc_n, Alarm_n). Any concentration of a certain gas and unit must never be evaluated without taking into account all corresponding other tuple members like timeout, alarms etc.

4.1.5.1. Timeout If Timeout_n reaches zero (decremented twice a second), the associated Conc_n is invalid / outdated. The associated values must be used only, if this parameter is greater than zero.

Register # Parameter Name Format R/W (dec) 401001

1 Timeout_1

I16

R

401002

1 Timeout_2

I16

R

401003

1 Timeout_3

I16

R

401004

1 Timeout_4

I16

R

401005

1 Timeout_5

I16

R

401006

1 Timeout_6

I16

R

401007

1 Timeout_7

I16

R

401008

1 Timeout_8

I16

R 16

401009

1 Timeout_9

I16

R

401010

1 Timeout_10

I16

R

401011

1 Timeout_11

I16

R

401012

1 Timeout_12

I16

R

4.1.5.2. Concentration Concentration values The “Conc_n” values are long signed integers (32 bit), showing exactly the displayed value (no different rounding) times 1000, i.e. O2 will show “21900” in fresh air, when units are set to “Vol%”. This value may be negative due to sensor drift, if not calibrated. In case of an overflow or underflow or a locked sensor channel the following special numerical values are used: Overflow, measurement value above highest measurable level

+2147483647 = 0x7FFFFFFF

Underflow, measurement value below lowest detectable level

-2147483648 = 0x80000000

Sensor locked (blocking alarm) due to severe conditions until X-am is restarted

+2147483647 = 0x7FFFFFFF

Register # Parameter Name Format R/W (dec) 401201

2 Conc_1

I32

R

401203

2 Conc_2

I32

R

401205

2 Conc_3

I32

R

401207

2 Conc_4

I32

R

401209

2 Conc_5

I32

R

401211

2 Conc_6

I32

R

401213

2 Conc_7

I32

R

401215

2 Conc_8

I32

R

401217

2 Conc_9

I32

R

401219

2 Conc_10

I32

R

401221

2 Conc_11

I32

R

401223

2 Conc_12

I32

R

4.1.5.3. Alarm values The alarm registers are signed integers (16 bit), reflecting the alarm state (cf. 3.2.1.1) of the corresponding measurement value. Register # Parameter Name Format R/W 17

(dec) 401401

1 Alarm_1

I16

R

401402

1 Alarm_2

I16

R

401403

1 Alarm_3

I16

R

401404

1 Alarm_4

I16

R

401405

1 Alarm_5

I16

R

401406

1 Alarm_6

I16

R

401407

1 Alarm_7

I16

R

401408

1 Alarm_8

I16

R

401409

1 Alarm_9

I16

R

401410

1 Alarm_10

I16

R

401411

1 Alarm_11

I16

R

401412

1 Alarm_12

I16

R

18

4.1.5.4. Threshold values The alarm thresholds are long signed integers (32 bit), showing exactly the displayed value (no different rounding) times 1000, i.e. O2 will show “21900” in fresh air, when units are set to “Vol%”. (4015XX, 4016XX: Not implemented yet. Likely to never get implemented.)

Register # Parameter Name Format R/W (dec) 401501

2 A1thres_1

I32

R

401503

2 A1thres_2

I32

R

401505

2 A1thres_3

I32

R

401507

2 A1thres_4

I32

R

401509

2 A1thres_5

I32

R

401511

2 A1thres_6

I32

R

401513

2 A1thres_7

I32

R

401515

2 A1thres_8

I32

R

401517

2 A1thres_9

I32

R

401519

2 A1thres_10

I32

R

401521

2 A1thres_11

I32

R

401523

2 A1thres_12

I32

R

Register # Parameter Name Format R/W (dec) 401601

2 A2thres_1

I32

R

401603

2 A2thres_2

I32

R

401605

2 A2thres_3

I32

R

401607

2 A2thres_4

I32

R

401609

2 A2thres_5

I32

R

401611

2 A2thres_6

I32

R

401613

2 A2thres_7

I32

R

401615

2 A2thres_8

I32

R

401617

2 A2thres_9

I32

R

401619

2 A2thres_10

I32

R

401621

2 A2thres_11

I32

R

401623

2 A2thres_12

I32

R

19

4.1.6.

Group maximum concentrations

Important: A group maximum value is defined by the following information: timeout, concentration, alarm type, X-zone ID, gas type and unit. The letter two parameters can be found in the registers “Gas name and unit table” above at the same index. For example if the fifth entries in the tables above contain “O2” and “ppm” all O2 concentrations that are given in ppm, the corresponding timeout, alarms etc. will be in the fifths row of every following register array. The whole register set 402xxx up to 403xxx containing the maximum gas concentrations is valid only in a “closed network” configuration (if register 400024 != 255). Only the maximum (or the minimum for O2) value of one gas type (name and unit) is propagated through the network and stored. The current maximum holder will be announced in the corresponding X_zone_n registers.

4.1.6.1. Timeout If Timeout_n reaches zero (decremented twice a second), the associated Conc_n is invalid / outdated. The associated values must be used only, if this parameter is greater than zero.

Register # Parameter Name Format R/W (dec) 402001

1 Timeout_1

I16

R

402002

1 Timeout_2

I16

R

402003

1 Timeout_3

I16

R

402004

1 Timeout_4

I16

R

402005

1 Timeout_5

I16

R

402006

1 Timeout_6

I16

R

402007

1 Timeout_7

I16

R

402008

1 Timeout_8

I16

R

402009

1 Timeout_9

I16

R

402010

1 Timeout_10

I16

R

402011

1 Timeout_11

I16

R

402012

1 Timeout_12

I16

R

4.1.6.2. Concentration values The “Conc_n” values are long signed integers (32 bit), showing exactly the displayed value (no different rounding) times 1000, i.e. O2 will show “21900” in fresh air, when units are set to “Vol%”. This value may be negative due to sensor drift, if not calibrated.

20

In case of an overflow or underflow or a locked sensor channel the following special numerical values are used: Overflow, measurement value above highest measurable level

+2147483647 = 0x7FFFFFFF

Underflow, measurement value below lowest detectable level

-2147483648 = 0x80000000

Sensor locked (blocking alarm) due to severe conditions until X-am is restarted

+2147483647 = 0x7FFFFFFF

Register # Parameter Name Format R/W (dec) 402201

2 Conc_1

I32

R

402203

2 Conc_2

I32

R

402205

2 Conc_3

I32

R

402207

2 Conc_4

I32

R

402209

2 Conc_5

I32

R

402211

2 Conc_6

I32

R

402213

2 Conc_7

I32

R

402215

2 Conc_8

I32

R

402217

2 Conc_9

I32

R

402219

2 Conc_10

I32

R

402221

2 Conc_11

I32

R

402223

2 Conc_12

I32

R

4.1.6.3. Alarm values The alarm registers are signed integers (16 bit), reflecting the alarm state (cf. 3.2.1.1) of the corresponding measurement value. Register # Parameter Name Format R/W (dec) 402401

1 Alarm_1

I16

R

402402

1 Alarm_2

I16

R

402403

1 Alarm_3

I16

R

402404

1 Alarm_4

I16

R

402405

1 Alarm_5

I16

R

402406

1 Alarm_6

I16

R

402407

1 Alarm_7

I16

R

402408

1 Alarm_8

I16

R 21

402409

1 Alarm_9

I16

R

402410

1 Alarm_10

I16

R

402411

1 Alarm_11

I16

R

402412

1 Alarm_12

I16

R

4.1.6.4. Maximum holder Xzone_n is the device number (between 0 and 15) of the current maximum holder in a closed network configuration.

Register # Parameter Name Format R/W (dec) 402701

1 Xzone_1

I16

R

402702

1 Xzone_2

I16

R

402703

1 Xzone_3

I16

R

402704

1 Xzone_4

I16

R

402705

1 Xzone_5

I16

R

402706

1 Xzone_6

I16

R

402707

1 Xzone_7

I16

R

402708

1 Xzone_8

I16

R

402709

1 Xzone_9

I16

R

402710

1 Xzone_10

I16

R

402711

1 Xzone_11

I16

R

402712

1 Xzone_12

I16

R

4.1.6.5. X-zone device number to corresponding serial number mapping The Register set 403XXX (with XXX = dn * 5 + 1) hold the serial number of the X-zone with device number “dn”. The device number is chosen during initial setup of a closed network group. The main device always gets the number zero. The group devices range from 1 to 15. The serial number of non-assigned group member numbers reads “????????”. This mapping is only available in a closed network configuration and only at the main device with number 0 (register 400024 == 0). At group device N, only the first entry (403001) with the serial number of the main device is available. The serial number is given by 10 ASCII chars like printed on the X-zone starting with four alpha characters, a hyphen, four digits and a terminating zero.

22

403001 5 Main device 0 serial number

10 chars R

403006 5 Group device 1 serial number

10 chars R

403011 5 Group device 2 serial number

10 chars R

403016 5 Group device 3 serial number

10 chars R

403021 5 Group device 4 serial number

10 chars R

403026 5 Group device 5 serial number

10 chars R

403031 5 Group device 6 serial number

10 chars R

403036 5 Group device 7 serial number

10 chars R

403041 5 Group device 8 serial number

10 chars R

403046 5 Group device 9 serial number

10 chars R

403051 5 Group device 10 serial number 10 chars R 403056 5 Group device 11 serial number 10 chars R 403061 5 Group device 12 serial number 10 chars R 403066 5 Group device 13 serial number 10 chars R 403071 5 Group device 14 serial number 10 chars R 403076 5 Group device 15 serial number 10 chars R

4.1.7.

Alarm messages messages summary

The tables described in the following subsections contain alarm states and corresponding unit raised by gas alarms A1 / A2 or by a device error (alarm state 0x5). Device errors will be sorted after gas alarms and show the virtual gas name “Err” with measurement value zero and empty unit string. Note: Different from the local measurement and group maximum values these tables may contain several values for one gas. The tables are available in open and closed networks, however the length of the ID of the alarming Xzone “Alarm_N device id” depends on the network type (cf. 4.1.7.5). In an open network configuration it is the only way to access information from other X-zones. Up to 10 alarms can be read out. The register “alarm count” reflects the number of known alarms at the device, which is connected by Modbus. There may be more alarms, the device doesn’t know. Register # Parameter Name (dec)

Format R/W

404001

1 alarm count

I16

404002

1 alarm summary changed flags I16 Bit 0: set to 1, if there was any change in the table including the concentration values Bit 1: set to 1, if there was a change in the table elsewhere (excluding the concentration values)

R R/W

23

To ensure, that corresponding alarm types, gas concentrations, names, units and IDs are read out, the complete alarm state is saved instantaneously, when the alarm count is read out and the following registers are only updated, if the alarm count is read out again. The bit 0 (LSB) of “alarm summary changed flags” register is set, if there is any change in the alarm table and never reset again. The bit 1 is set if there is any change in the alarm table except the concentration registers. This bit may be used to trigger the transmission of an alarm SMS. The flags are mirrored (read only) in the General Information group of registers, no. 400028. To be sure to get every alarm, use the following sequence - check the alarm summary changed flag in 400028 - if there is a change indicated, reset it to zero by writing zero into 404002 - read out the number of alarm entries in the alarm count register 404001 (this will also freeze the state of the table) - read out the alarm table up to the indicated alarm count or up to 10, whichever is less. - check the alarm summary changed flag in 400028 again - if it is still zero, there was no in between update, ready - if it is set again, repeat from step 1

4.1.7.1. Gas names Gas_n hold the short name of a gas with additional spaces (cf. 4.1.4). How many entries (up to 10) are valid depends on the alarm count previously read from register 404001. Caveat: Do not read register 404001 again in between accessing gas names and measurement values, units, alarms or device identifiers, because every access to register 404001 will update every register in group 404XXX. Register # Parameter Name Format R/W (dec) 404101

2 Gas_1

4 chars

R

404103

2 Gas_2

4 chars

R

404105

2 Gas_3

4 chars

R

404107

2 Gas_4

4 chars

R

404109

2 Gas_5

4 chars

R

404111

2 Gas_6

4 chars

R

404113

2 Gas_7

4 chars

R

404115

2 Gas_8

4 chars

R

404117

2 Gas_9

4 chars

R

404119

2 Gas_10

4 chars

R

4.1.7.2. Concentration values 24

The “Conc_n” values are long signed integers (32 bit), showing exactly the displayed value (no different rounding) times 1000, i.e. O2 will show “21900” in fresh air, when units are set to “Vol%”. This value may be negative due to sensor drift, if not calibrated. In case of an overflow or underflow or a locked sensor channel the following special numerical values are used: Overflow, measurement value above highest measurable level

+2147483647 = 0x7FFFFFFF

Underflow, measurement value below lowest detectable level

-2147483648 = 0x80000000

Sensor locked (blocking alarm) due to severe conditions until X-am is restarted

+2147483647 = 0x7FFFFFFF

How many entries (up to 10) are valid depends on the alarm count previously read from register 404001. Caveat: Do not read register 404001 again in between accessing gas names and measurement values, units, alarms or device identifiers, because every access to register 404001 will update every register in group 404XXX. Register # Parameter Name Format R/W (dec) 404201

2 Conc_1

I32

R

404203

2 Conc_2

I32

R

404205

2 Conc_3

I32

R

404207

2 Conc_4

I32

R

404209

2 Conc_5

I32

R

404211

2 Conc_6

I32

R

404213

2 Conc_7

I32

R

404215

2 Conc_8

I32

R

404217

2 Conc_9

I32

R

404219

2 Conc_10

I32

R

4.1.7.3. Measurement units A gas unit “Unit_n” string is the unit of the associated measurement value. How many entries (up to 10) are valid depends on the alarm count previously read from register 404001. Caveat: Do not read register 404001 again in between accessing gas names and measurement values, units, alarms or device identifiers, because every access to register 404001 will update every register in group 404XXX. Register # Parameter Name Format R/W (dec) 25

404301

3 Unit_1

6 chars

R

404304

3 Unit_2

6 chars

R

404307

3 Unit_3

6 chars

R

404310

3 Unit_4

6 chars

R

404313

3 Unit_5

6 chars

R

404316

3 Unit_6

6 chars

R

404319

3 Unit_7

6 chars

R

404322

3 Unit_8

6 chars

R

404325

3 Unit_9

6 chars

R

404328

3 Unit_10

6 chars

R

4.1.7.4. Alarm values The alarm registers are signed integers (16 bit), reflecting the alarm state (cf. 3.2.1.1) of the corresponding measurement value. How many entries (up to 10) are valid depends on the alarm count previously read from register 404001. Caveat: Do not read register 404001 again in between accessing gas names and measurement values, units, alarms or device identifiers, because every access to register 404001 will update every register in group 404XXX.

Register # Parameter Name Format R/W (dec) 404401

1 Alarm_1

I16

R

404402

1 Alarm_2

I16

R

404403

1 Alarm_3

I16

R

404404

1 Alarm_4

I16

R

404405

1 Alarm_5

I16

R

404406

1 Alarm_6

I16

R

404407

1 Alarm_7

I16

R

404408

1 Alarm_8

I16

R

404409

1 Alarm_9

I16

R

404410

1 Alarm_10

I16

R

4.1.7.5. Alarming device identifier The device id of the alarming device depends on the network configuration.

26

In an open network this table contains the alarming device serial number as a ten char string including a hyphen and terminating zero(i.e. “ARBC-0013”). In a closed network it contains the alarming device id Xzone_n in the range from “00” up to “15” as a two char, zero terminated string. See register group 403XXX for converting a group device id into the corresponding serial number. How many entries (up to 10) are valid depends on the alarm count previously read from register 404001. Caveat: Do not read register 404001 again in between accessing gas names and measurement values, units, alarms or device identifiers, because every access to register 404001 will update every register in group 404XXX. 404501 5 Alarm_1 device id

10 chars R

404506 5 Alarm_2 device id

10 chars R

404511 5 Alarm_3 device id

10 chars R

404516 5 Alarm_4 device id

10 chars R

404521 5 Alarm_5 device id

10 chars R

404526 5 Alarm_6 device id

10 chars R

404531 5 Alarm_7 device id

10 chars R

404536 5 Alarm_8 device id

10 chars R

404541 5 Alarm_9 device id

10 chars R

404546 5 Alarm_10 device id 10 chars R

4.2.

Implementation hints for a GSM based communication and logging

device connected through Modbus First of all there are initial setup actions (read and write), done only once at the beginning and if there is a major configuration change (either on X-com or X-zone site). Some registers must be written regularly, e.g. to show the actual gsm signal strength on the X-am display. This should be done during the writing interval (default 5s). In order to detect an X-zone/X-am configuration change it is important to poll some registers at a regular interval, called detection interval (default 1s). Additionally, several registers need to be polled at this interval to detect events (like an alarm) that trigger the transmission of an SMS or eMail notification. Furthermore, measurement data shall be logged by the X-com. In normal mode (no alarm) measurement values shall be logged at a user definable regular interval (called slow logging interval), selectable between 10s and 3600s. In case of an alarm the system switches to a higher logging rate (called fast logging interval) of 10s fixed. The cloud upload interval is another user definable time interval denoting, how often new parts of the log file get uploaded by mail to the cloud server (or other eMail receivers).

4.2.1.

Initial setup (read and write) 27

On initial setup every register of the “General information” group must be read and logged once. If the X-com is connected to a main device in a “closed network” configuration (if device count in register 400023 is greater zero and device number in register 400024 equals zero), the register group “X-zone device number to corresponding serial number mapping” shall be read and stored (volatile) for later translation between device id and serial number. The register group “Gas name and unit table” can optionally be set according to the sensors available in the system (and their configuration of measurement unit). Currently the system is restricted to use a maximum of eight different gas types in total and six different gas types at the local X-am. The writable “Communication status overview” registers should be initialized to “no connection status”. The writable “Communication status overview” registers should be updated after establishing a connection or if establishing a connection fails. If any value concerning the GSM or GPS connection changes, the changed values must be updated, too.

4.2.2.

Writing interval

During a gsm connection the proper RSSI level should be updated every 5s. Additionally, the gps position should be updated during this interval.

4.2.3.

Detection interval

At a high rate (default 1s) some registers need to be read out to detect - If there is an alarm condition - If some system configuration has changed and a new initial setup must be executed Also the watchdog mechanism may be triggered (see description of register “Communication watchdog”) to generate alarms in case of Modbus communication problems.

4.2.3.1. Alarm condition 400025 1 X-zone local alarm state 400026 1 X-zone net alarm state

Only these two registers need to be read out to fast check the alarm condition. An X-zone local alarm state first time > 0 should trigger a SMS with a content like “X-com [name]: Local Alarm [alarm state] from X-zone [serial number/device id]” (in German: “Mutteralarm”). An X-zone net alarm state first time > 0 should trigger a similar SMS showing a “X-com [name]: Remote Alarm [alarm state]”. Instead of an SMS a suitable eMail notification could be send. The remote user may request further information by sending an “ALARM?” sms to the X-com, which will trigger the transmission of a human readable readout of the “alarm messages summary” register group via SMS or eMail.

28

4.2.3.2. Incoming SMS while using GSM services When connected to a GSM network, a control SMS may be used to control some important system aspects. Incoming SMS should be authenticated by e.g. a four digit PIN number at the beginning of each SMS. Proposed SMS control commands: [pin] STATUS? – send (local and network) status information [pin] ALARM? – send current alarm list (register group “Alarm messages summary”) [pin] LOCAL? – send local measurement information [pin] MAX? – send maximum values (This is the default behavior when receiving any unknown SMS) [pin] EVACUATE – activate the evacuation alert [pin] ACK – acknowledge any acknowledgeable alarm (e.g. switch off the X-zone horn in case of an A1 alarm) [pin] EVACUATE OFF – switch off the evacuation alarm [pin] REMOTE []– switch to transparent Modbus access mode, send back public IP address and port to use for Modbus TCP protocol and start a session to the outside Modbus master, if its public has been given. This is necessary in most networks, if the X-com is behind a NAT. [pin] LOCAL – switch back to standard local mode (X-com is Modbus master and doing the logging).

4.2.3.3. ReRe-initialize condition During the detection interval the following registers needs to be checked to detect any change: 400003 4 X-zone part number 400007 5 X-zone serial number 400012 4 X-am part number 400016 5 X-am serial number 400023 1 Device count 400024 1 Device number 400027 1 Gas update flag

If there is any change in the registers 400003 up to 400024 in the table above, the initial setup has to be executed again, because either the X-zone or X-am unit was swapped or the network configuration (member count or some member) did change. If the “Gas update flag” register 400027 is set, the “Gas name and unit table” has changed and must be re-read using the algorithm explained in the chapter “Gas name and unit table”. This will reset the “Gas update flag”.

4.2.4.

Slow logging interval

29

In addition to the initial one time logging of several constant data during the initial setup and after establishing an online connection, some registers are considered to being useful as a regular log item: Local gas measurement values (Register group 401xxx): Every local measurement for a certain gas consists of several registers found in a position defined by the register group “Gas name and unit table”, set during initial setup. If its timeout value is > 0, the corresponding pairs of gas name, concentration, unit and alarm state go into the log file or database. Group maximum concentrations (Register group 402xxx): Reminder: This log item is only available in a closed network configuration. It is similar to the previous section, but additionally the “current maximum holder” must be logged. This shall be the serial number by translating the two digit device id found as the “current maximum holder” using the previously stored translation table (see initial setup). The following general information registers: These general items should also go into the log database: 400025 1 X-zone local alarm state 400026 1 X-zone net alarm state 400030 2 X-zone error flags 400032 1 X-zone battery voltage (mV) 400033 1 Temperature (units of 1°C) 400036 1 X-am battery voltage (mV)

4.2.5.

Fast logging interval

When detecting a local or net alarm condition (Reg. 400025 or 400026), the system shall switch to the fast logging interval. This is a fixed interval of 10s. The same items as during the slow logging interval outside an alarm shall be logged (see above). Additionally the alarm messages from the register file 404xxx “Alarm messages summary” must be logged as a separate entry in the database or a separate file or otherwise clearly marked. If there is no change in any of the log items, the last log entry may be overwritten (to save space) until the slow logging time interval is reached, when the logging occurs unconditionally.

4.2.6.

Cloud update interval

By this time span is defined, how often the log data gets uploaded to the central server. Whenever a new / different alarm condition is detected, the upload should occur immediately after updating the log database one time with the most recent alarm and measurement information (i.e. after the first fast logging interval expires).

30