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

Status update in slave simulator #5

Closed
stianbauge opened this issue Dec 12, 2021 · 2 comments
Closed

Status update in slave simulator #5

stianbauge opened this issue Dec 12, 2021 · 2 comments
Assignees

Comments

@stianbauge
Copy link

This is a great software, I've been using it for educational purposes. The slave simulator function is really handy, however as a "standalone" slave simulator I found an issue with Modbus Mechanic. It seems that when running it as a slave simulator towards other Modbus Master (software) the slave simulator GUI does not refresh its status on coils and holding registers when receiving write requests from Master. I'm not sure if this mode of operation is the original intension of this slave simulator, although it would be a great feature to be able to simulate slave devices across a network.

(It's running on Windows 10 and Modbus TCP).

It works fine along with the Modbus Master in Modbus Mechanic, however.

@SciFiDryer
Copy link
Owner

Hi and thanks for reporting the issue. Glad to see the software is helping expand knowledge around Modbus.

I think what is happening is that the other master is using write single register and write single coil requests (function codes 5 and 6 respectively). As the function name implies, they allow writing to just a single coil or register. Given data types like float and unsigned int 32 are quite common today (which need multiple registers), most Modbus software uses write multiple coils and write multiple registers. If there is a need to write just one register, the length of the write multiple request is just set to 1. ModbusMechanic does this too.

I originally never expected the write single request to be common enough to implement, but you raise an excellent point for slave device troubleshooting and completeness. If a slave device is sending requests for write single, they shouldn't be invisible to the watch window. If you start ModbusMechanic with the -debug option on command line you can see the raw packets by the way.

I have added the implementation in 7d19db3 and will publish an update (probably 2.1) shortly. My tests of 2.0 agree with yours, I do not see updates in the watch window or the slave simulator. Tests in master now show it is resolved.

@SciFiDryer
Copy link
Owner

Closing as I cannot reproduce the issue in 2.1.

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

No branches or pull requests

2 participants