# Modbus Driver - Bit Level Writes to Registers

**URL:** <https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331>\
**Category:** Ignition\
**Created:** [November 10, 2010, 8:41pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331 "2010-11-10T20:41:40Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bolewski](https://avatars.discourse-cdn.com/v4/letter/b/e0b2c6/32.png) [@bolewski](https://forum.inductiveautomation.com/u/bolewski)\
**Post date:** [November 10, 2010, 8:41pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/1 "2010-11-10T20:41:40Z")

</div>

Would it be possible to add bit level writing to Register Memory? I believe the Modbus function call 22 would easily support this feature. We are looking at a “forklift” upgrade of an HMI package that has this capability in it today.

Adding this would allow for a very clean exchange of the existing HMI with Ignition. I think this enhancement would make the driver more flexible for others as well. In our case, it would keep us from having to modify the PLC code already existing in many PLC systems.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 10, 2010, 9:08pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/2 "2010-11-10T21:08:33Z")

</div>

You can already achieve this with a relatively simple scripting call, essentially doing the same thing the function code 22 does.

See [this post for an example of the script.](http://inductiveautomation.com/forum/viewtopic.php?p=14351#p14351)

You could expand further on that to provide function parameters for your own AND and OR masks if you’d prefer.

---

<div class="post-metadata">

**Author:** ![bolewski](https://avatars.discourse-cdn.com/v4/letter/b/e0b2c6/32.png) [@bolewski](https://forum.inductiveautomation.com/u/bolewski)\
**Post date:** [November 10, 2010, 10:16pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/3 "2010-11-10T22:16:07Z")

</div>

When tags are defined in the system as boolean and then reference a given bit in PLC, the system provides for easy status reading of these bits. I’m not sure I follow the logic for keeping the ability to write the bits in a register out of the driver.

Competitor products (three of them) have register bit level read/write capability built into their driver. If I was trying to create a work around for a few points, I would agree this scripting is a possible work around. I think scripting for each “bit” level write is adding unnecessary overhead to the system.

How would you suggest keeping a corelation between a tag to read the bit (boolean)and the tag holding the bit to write (int4)?

I really think this functionality belongs in the driver. At least it would be much more intuitive to have it there. The tag would be entered into the system and reference the memory space where it resides in the PLC. You then read and write you boolean tag.

When porting an existing HMI/PLC system to Ignition, working with exporting and importing tags from an existing system to Ignition. It would be so much more straight forward to define the boolean tags and import them to ignition and use them to read from AND write to.

I would love to understand the technical issue for adding this to the Modbus Driver and why the bushback when other products are doing this already.

---

<div class="post-metadata">

**Author:** ![bryan\_cook](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@bryan\_cook](https://forum.inductiveautomation.com/u/bryan_cook)\
**Post date:** [November 10, 2010, 10:59pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/4 "2010-11-10T22:59:31Z")

</div>

Thinking out loud … can you use the scripts Kevin provided within a SQLTag’s expression? If so, it’d allow you to create one tag per bit …

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 10, 2010, 11:42pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/5 "2010-11-10T23:42:41Z")

</div>

Ok I’m looking into this further… stand by 🙂

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 10, 2010, 11:59pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/6 "2010-11-10T23:59:51Z")

</div>

Ok this has officially been added as a feature request. I can’t promise a date for completion though.

---

<div class="post-metadata">

**Author:** ![bolewski](https://avatars.discourse-cdn.com/v4/letter/b/e0b2c6/32.png) [@bolewski](https://forum.inductiveautomation.com/u/bolewski)\
**Post date:** [December 23, 2010, 3:17am UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/7 "2010-12-23T03:17:57Z")

</div>

Any Idea on when this will be added yet since it missed this last release?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [December 30, 2010, 6:52pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/8 "2010-12-30T18:52:31Z")

</div>

It should appear in the 7.2 timeframe.

---

<div class="post-metadata">

**Author:** ![bolewski](https://avatars.discourse-cdn.com/v4/letter/b/e0b2c6/32.png) [@bolewski](https://forum.inductiveautomation.com/u/bolewski)\
**Post date:** [February 1, 2011, 11:37pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/9 "2011-02-01T23:37:20Z")

</div>

Do you have a new estimate now on when this will be rolled out?

---

<div class="post-metadata">

**Author:** ![PeterThornton](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@PeterThornton](https://forum.inductiveautomation.com/u/PeterThornton)\
**Post date:** [February 16, 2011, 4:04pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/10 "2011-02-16T16:04:16Z")

</div>

We would be also interested in hearing if there is a firm date for the implementation of this functionality.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 16, 2011, 6:11pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/11 "2011-02-16T18:11:52Z")

</div>

It’s coming, I can’t promise any dates but I’m hoping that by April it will be done.

---

<div class="post-metadata">

**Author:** ![bolewski](https://avatars.discourse-cdn.com/v4/letter/b/e0b2c6/32.png) [@bolewski](https://forum.inductiveautomation.com/u/bolewski)\
**Post date:** [March 22, 2011, 3:48am UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/12 "2011-03-22T03:48:22Z")

</div>

Now that we are ver close to April, can you give us an update on when this will be delivered?

😃

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 22, 2011, 3:33pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/13 "2011-03-22T15:33:05Z")

</div>

[quote=“bolewski”]Would it be possible to add bit level writing to Register Memory? I believe the Modbus function call 22 would easily support this feature. We are looking at a “forklift” upgrade of an HMI package that has this capability in it today.

Adding this would allow for a very clean exchange of the existing HMI with Ignition. I think this enhancement would make the driver more flexible for others as well. In our case, it would keep us from having to modify the PLC code already existing in many PLC systems.[/quote]

Still hoping to have something in beta by the end of the first week in April 🙂

---

<div class="post-metadata">

**Author:** ![MCC](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@MCC](https://forum.inductiveautomation.com/u/MCC)\
**Post date:** [April 2, 2011, 4:43am UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/14 "2011-04-02T04:43:03Z")

</div>

Just adding my voice to the chorus – this is a feature that we would find very useful.

Thanks!

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 11, 2011, 5:12pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/15 "2011-05-11T17:12:09Z")

</div>

So… an update.

Modbus Driver v2 will be released with 7.2.6. It’s a new Modbus driver; it can run side-by-side with the old Modbus driver.

It’s 95% backwards compatible. You can export your old address configuration and import it into this one using the same interface. The only difference is that some addresses/item paths may be slightly different, so you may have to drag the new tags in and point things towards them again.

It supports bit-level writes.

It’s open source. 😃

When your need for the new features exceeds the pain of dealing with any incompatibilities between the two drivers you can start to switch over to v2.

---

<div class="post-metadata">

**Author:** ![gnguyen](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gnguyen](https://forum.inductiveautomation.com/u/gnguyen)\
**Post date:** [May 15, 2011, 9:18am UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/16 "2011-05-15T09:18:53Z")

</div>

Hi Kevin,

Can you give more information (or changelog) for this new driver ? and when you say it’s open, that means that you’ll provide (upon request) the source code for the Ignition SDK ?

Regards,

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 15, 2011, 5:46pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/17 "2011-05-15T17:46:18Z")

</div>

[quote=“gnguyen”]Hi Kevin,

Can you give more information (or changelog) for this new driver ? and when you say it’s open, that means that you’ll provide (upon request) the source code for the Ignition SDK ?

Regards,[/quote]

A rough change log would be:

- Support for bit-level writes
- Option to enable/disable gap spanning in the request optimizer
- Option to enable/disable WriteMultiple\* requests
- More efficient use of available Modbus function calls
- Open source

The Ignition SDK is not open source, but the source code for the Modbus driver (which is built against the Ignition SDK) will be freely available.

---

<div class="post-metadata">

**Author:** ![gnguyen](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gnguyen](https://forum.inductiveautomation.com/u/gnguyen)\
**Post date:** [May 16, 2011, 4:13pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/18 "2011-05-16T16:13:30Z")

</div>

Nice to read.

---

<div class="post-metadata">

**Author:** ![DennisWomack](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@DennisWomack](https://forum.inductiveautomation.com/u/DennisWomack)\
**Post date:** [May 16, 2011, 5:00pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/19 "2011-05-16T17:00:29Z")

</div>

We are at 7.2.6 beta 11 now.

Any idea when it’s going to come out of beta?

Inquiring minds want to know.

Thanks,

Dennis

---

<div class="post-metadata">

**Author:** ![Kevin.McClusky](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@Kevin.McClusky](https://forum.inductiveautomation.com/u/Kevin.McClusky)\
**Post date:** [May 26, 2011, 11:47pm UTC](https://forum.inductiveautomation.com/t/modbus-driver-bit-level-writes-to-registers/2331/20 "2011-05-26T23:47:10Z")

</div>

Today 🙂
