Learn about the Community. Join our Core Community to Get Started

Schneider Electric Exchange Community

Discuss and solve problems in energy management and automation. Join conversations and share insights on products and solutions. Co-innovate and collaborate with a global network of peers.

Register Now
Knowledge Base
cancel
Showing results for 
Search instead for 
Did you mean: 

How to read individual bits from a Modbus Holding Register

Issue

How to read individual bits from a Modbus Holding Register that holds a 16-Bit Word and represent each Bit as a separate Digital point in EBO/SBO?

Product Line

EcoStruxure Building Operation

Environment

EBO 2.0, Enterprise Server, AS-P, AS-B, Modbus Integration

Cause

In this case, the Modbus Holding Register is a 16-bit unsigned value that is used by the Modbus device to represent 16 separate digital states. The 16-bit unsigned value is an integer with a range of 0 to 65,535 and needs to be converted into 16 digital values.

Resolution

Use an EBO/SBO Modbus Digital Input point for each bit required. Each object will be configured to read the same Modbus register address, but with a different bitmask value applied prior to evaluating the value

For example: Read Modbus Holding Register 40123 with a value of 32769 (16-bit unsigned) and decode bits 0, 8, and 15 as three separate Digital points

Since the actual Value of 32769 being read at address 40123 is shown in Binary as 1000000000000001 you can see that Bit 0 and Bit 15 should return TRUE while Bit 8 should return FALSE

Configure each point as follows:

  • Modbus Digital Input Point 40123 bit0
  • Register number 123
  • Register type 16 bit unsigned
  • Read function code 03
  • Bit mask - enable only Bit 0

 

  • Modbus Digital Input Point 40123 bit8
  • Register number 123
  • Register type 16 bit unsigned
  • Read function code 03
  • Bit mask - enable only Bit 8

 

  • Modbus Digital Input Point 40123 bit15
  • Register number 123
  • Register type 16 bit unsigned
  • Read function code 03
  • Bit mask - enable only Bit 15

 

Additional information can be found in the EcoStruxure Building Operation - Technical Reference Guide - Chapter 155.4.5 (page 5669) Modbus Point and Value Configuration - Bitmask.

Tags (1)
Labels (1)
No ratings