Sensor Interpretation - MODBUS TCP

The MODBUS TCP Interface of the gateway offers the ability to poll sensor data directly on the Ethernet Gateway 4 device. Since the data recorded into the sensor registers is raw data, interpretation has to occur in order to understand it.

Monnit provides a document to accommodate this interpretation. This document is arranged in terms of sensor Application ID. You can identify your sensor Application ID, locate it on the form, and use the interpretation formulas to interpret the raw data from the sensor. You can download the Excel document below.

Download the MODBUS TCP Interpretation document

Navigating the document

The document contains the following tabs:

  • Definitions - Provides the definition of protocol being used.
  • Registers - This tab defines all of the registers that are being used by the gateway, along with the type of value shared as also outlined in the MODBUS TCP article.
  • Sensor Data Interpretation - This tab contains the list of sensor types that are supported by the interface. This is where you will retrieve the information on interpreting the sensor data.
  • Bugs - Any unexpected behaviors are listed here.

Sensor Data Interpretation

The Sensor Data Interpretation section contains the following columns for interpreting the sensor data.

  • Profile - The Application ID of the sensor type.
  • Sensor Name - Displays the type of sensor by name.
  • Data Type - Provides the type of integer that will be integer.
    • u8 - Unsigned 8 bit integer (cannot provide negative values)
    • s8 - Signed 8 bit integer (can provide negative values)
    • u16 - Unsigned 16 bit integer (cannot display negative values)
    • S16 - Signed 16 bit integer (can display negative values)
    • u32 - Unsigned 32 bit integer (cannot display negative values)
    • s32 - Signed 32 bit integer (can display negative numbers)
    • u64 - Unsigned 64 bit integer (cannot display negative numbers)

Note: ⚠The registers in the MODBUS TCP Interface are 16 bits. Therefore, there is not a manner by which a 32 bit number can be displayed without concatenation. This means that you may encounter sensors that have 32 or 64 bit values that are presented across multiple 16 bit registers and require concatenation. When the values are split across registers, they are described as "high" and "low" and have a trailing "_H" for high or "_L" for low to demonstrate the highest and lowest significant bit (example: Pulse Counter 64 bit). Similarly, there are 8 bit values that might be split across the highest four bits of one register and the lowest four bits in the following four bits of the following register (example: Three Phase Current Meter).

  • Data Points Presented - Provides a verbose description of the values represented in the data.
  • Unit - Provides the unit of measurement represented by the data.
  • Interpretation - Provides the formula (where applicable) and Data register referenced (used to process the raw data to calculate the value per Unit.
  • Concatenation - Provides an example of how to concatenate values that are shared across multiple registers where applicable.

Example

In the example below, we see a Resistance Sensor with Application ID 70. The resistance value is natively provided as a 32 bit number that represents Ohms. Therefore, the raw data is split across two 16 bit registers in Data 0 and Data 1 registers to represent the Resistance_L and Resistance_H values in Data 0 and Data 1 (Data 2-7 are not used).

Polling the appropriate Sensor Registers returns data on Data0 and Data1.

  • Data0 = 12766 (when polling Data0, you see this value)
  • Data1 = 16 (when polling Data1, you see this value)

We will then convert the individual numbers to hexadecimal and push them together.

16 = 0x0010 (in hexadecimal)

12766 = 0x31DE (in hexadecimal)

Concatenate: [16]+[12766]

*Convert to hexadecimal*: [0x0010]+[0x31DE] = 0x001031DE

You can see how we concatenated (pushed together) the two hexadecimal values after converting to arrive at the hexadecimal value 0x001031DE.

*Convert to decimal* 0x001031DE = 1,061,342

We now have the final value 1,061,342 to apply the formula to arrive at the final value reported for the Unit.

Apply Formula: 1,061,342 / 10 = 106,134.2

Apply the Unit to the converted value.

Resistance = 106,134.2 Ω


Profile Sensor Name Data Type Data Points Presented Unit Interpretation Concatenation
70 Resistance u32 Resistance Ohms (Ω)

Data produced by the sensor is in u32 format. 2 Registers are needed to contain this value. Concatenate the Registers in order to reconstruct the full value.


Formula: Divide by 10 for 1 decimal point resolution

Example: 2,471,234 / 10 = 247,123.4 Ω

Range: 0 to 250,000.0 Ω


Data0 = Resistance_L Data1 = Resistance_H Data2 - Data7 = NA

Resistance = [Data1]+[Data0]


Example

Data0 = 12766 Data1 = 16 Concatenate:     [16]+[12766]   *Convert to hexadecimal*                                 [0x0010]+[0x31DE] = 0x001031DE *Convert to decimal*                                 0x001031DE = 1,061,342 Apply Formula: 1,061,342 / 10 = 106,134.2

Resistance = 106,134.2 Ω


Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.