Usm Modbus Rtu
Usm Modbus Rtu
Usm Modbus Rtu
[ ]
SFIDK.PS.023.D2.02 - A5E00253376
Modbus RTU RS-485
3. Installation ...................................................................................................................... 6
3.1 Add-on module .............................................................................................................. 6
3.2 General electrical information ........................................................................................ 7
3.3 USM II connections ........................................................................................................ 7
3.4 RS-485 termination ........................................................................................................ 7
3.4.1 RS-485 cabling .............................................................................................................. 7
4. Commissioning .............................................................................................................. 8
4.1 Effect of changing Modbus communication settings ..................................................... 8
4.2 Modbus RTU display menu ........................................................................................... 9
4.3 Menu item explanation ................................................................................................ 10
2 SFIDK.PS.023.D2.02
Modbus RTU RS-485 1. Introduction
1. Introduction This manual is intended to provide instructions for the installation and use of the Modbus RTU
add-on module, product code number FDK:085U0234, that can be used in the Siemens Flow
Instruments USM II family of transmitters, which presently includes MAG 6000 and MASS 6000.
The Modbus RTU module is effectively a gateway through which a Modbus RTU master device
can have controlled access to a number of Siemens Flow Instruments USM II signal converter
parameters.
This manual is not intended to be a complete tutorial on the Modbus RTU protocol, and it is
assumed the end user already has a general working knowledge of Modbus RTU communica-
tions, especially in respect of master station configuration and operation. However an overview
is included in the following section to explain some of the fundamental aspects of the protocol.
SFIDK.PS.023.D2.02 3
Modbus RTU RS-485 2. Technical data
4 SFIDK.PS.023.D2.02
Modbus RTU RS-485 2. Technical data
2.1 General Modbus RTU The module complies with the Modbus serial line protocol [Reference 1].
Among other things this implies a master-slave protocol at level 2 of the OSI model. One node
(the master) issues explicit commands to one of the „slave“-nodes and processes responses.
Slave nodes will not transmit data without a request from the master node, and do not
communicate with other slaves.
Modbus is a mono master system, which means that only one master can be connected at the
time.
Two modes of communication are possible, Unicast and Broadcast. Unicast mode is where the
master sends a request to one slave device, and waits a specified time for a response. In
Broadcast mode the master sends out a request to address „0“, which means that the information
is for all slave devices on the network. In Broadcast mode there are no response from the slave
devices.
The Modbus frame is shown below, and is valid for both requests and responses.
SFIDK.PS.023.D2.02 5
Modbus RTU RS-485 3. Installation
3. Installation The installation procedure for an add-on module to a Siemens Flow Instruments USM II
transmitter is as follows:
3.1 Add-on module
1. Unpack the add-on module and
19” rack mounted versions IP 67 compact versions
insert it in the bottom of the signal
converter as shown.
6 SFIDK.PS.023.D2.02
Modbus RTU RS-485 3. Installation
3.2 General electrical On the electrical termination boards for USM II transmitters, additional input/output terminals have
information been reserved for add-on module functions. The numbering range of these terminals is as follows,
but how many are actually used depends on the type of add-on module. Please refer to the
relevant handbook for other electrical connection information.
Note
The standard inputs and outputs continue to function and are not affected by the presence of an
add-on module. It is however not possible to install this module in a MASS 6000 with extra outputs.
If a Current Out 2 is present, the MASS 6000 has extra outputs installed.
3.3 USM II connections The following table shows the connection layout for the USM II Modbus RTU module:
3.4 RS-485 termination All RS-485 based networks must be terminated correct to function properly. A termination must
be placed at each end of the segment.
The Modbus RTU module can add a termination by connecting terminals 91 to 92 and 93 to 94.
It is important to use very short wires for this connection.
3.4.1 RS-485 cabling To ensure error free operation, a good quality cable meeting the RS-485 specifications, must be
used.
SFIDK.PS.023.D2.02 7
Modbus RTU RS-485 4. Commissioning
4. Commissioning Before communicating with the master, baudrate, node ID and update rate must be selected. This
can be done from the display. Please look in to the transmitter manual to locate the Modbus RTU
menu.
4.1 Effect of changing Changing baudrate or framing has effect on the communication as follows:
Modbus communica-
• When changed from the menusystem, new settings have effect immediately.
tion settings
(Same effect as writing to the „ResetCommunication“ coil).
• When changed from the Modbus master, the new settings only have effect after a reset
(PowerUp) of the module - or after writing to the „ResetCommunication“ coil.
In both cases the new settings will not have effect until the Modbus driver has responded to any
ongoing Modbus request.
Note
It is recommended NOT to use the default address in a multi-slave network.
It is of great importance to ensure at the time of the procedure of device addressing, that there
is not two devices with the same address. In such a case, an abnormal behaviour of the whole
serial bus can occur, the master being then in the impossibility to communicate with all present
slaves on the bus.
8 SFIDK.PS.023.D2.02
Modbus RTU RS-485 4. Commissioning
To change (or view) the Modbus RTU settings from the keypad display.
1. Press [Top key] for two seconds. (Note: For “View” mode only, skip steps 2 & 3).
2. Type in password (1000) by pressing [Change key] two times, and then press
[Lock key] and hold for two seconds
3. The display now says “Basic settings”
4. Press [Forward key] until you reach the “Modbus RTU module” menu item
5. Press [Lock key]
6. You can now cycle through all the Modbus RTU settings by pressing [Forward key]
7. Press [Top key] for two seconds and you return to 1.
SFIDK.PS.023.D2.02 9
Modbus RTU RS-485 4. Commissioning
The settings are all stored in the non-volatile memory of the SENSORPROM unit, and therefore
remembered after a power down. Even if the module or transmitter is replaced the settings are
kept.
If the SENSORPROM unit is NOT used, then the settings are stored in the transmitters memory.
These settings will however be overruled if the SENSORPROM unit is used again.
10 SFIDK.PS.023.D2.02
Modbus RTU RS-485 5. Modbus addressing model
5. Modbus addressing The module allows R/W access to the following standard Modbus data register blocks:
model • Coils (ref. 0x address range)
• Holding registers (ref. 4x address range)
I.e. the module will not support the other standard data register blocks:
• „Discrete input“ (ref. 1x address range)
• „Input registers“ (ref. 3x address range)
5.1 Modbus function codes This device supports following function codes: 1, 3, 5, 16 and 17.
Function code 1 and 5 are used for accessing coils. 3 and 16 are used for accessing registers.
Function code 17 (report slave ID) will return a structure of identification information of the device.
Below the different function code exceptions are described.
SFIDK.PS.023.D2.02 11
Modbus RTU RS-485 5. Modbus addressing model
Generally writing stops when the first exception occurs. When writing multiple registers, writing
starts with the register with the lowest address - and continues until an exception occurs - or until
all registers are updated.
12 SFIDK.PS.023.D2.02
Modbus RTU RS-485 6. Modbus holding registers
6. Modbus holding In the following the holding registers for the USM II Modbus RTU module are described.
registers
Figure: 0
Holding registers memory map 500
Comm. settings
600
Info/status
700
2000
Application settings
3300
10000
Min. values
20000
Max. values
30000
65535
The minimum value of a writable „holding register“ value can be read by adding 10000 to the
address of the value.
The maximum value of a writable „holding register“ value can be read by adding 20000 to the
address of the value.
Where the value is not directly applicable, the min./max. limit shown will be based on the data
type - e.g. a „WORD-type“ value will show the limits 0-65535 - even though some of these values
are not allowed.
Min./max. values do not apply to all datatypes (e.g. strings). Reading min./max. value for such
„holding registers“ will return zero-values.
SFIDK.PS.023.D2.02 13
Modbus RTU RS-485 6. Modbus holding registers
MASS
Modbus Modbus No. of Data Read/
Description
register address bytes type write
4:03001 3000 4 Float Absolute Massflow (kg/s) R
4:03003 3002 4 Float Absolute Volumeflow (m3/s) R
4:03005 3004 4 Float Absolute Density (kg/m3) R
4:03007 3006 4 Float Sensor temperature (°C) R
4:03009 3008 4 Float Fraction A (kg/s) R
4:03011 3010 4 Float Fraction B (kg/s) R
4:03013 3012 4 Float % fraction A (%) R
4:03015 3014 8 Double Totalizer 1 (kg or m3) R
4:03019 3018 8 Double Totalizer 2/Batch (kg or m3) R
4:03023 3022 4 Float Totalizer 1 (kg or m3) R
4:03025 3024 4 Float Totalizer 2/Batch (kg or m3) R
4:03100 3099 2 Byte Update rate set:
0 = Reserved
1 = All process data updated
with 2 Hz R/W
2 = Like set 1, but with
Massflow 10 Hz
3 = Like set 2, but with
Totalizers 5 Hz
14 SFIDK.PS.023.D2.02
Modbus RTU RS-485 6. Modbus holding registers
TAG
Modbus Modbus No. of Data Read/
Description
register address bytes type write
4:00641 640 18 String TAG R/W
SFIDK.PS.023.D2.02 15
Modbus RTU RS-485 6. Modbus holding registers
MASS 6000
Modbus Modbus No. of Data Read/
Description
register address bytes type write
4:02001 2000 2 Byte Flow direction:
0 = Negative R/W
1 = Positive
4:02002 2001 4 Float Massflow max. (kg/s) R/W
4:02004 2003 4 Float Volumeflow max. (m3/s) R/W
4:02010 2009 4 Float Density min. (kg/m3) R/W
4:02012 2011 4 Float Density max. (kg/m3) R/W
4:02014 2013 4 Float Sensor temperature min. (°C) R/W
4:02016 2015 4 Float Sensor temperature max. (°C) R/W
4:02018 2017 4 Float Fraction A max. (kg/s) R/W
4:02020 2019 4 Float Fraction B max. (kg/s) R/W
4:02022 2021 4 Float % fraction A min. (1/100 %)
R/W
e.g. value 0.05 = 5 %
4:02024 2023 4 Float % fraction A max. (1/100 %)
R/W
e.g. value 0.8 = 80 %
4:02026 2025 4 Float Low flow cut off: (1/100 %)
R/W
e.g. value = 0,02 = 2 %
4:02028 2027 4 Float Empty pipe limit (kg/m3) R/W
4:02030 2029 2 Byte Empty pipe on/off:
0 = Off R/W
1 = On
4:02031 2030 2 Byte Noise filter:
1 = min.
2
R/W
3
4
5 = max.
4:02032 2031 2 Byte Error level:
1 = Warning
R/W
2 = Permanent
3 = Fatal
4:02033 2032 2 Byte Zero adjust mode:
0 = Auto R/W
1 = Manual
4:02034 2033 4 Float Manual zero adjust (kg/s) R/W
4:02036 2035 2 Word Zero adjust time (s) R/W
4:02037 2036 4 Float Zero sigma (kg/s) R
4:02039 2038 4 Float Zero sigma limit (kg/s) R/W
16 SFIDK.PS.023.D2.02
Modbus RTU RS-485 6. Modbus holding registers
MASS 6000
Modbus Modbus No. of Data Read/
Description
register address bytes type write
4:02101 2100 2 Byte Totalizer 1 selection:
1 = Massflow
2 = Fraction A R/W
3 = Fraction B
4 = Volumeflow
4:02102 2101 2 Byte Totalizer 1 direction:
0 = Reverse
R/W
1 = Forward
2 = Net
4:02103 2102 2 Byte Totalizer 2 selection:
1 = Massflow
2 = Fraction A R/W
3 = Fraction B
4 = Volumeflow
4:02104 2103 2 Byte Totalizer 2 direction:
0 = Reverse
R/W
1 = Forward
2 = Net
SFIDK.PS.023.D2.02 17
Modbus RTU RS-485 6. Modbus holding registers
18 SFIDK.PS.023.D2.02
Modbus RTU RS-485 6. Modbus holding registers
SFIDK.PS.023.D2.02 19
Modbus RTU RS-485 6. Modbus holding registers
20 SFIDK.PS.023.D2.02
Modbus RTU RS-485 6. Modbus holding registers
MASS 6000
Modbus Modbus No. of Data Read/
Description
register address bytes type write
4:02301 2300 2 Byte Input selection:
0 = Off
1 = Start Batch
2 = Hold/Continue
3 = Stop Batch R/W
4 = Zero Adjust
5 = Totalizer reset
6 = Force output
7 = Freeze output
4:02302 2301 2 Byte Totalizer reset:
0 = Totalizer 1
R/W
1 = Totalizer 2
2 = Totalizer 1 + 2
4: 02303 2302 4 Float Force output (1/100%) R/W
MASS 6000
Modbus Modbus No. of Data Read/
Description
register address bytes type write
4:02401 2400 4 Float Sensor size (m) R/W
4:02403 2402 4 Float Calibration factor (us2/kg) R/W
4:02405 2404 4 Float Correction factor R/W
4:02407 2406 4 Float Sensor TC (1/100% / °C) R/W
4:02409 2408 4 Float Density parm. A (kg/m3) R/W
4:02411 2410 4 Float Density parm. B (*10E6) R/W
4:02413 2412 4 Float Density TC (1/100% / °C) R/W
4:02415 2414 4 Float Density offset (kg/m3) R/W
4:02417 2416 4 Float Density factor R/W
4:02419 2418 4 Float Table slope (kg/s) R/W
4:02422 2421 4 Float Fraction offset (kg/s) R/W
SFIDK.PS.023.D2.02 21
Modbus RTU RS-485 6. Modbus holding registers
MASS 6000
Modbus Modbus No. of Data Read/
Description
register address bytes type write
4:02501 2500 20 String Converter type R
4:02511 2510 20 String Converter code no. R
4:02521 2520 20 String Converter serial no. R
4:02531 2530 20 String Converter SW version R
4:02541 2540 20 String Sensor type R
4:02551 2550 20 String Sensor code no. R
4:02561 2560 20 String Sensor serial no. R
4:02571 2570 20 String Sensor size R
4:02581 2580 20 String Customer code no. R
MASS 6000
Modbus Modbus No. of Data Read/
Description
register address bytes type write
4:02701 2700 4 Double word Operating time (s) R
4:02703 2702 54 Byte array USM II Error pending list
R
See appendix B
4:02730 2729 54 Byte array USM II Error log list
R
See appendix B
4:02757 2756 4 Float Driver signal (A) R
4:02759 2758 4 Float Pickup 1 amplitude (V) R
4:02761 2760 4 Float Pickup 2 amplitude (V) R
4:02763 2762 4 Float Sensor frequency (Hz) R
22 SFIDK.PS.023.D2.02
Modbus RTU RS-485 6. Modbus holding registers
SFIDK.PS.023.D2.02 23
Modbus RTU RS-485 6. Modbus holding registers
24 SFIDK.PS.023.D2.02
Modbus RTU RS-485 6. Modbus holding registers
SFIDK.PS.023.D2.02 25
Modbus RTU RS-485 7. Modbus coils
7. Modbus coils In the following the coils for the USM II Modbus RTU module are described.
Figure: 0
Control/status
Memory map for coils 20
655535
26 SFIDK.PS.023.D2.02
Modbus RTU RS-485 APPENDIX A & B
Note
°C for temperature is not strictly speaking an SI unit. This should be K (Kelvin), but K is of little
practical significance to most users, hence the use of C (Celsius).
APPENDIX B Reading Modbus address 2702 (USM II Error Pending list) and Modbus address 2729
(USM II Error Log list) provides detailed error information of the flowmeter.
USM II Error Pending and The Error Pending list contains all actual errors and the Error Log list provides information
Error Log of all previous errors. Both lists are structured as 9 error records, each consisting of 6 bytes.
New errors will be placed first on the list (Error 1) and the rest will be shifted down the list.
Error list
Error No.: A list of all error numbers can be found in the MAG/MASS manuals. No error is
represented by 0x7F.
Category: 0: Information
1: Warning
2: Permanent
3: Fatal
Timestamp: Timestamp represents the time in minutes since the error occurred.
17,21,17,40,0,8,17,46,17,c0,0,8,7f,7f,ff,0,0,0,7f,7f,ff,0,0,0,7f,7f,ff,0,0,0,7f,7f,ff,0,0,0,7f,7f,ff,0,0,0,
7f,7f,ff,0,0,0,7f,7f,ff,0,0,0
Note
7f,7f,ff,0,0,0 means no error.
SFIDK.PS.023.D2.02 27
Modbus RTU RS-485 APPENDIX C
Example:
Read Hold Totalizer 1 (0:00011)
Query: 1,1,0,10,0,1,221,200
Response: 1,1,1,0,81,136
Examples
Read absolute mass flow (4:03001)
Query: 1,3,11,184,0,2,70,10
Response: 1,3,4,64,195,82,139,98,200
Absolute mass flow = 6.10383 kg/sec.
28 SFIDK.PS.023.D2.02
Modbus RTU RS-485 APPENDIX C
Examples
Coil 0 (Restart Modbus communication)
To activate a new baudrate and parity/framing the coil 0 (restart Modbus communication)
must be send. Otherwise a power down/up initiate a new baudrate and parity/framing:
Examples
Set baud rate to 115200 baud
Query: 1,16,2,17,0,1,2,0,8,135,23 (115200 = value 8)
Receive: 1,16,2,17,0,1,80,116
To activate a new baudrate and parity/framing the coil 0 (Restart Modbus communication)
must be send.
Otherwise a power down/up initiate a new baudrate and parity/framing:
Query: 1,5,0,0,255,0,140,58 (Set coil 0 to 0xFF00)
Receive: 1,5,0,0,255,0,140,58 (Restart Modbus communication)
SFIDK.PS.023.D2.02 29
Modbus RTU RS-485 APPENDIX C
Response
Slave address 1 byte
Function 1 byte 17 (0x11)
Byte count 1 byte 52 (0x34)
Slave ID 1 byte 0x2a = Siemens
Run indicator 1 byte 0 = Off, 0xFF = Running
Product code 1 byte 24 = MAG 6000, 25 = MASS 6000
Transmitter Code No. 9 bytes e.g. „083H0222“
Capability bits 3 bytes 0x01, 0xFF, 0x00
Manufacturer name 12 bytes „Siemens“
Product name 18 bytes „MAG 6000“ or „MASS 6000“
Flowmeter major rev. 1 byte e.g. 2
Flowmeter minor rev. 1 byte e.g. 1
Modbus module name 11 bytes „Modbus RTU“
Modbus major rev. 1 byte e.g. 1
Modbus minor rev. 1 byte e.g. 0
CRC 2 bytes
Examples
Address = 1
Function code = 17
Byte Count = 55
Slave ID = 0x2A
Run Indicator = 0xFF
Product Code = 25 (0x19)
Transmitter Code No. = 083H0222
Capability bits = 0x01, 0xFF, 0x00
Manufacturer name = Siemens
Product name = MASS 6000
Product major rev. = 2
Product minor rev. = 1
Modbus module name = Modbus RTU
Modbus module No. = 0xFF
Modbus module major rev. = 1
Modbus module minor rev. = 2
CRC LO = 0x3f
CRC HI = 0x98
30 SFIDK.PS.023.D2.02
Modbus RTU RS-485 APPENDIX D
APPENDIX D The Cyclical Redundancy Checking (CRC) field is two bytes, containing a 16-bit binary value.
The CRC value is first generated by the transmitting device, which appends the CRC to the
CRC calculation message. The device that receives recalculates a CRC during receipt of the message, and
compares the calculated value to the actual value it received in the CRC field. If the two values
are not equal, an error results.
There are many ways of calculating a CRC checksum. To ensure correct calculation, please refer
to [Reference 1] Modbus over serial line, where detailed descriptions and programming
examples are available. Even more information and programming examples in different pro-
gramming languages can be found on: www.modbus.org searching for CRC.
Below is a short text description of how the CRC is calculated. This description is then followed
by a C programming example.
CRC calculation:
1. Load a 16-bit register with FFFF hex (all 1’s). Call this the CRC register.
2. Exclusive OR the first 8-bit byte of the message with the low-order byte of the 16-bit CRC
register, putting the result in the CRC register.
3. Shift the CRC register one bit to the right (toward the LSB), zero-filling the MSB. Extract and
examine the LSB.
4. (If the LSB was 0): Repeat step 3 (another shift).
(If the LSB was 1): Exclusive OR the CRC register with the polynomial value 0xA001 (1010
0000 0000 0001).
5. Repeat steps 3 and 4 until 8 shifts have been performed. When this is done, a complete 8-
bit byte will have been processed.
6. Repeat steps 2 through 5 for the next 8-bit byte of the message. Continue doing this until all
bytes have been processed.
7. The final content of the CRC register is the CRC value.
8. When the CRC is placed into the message, its upper and lower bytes must be swapped as
described below.
Data
Addr Func Data n Data n + 1 Data n + 2 Data n + x CRC LO CRC HI
Count
0x41 0x12
SFIDK.PS.023.D2.02 31
Modbus RTU RS-485 APPENDIX D
C programming example
/* Table of CRC values for high-order byte */
static __flash unsigned char auchCRCHi[] = {
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01,
0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81,
0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01,
0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01,
0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01,
0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40
};
unsigned short int CRC16(unsigned char *puchMsg, unsigned short int usDataLen)
{
unsigned char uchCRCHi = 0xFF; /* high byte of CRC initialized */
unsigned char uchCRCLo = 0xFF; /* low byte of CRC initialized */
unsigned uIndex ; /* will index into CRC lookup table */
while(usDataLen—) /* pass through message buffer */
{
uIndex = uchCRCHi ^ *puchMsg++ ; /* calculate the CRC */
uchCRCHi = uchCRCLo ^ auchCRCHi[uIndex] ;
uchCRCLo = auchCRCLo[uIndex] ;
}
#ifdef INTEL_LIKE_PROCESSOR
return (unsigned short int)((uchCRCLo << 8) | uchCRCHi);
#else
return (unsigned short int)((uchCRCHi << 8) | uchCRCLo);
#endif
}
32 SFIDK.PS.023.D2.02
Modbus RTU RS-485 APPENDIX E & F
APPENDIX E The Modbus module uses the following Modbus exception codes, when responding to a master
module:
Exception codes
Exception code (Dec) Exception name
01 Illegal function
02 Illegal data address
03 Illegal data value
04 Slave device failure
06 Device busy
If an exception code 04 is received, further requests have to be done to narrow down the exact
problem.
If any doubts about the address that failed, „Last Coil/HoldReg ErrorAddr“ can be read. This will
return the faulty address.
Reading „Last Coil/HoldReg ErrorNo“ will return a detailed error reason. A list of error numbers
can be seen below.
Error Error
Number Number Error name Reason
(Dec) (Hex)
3 3 Write access denied This parameter is in a state where it is
not writable
4 4 Max. limit The value was greater than the allowed
maximum value
5 5 Min. limit The value was less than the allowed
minimum value
127 7F No error No problem
APPENDIX F The Run Indicator indicates the state of the device. Two states are possible: ON (0xFF) and OFF
(0x00). The device will be in state ON, unless a serious error is present.
Run Indicator
The following errors can turn the state to OFF:
• When a „Fatal Error“ is active on the „Error Pending List“
• Boot up problems when powering up the flowmeter.
• If no measurement are delivered or the time between them is too high.
SFIDK.PS.023.D2.02 33
Modbus RTU RS-485 APPENDIX G
Volumeflow units
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
m3/s ml/s L/s hl/s kl/s Ml/s m3/s m3/s ft3/s in3/s USGPS USMGPS UKGPS UKMGPS USkGPS UKkGPS
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
m3/min ml/min L/min hl/min kl/min Ml/min m3/min m3/min ft3/min in3/min USGPM USMGPM UKGPM UKMGPM USkGPM UKkGPM
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
m3/h ml/h L/h hl/h kl/h Ml/h m3/h m3/h ft3/h in3/h USGPH USMGPH UKGPH UKMGPH USkGPH UKkGPH
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
m3/d ml/d L/d hl/d kl/d Ml/d m3/d m3/d ft3/d in3/d USGPD USMGPD UKGPD UKMGPD USkGPD UKkGPD
64 - 255: Reserved
Massflow unit
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
kg/s ton/s lb/s mg/s g/s kg/s kg/s kg/s kg/s kg/s kg/s kg/s kg/s kg/s kg/s kg/s
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
kg/min ton/min lb/min mg/min g/min kg/min kg/min kg/min kg/min kg/min kg/min kg/min kg/min kg/min kg/min kg/min
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
kg/h ton/h lb/h mg/h g/h kg/h kg/h kg/h kg/h kg/h kg/h kg/h kg/h kg/h kg/h kg/h
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
kg/d ton/d lb/d mg/d g/d kg/d kg/d kg/d kg/d kg/d kg/d kg/d kg/d kg/d kg/d kg/d
64 - 255: Reserved
Density unit
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
kg/m3 ton/m3 Lb/m3 mg/m3 g/m3 kg/ m3 kg/ m3 kg/ m3 kg/ m3 kg/ m3 kg/ m3 kg/ m3 kg/ m3 kg/ m3 kg/ m3 kg/ m3
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
kg/ft3 ton/ft3 lb/ft3 mg/ft3 g/ft3 kg/ft3 kg/ft3 kg/ft3 kg/ ft3 kg/ ft3 kg/ ft3 kg/ ft3 kg/ ft3 kg/ ft3 kg/ ft3 kg/ ft3
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
kg/in3 ton/in3 lb/ in3 mg/ in3 g/ in3 kg/ in3 kg/ in3 kg/ in3 kg/ in3 kg/ in3 kg/ in3 kg/ in3 kg/ in3 kg/ in3 kg/ in3 kg/ in3
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
kg/cm3 ton/cm3 lb/cm3 mg/cm3 g/cm3 kg/cm3 kg/cm3 kg/cm3 kg/cm3 kg/cm3 kg/cm3 kg/cm3 kg/cm3 kg/cm3 kg/cm3 kg/cm3
64 - 255: Reserved
16 - 254: Reserved
0 1 2 3 4
kg ton lb Mg G
5 - 255: Reserved
Point position
0 = no digits after the decimal point
1 = one digit after the decimal point
2 = two digits after the decimal point
3 = three digits after the decimal point
4 = four digits after the decimal point
5 = five digits after the decimal point
6 = six digits after the decimal point
7 - 255: Reserved
34 SFIDK.PS.023.D2.02
Modbus RTU RS-485 APPENDIX H
APPENDIX H Stuffing of multi-byte numbers into multiple Modbus RTU registers differs among Modbus
devises.
Float Definition „Big Endian“ and „Little Endian“ describe the order or sequence in which multi-byte data is stored
in memory. This device uses (as IEEE and Honeywell) a ‘Big-Endian’ representation for
addresses and data items. This means that when a numerical quantity larger than a single byte
is transmitted, the MOST significant byte is sent first.
SFIDK.PS.023.D2.02 35
We have checked the contents of this manual for agreement with the hardware and The reproduction, transmission or use of this document or its contents is not permitted without
software described. Since deviations cannot be precluded entirely, we cannot guarantee express written authority.
full agreement. However, the data in this manual are reviewed regularly and any Offenders will be liable for damages. All rights, including rights created by patent grant or
necessary corrections included in subsequent editions. Suggestions for improvement registration of a utility model or design, are reserved.
are always welcomed.
Technical data subject to change without prior notice. Copyright © Siemens AG 01.2004 All Rights Reserved