News:

  • October 02, 2026, 08:58:53 AM

Login with username, password and session length

Author Topic: Modbus Reads and Writes  (Read 20250 times)

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Modbus Reads and Writes
« Reply #15 on: August 05, 2019, 12:28:54 PM »
I
The problem I'm currently having is that depending on when I make changes on either end, the changes might or might not be accepted depending on the timing of the read/write commands. The command change might be accepted or I might have to enter it several times because of read/write timing issues.

I don't know if this would be helpful, but I had a similar situation between my HMI and a BRX PLC. I had counters that were updating in the PLC with the sequence of operations, however the operator needed to change these numbers on the fly.  What would happen is that the write from the HMI would occur  at a point when the PLC was updating those values and would immediately overwrite the variable with the old value.  I didn't want to create a duplicate set of variables that would be at different locations for the value to update (which is another way to do this). Instead, I used a boolean cmd bit that stops the update for those counters before I wrote to them, then the cleared the bit once the data was read back correctly by the HMI.

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Re: Modbus Reads and Writes
« Reply #16 on: August 06, 2019, 01:16:24 PM »
Thanks for the reply ATU. I had considered doing what you described (stopping update temporarily) and what you mentioned (having another set of holding memory to compare values) but neither are really "good" solutions. I was hoping there was an easy way to set up bilateral communications but it doesn't seem from the responses like there really is.