Write 6-byte Modbus TSTAMP field

I’d like to synchronize the clocks of several identical devices to the Ignition server’s clock. These devices communicate with Modbus TCP, and require 3 words (6 bytes) be written as a block to set the clock.

I see the Ignition Modbus driver supports multiple write, but I’m unclear how to accomplish this.

I think the easiest thing would be to use system.opc.writeValues to write to the 3 holding registers at the same time. As long as they are contiguous the driver will group them together into a WriteMultipleRegistersRequest.

I’ll give that a shot. Thank you.

I was able to make this work so thanks again, however I ran into something I’m curious about.

To set the time on this device over Modbus, I need to write a single value to enable command mode. I then write multiple registers to set the time, and then close command mode by writing a single value again.

When using system.opc.writeValue (single), I have to add one to the register value. When using system.opc.writeValues (multiple), I do not.

The driver’s setting for “One-Based Addressing” is True (the default). I’m wondering about this behavior, since as luck would have it, the command register to flash the device is right next to the command register to enable command mode.

ed: oh, nvm i believe it is a documentation error with the device. sorry about that.