Modbus driver doesn't seem to properly optimize write multiple registers

Hi!

I’m facing a problem with Modbus. I’m trying to write 120 holding registers in one request, but for some reason, Ignition seems to split them into 60 two-register requests. The functionality of the device I’m trying to access, requires a 120-register bulk write.

How do I make the bulk write work?

If absolutely necessary, I could modify the Modbus driver, assuming the SDK has got the current driver, and modifying it would actually help.

Details:

  • I’m using the “system.opc.writeValues()” script function
    • The registers input to the writeValues() function are in an ascending numeric order.
  • The device’s been configured as follows:
    • Allow Write Multiple Registers Request: ENABLED
    • Max Holding Registers Per Request: 125
    • Span Gaps: ENABLED
    • Force Multiple Register Writes: tried both
    • One-based Addressing: DISABLED
  • Modbus Driver v2 3.7.5 (b2015071516)
  • OPC-UA 2.7.5 (b2015071516)
  • Ignition Gateway 7.7.5 (b2015071516)

Thanks!

Do the registers span a contiguous address range?

It looks like we fixed a bug back in version 7.8.3 that, from the description in the tracker, sounds like what you’re experiencing.

Can you upgrade to 7.8.x or 7.9.x?

Yes, they’re contiguous.

I need to check with my customer if they’re able to upgrade without too much hassle. What other options might I have? Perhaps just upgrading the Modbus driver (assuming the driver’s the problem)?

There’s not much else that can be done besides upgrading. A module from the 7.8.x series won’t install on a 7.7.x gateway.

If this block write is not a common theme maybe you can just open a socket and write the necessary Modbus command + payload manually.

I was able to test the current gateway version (7.9.3), and the bulk write now works correctly, thanks!

I hope the production environment will be reasonably upgradeable as well :hammer: