Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReadWriteMultipleRegisters - The write operation is not performed before the read. #45

Closed
GoogleCodeExporter opened this issue Oct 2, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. If you are reading register value at the same register address as you
are writting, then you obtain old data before write part of the function is
applied. 
2. But if you are reading and writing at different register addresses, then
everything seems OK.
3.

What is the expected output? What do you see instead?

Value of the registers before 0x17 Read/Write Multiple registers:
Register : 20 -> 1
Register : 21 -> 2
Register : 22 -> 3
Register : 23 -> 4
Register : 24 -> 5

0x17 Read/Write is used to read at address 20 5 registers and write at
address 20 5 registers {1,0,3,0,5} at the same time.

Value of the registers after 0x17 Read/Write Multiple registers:
Register : 20 -> 1
Register : 21 -> 0
Register : 22 -> 3
Register : 23 -> 0
Register : 24 -> 5

Value of the registers after 0x17 Read/Write Multiple registers returned by
the 0x17 Read/Write function:
Register : 20 -> 1
Register : 21 -> 2
Register : 22 -> 3
Register : 23 -> 4
Register : 24 -> 5


What version of the product are you using? On what operating system?
Assembly: Modbus (Module: Modbus) Version: 1.9.0.0 (1.9.0.0) 
Assembly: Modbus (Module: Modbus) Version: 1.11.0.0 (1.11.0.0)
Windows XP SP3 Eng ver.

Please provide any additional information below.
From Modbus_Application_Protocol_V1_1b specification:

This function code performs a combination of one read operation and one
write operation in a single MODBUS transaction. The write operation is
performed before the read.


Thank you very much :)

Original issue reported on code.google.com by pluta...@gmail.com on 10 May 2009 at 4:13

@GoogleCodeExporter
Copy link
Author

This is an issue with the implementation of the Modbus protocol on the
Modbus Slave you're reading from (your device).

Scott

Original comment by sja...@gmail.com on 11 May 2009 at 6:12

  • Changed state: Invalid

@GoogleCodeExporter
Copy link
Author

Actually I am not using any device as a Modbus Slave, I am trying to simulate 
Modbus
communication using your library.

That is from my Modbus Slave, nothing else has been added:

 slaveTcpListener.Start();
 ModbusSlave slave = ModbusTcpSlave.CreateTcp(slaveID, slaveTcpListener);
 slave.DataStore = DataStoreFactory.CreateDefaultDataStore();
 slave.Listen();

Jan


Original comment by pluta...@gmail.com on 11 May 2009 at 8:47

@GoogleCodeExporter
Copy link
Author

Ah, you're right, my bad. Will fix.

Original comment by sja...@gmail.com on 11 May 2009 at 6:08

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Fixed in the trunk. Thanks for the feedback.

Original comment by sja...@gmail.com on 11 May 2009 at 6:35

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant