Sign In Help
Schneider Electric
HelpLogin / Register
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
  • Home
  • Communities
  • :
  • Knowledge Center
  • :
  • Building Automation Knowledge Base
  • :
  • Sigma programmable object bit mask to decode Modbus register
Community Menu
  • Forums
    • By Topic
        • Support
          • Ask the Community
        • EcoStruxure Building
          • SmartConnector Forum
          • Field Devices Forum
        • EcoStruxure Power & Grid
          • Gateways and Energy Servers
          • Metering & Power Quality
        • APC UPS, Critical Power, Cooling and Racks
          • APC UPS Data Center Backup Solutions Forum
          • APC Enterprise Power UPS Forum
          • APC UPS for Home and Office Forum
        • EcoStruxure IT
          • EcoStruxure IT forum
        • Remote Operations
          • EcoStruxure Geo SCADA Expert Forum
          • Remote Operations Forum
        • Industrial Automation
          • Industry Automation and Control Forum
          • Industrial Edge Computing Forum
          • Alliance System Integrators Forum
          • Machine Automation Forum
          • EcoStruxure Automation Expert / IEC 61499 Forum
          • AVEVA Plant SCADA Forum
          • Modicon PAC Forum
          • Harmony Control Customization Forum
          • Level and Pressure Instrumentation Forum
          • PLC Club Indonesia
          • Fabrika ve Makina Otomasyonu Çözümleri
          • Motorabgangstechnik & Antriebstechnik Forum
          • Korea Industrial Automation Forum
        • Schneider Electric Wiser
          • Schneider Electric Wiser Forum
        • Power Distribution IEC
          • Power Distribution and Digital
          • Solutions for Motor Management
          • Paneelbouw & Energie Distributie
          • Eldistribution & Fastighetsautomation
          • Elektrik Tasarım Dağıtım ve Uygulama Çözümleri
          • Електропроектанти България
        • Power Distribution NEMA
          • US Utility Forum
        • Power Distribution Software
          • EcoStruxure Power Design Forum
          • Usuarios de eDesign en España
          • LayoutFAST User Group Forum
        • Solutions for your Business
          • Solutions for Food & Beverage Forum
          • Solutions for Healthcare Forum
    • By Segment
        • Food & Beverage
          • Solutions for Food & Beverage Forum
        • Healthcare
          • Solutions for Healthcare Forum
      • Support
        • Ask the Community
      • EcoStruxure Building
        • SmartConnector Forum
        • Field Devices Forum
      • EcoStruxure Power & Grid
        • Gateways and Energy Servers
        • Metering & Power Quality
      • APC UPS, Critical Power, Cooling and Racks
        • APC UPS Data Center Backup Solutions Forum
        • APC Enterprise Power UPS Forum
        • APC UPS for Home and Office Forum
      • EcoStruxure IT
        • EcoStruxure IT forum
      • Remote Operations
        • EcoStruxure Geo SCADA Expert Forum
        • Remote Operations Forum
      • Industrial Automation
        • Industry Automation and Control Forum
        • Industrial Edge Computing Forum
        • Alliance System Integrators Forum
        • Machine Automation Forum
        • EcoStruxure Automation Expert / IEC 61499 Forum
        • AVEVA Plant SCADA Forum
        • Modicon PAC Forum
        • Harmony Control Customization Forum
        • Level and Pressure Instrumentation Forum
        • PLC Club Indonesia
        • Fabrika ve Makina Otomasyonu Çözümleri
        • Motorabgangstechnik & Antriebstechnik Forum
        • Korea Industrial Automation Forum
      • Schneider Electric Wiser
        • Schneider Electric Wiser Forum
      • Power Distribution IEC
        • Power Distribution and Digital
        • Solutions for Motor Management
        • Paneelbouw & Energie Distributie
        • Eldistribution & Fastighetsautomation
        • Elektrik Tasarım Dağıtım ve Uygulama Çözümleri
        • Електропроектанти България
      • Power Distribution NEMA
        • US Utility Forum
      • Power Distribution Software
        • EcoStruxure Power Design Forum
        • Usuarios de eDesign en España
        • LayoutFAST User Group Forum
      • Solutions for your Business
        • Solutions for Food & Beverage Forum
        • Solutions for Healthcare Forum
      • Food & Beverage
        • Solutions for Food & Beverage Forum
      • Healthcare
        • Solutions for Healthcare Forum
  • Blogs
    • By Topic
        • EcoStruxure Power & Grid
          • Backstage Access Resources
        • Remote Operations
          • Remote Operations Blog
        • Industrial Automation
          • Industry 4.0 Blog
          • Industrie du Futur France
        • Power Distribution NEMA
          • NEMA Power Foundations Blog
        • Solutions for your Business
          • Solutions for Food & Beverage Blog
          • Solutions for Healthcare Blog
          • Solutions for Retail Blog
          • Solutions for eMobility
        • Knowledge Center
          • Geo SCADA Knowledge Base
          • Industrial Automation How-to videos
          • Digital E-books
          • Success Stories Corner
    • By Segment
        • Food & Beverage
          • Solutions for Food & Beverage Blog
        • Healthcare
          • Solutions for Healthcare Blog
        • Retail
          • Solutions for Retail Blog
        • Retail by eMobility
          • Solutions for eMobility
      • EcoStruxure Power & Grid
        • Backstage Access Resources
      • Remote Operations
        • Remote Operations Blog
      • Industrial Automation
        • Industry 4.0 Blog
        • Industrie du Futur France
      • Power Distribution NEMA
        • NEMA Power Foundations Blog
      • Solutions for your Business
        • Solutions for Food & Beverage Blog
        • Solutions for Healthcare Blog
        • Solutions for Retail Blog
        • Solutions for eMobility
      • Knowledge Center
        • Geo SCADA Knowledge Base
        • Industrial Automation How-to videos
        • Digital E-books
        • Success Stories Corner
      • Food & Beverage
        • Solutions for Food & Beverage Blog
      • Healthcare
        • Solutions for Healthcare Blog
      • Retail
        • Solutions for Retail Blog
      • Retail by eMobility
        • Solutions for eMobility
  • Ideas
        • Remote Operations
          • EcoStruxure Geo SCADA Expert Ideas
          • Remote Operations Devices Ideas
        • Industrial Automation
          • Modicon Ideas & new features
        • Power Distribution Software
          • eDesign explorers
  • Knowledge Center
    • Building Automation Knowledge Base
    • Geo SCADA Knowledge Base
    • Industrial Automation How-to videos
    • Digital E-books
    • Success Stories Corner
  • Success Stories
  • Events & Webinars
    • All Events
    • Innovation Talks
    • Innovation Summit
    • Let's Exchange Series
    • Technology Partners
    • Power Events & Webinars 
    • Partner Success
    • Process Automation Talks 
  • Support
    • Ask Exchange
    • Leaderboard
    • Our Community Guidelines
    • Community User Guide
    • How-To & Best Practices
    • More
Register Now
How can we help?
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
79484members
344274posts

Sigma programmable object bit mask to decode Modbus register

Back to Building Automation Knowledge Base
Options
  • Article History
  • Subscribe to RSS Feed
  • Bookmark
  • Subscribe
  • Email to a Friend
  • Printer Friendly Page
  • Report Inappropriate Content
0 Likes
1189 Views
Trying to translate this page to your language?
Select your language from the translate dropdown in the upper right. arrow
Translate to: English
  • (Français) French
  • (Deutsche) German
  • (Italiano) Italian
  • (Português) Portuguese
  • (Русский) Russian
  • (Español) Spanish

Sigma programmable object bit mask to decode Modbus register

Picard Product_Support
‎2018-09-07 08:21 PM

Last Updated: Administrator DavidFisher Administrator ‎2019-05-03 12:44 PM

Issue

How to use bit masking to decode on/off states from a Modbus analogue registers e.g. Holding or Input registers. Where each bit is required to be read individually to indicate the status of a coil.

Product Line

Satchwell Sigma Software

Environment

  • Sigma IC Modbus and IC3 Modbus controllers

Cause

Configuration technique to read 16-bit Modbus registers for on/off states.

Resolution

Each modbus holding or input register is 16 bits, where each bit can be on or off i.e. 0 or 1.

For example the Sigma analogue input value of 901 represents the state of a number of coils where each bit indicates the on or off.  Hence, this translates to the 16-bit binary value  0000001110000101  where 1 = on and 0 = off

  1. Create a Sigma analogue input object to read the Modbus value. Click here for the  Sigma Modbus 4.06 release Note
  2. Create a programmable object for each of the required bits (max of 16 for each register) to be read as below. 

(Highlight, copy and paste into each programmable object).

For Example starting with the Least Significant Bit (LSB) and where point 0|222 is the Modbus value created, the programmable objects are;

Bit 1 (LSB)

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 1 )
30 IF YINT = 1 THEN RETURN TRUE "Bit 1 = on"
40 RETURN FALSE "Bit 1 = off"

Bit 2

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 2 )
30 IF YINT = 2 THEN RETURN TRUE "Bit 2 = on"
40 RETURN FALSE "Bit 2 = off"

Bit 3

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 4 )
30 IF YINT = 4 THEN RETURN TRUE "Bit 3 = on"
40 RETURN FALSE "Bit 3 = off"

Bit 4

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 8 )
30 IF YINT = 8 THEN RETURN TRUE "Bit 4 = on"
40 RETURN FALSE "Bit 4 = off"

Bit 5

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 16 )
30 IF YINT = 16 THEN RETURN TRUE "Bit 5 = on"
40 RETURN FALSE "Bit 5 = off"

Bit 6

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 32 )
30 IF YINT = 32 THEN RETURN TRUE "Bit 6 = on"
40 RETURN FALSE "Bit 6 = off"

Bit 7

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 64 )
30 IF YINT = 64 THEN RETURN TRUE "Bit 7 = on"
40 RETURN FALSE "Bit 7 = off"

Bit 8

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 128 )
30 IF YINT = 128 THEN RETURN TRUE "Bit 8 = on"
40 RETURN FALSE "Bit 8 = off"

Bit 9

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 256 )
30 IF YINT = 256 THEN RETURN TRUE "Bit 9 = on"
40 RETURN FALSE "Bit 9 = off"

Bit 10

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 512 )
30 IF YINT = 512 THEN RETURN TRUE "Bit 10 = on"
40 RETURN FALSE "Bit 10 = off"

Bit 11

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 1024 )
30 IF YINT = 1024 THEN RETURN TRUE "Bit 5 = on"
40 RETURN FALSE "Bit 6 = off"

Bit 12

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 2048 )
30 IF YINT = 2048 THEN RETURN TRUE "Bit 12 = on"
40 RETURN FALSE "Bit 12 = off"

Bit 13

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 4096 )
30 IF YINT = 4096 THEN RETURN TRUE "Bit 13 = on"
40 RETURN FALSE "Bit 13 = off"

Bit 14

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 8292 )
30 IF YINT = 8292 THEN RETURN TRUE "Bit 14 = on"
40 RETURN FALSE "Bit 14 = off"

Bit 15

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 16384 )
30 IF YINT = 16384 THEN RETURN TRUE "Bit 15 = on"
40 RETURN FALSE "Bit 15 = off"

Bit 16 (MSB)

10 XINT = INT POINT 0|222
20 YINT = XINT MASK ( 32768 )
30 IF YINT = 32768 THEN RETURN TRUE "Bit 16 = on"
40 RETURN FALSE "Bit 16 = off"

Labels (1)
Labels:
  • Satchwell BAS & Sigma
Attachments
Tags (2)
  • Find more articles tagged with:
  • 4851
  • DavidChild19
Was this article helpful? Yes No
No ratings

Related Forums

  • Field Devices Forum
Previous Next
Contributors
  • DavidChild
    DavidChild
  • Product_Support
    Product_Support
  • DavidFisher
    DavidFisher
Invite a Colleague
Found this content useful? Share it with a Colleague!
Invite a Colleague
Support

Have a question? Please contact us with details, and we will respond.

Contact Us
FAQ

Look through existing questions to find popular answers.

Learn More
About

Want to know more about Exchange and its possibilities?

Learn More
Subscribing is a smart move!
You can subscribe to this forum after you log in or create your free account..

Create your free account or log in to subscribe to the forum - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account?Login

About FAQ Terms & Conditions Privacy Notice Customize Preferences
© 2021 Schneider Electric