-
-
Notifications
You must be signed in to change notification settings - Fork 727
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
[BUG] ModbusTCP 16bit register write - bad function code #1175
Comments
Hello, thanks for your issue. |
Hi, have you try to update modbus-serial to 8.0.16? |
What are your modbus server? The reading is working? The usage of write multiple registers is in fact bad for efficiency, but it should work if your server have it implemented. |
Hello, |
The usage of FC16 instead of FC06 is in fact I'm the logic, today Fuxa will never use FC06. You know this is not exactly an error, since you can use FC16 to write only one register, but I trying to figure out why you are having an error in this case. |
Hi, I added the possibility to set a frame delay that maybe can help (in master branch), would be nice to try and give me feedback |
Hello, thank You for reply. I tested it (tried several delay values from 10 ms to 2000 ms) just now, but it don't fix the issue - still the same error ("bad lenght 8, expected more than 8"). I had worked around it using OpenPLC on server and some DINT to INT processing, because I had to move forward with the project. I got to make it that way, because device which I'm working with had scrict registers addresing (separate memory part for 16 bit HR for setting and setpoints for which it will only accept FC06 modbus command separate and 32 bit memory registers for process settings). |
Hello,
I'd run into an issue where I can't write values into single 16bit register of modbus device. I have created a single tag with INT16 datatype and proper device addressing, but when I tried to write data into it nothing happended. Quick look into modbus logs has shown that function 16 (multiple registers) is used instead of 06 (single registers) and communication is interrupted due to "bad lenght 8 (expected more than 8)". When I switched Fuxa tag datatype to INT32 all started working, but I can't leave it that way, because device I'm using have 6 consecutive 16bit registers which I got to use... Is there a way to properly send single 16bit register by modbus TCP in Fuxa? I don't think it's issue with the device itself, because I can write data into it using simulator or HMI.
To Reproduce
Expected behavior
I think it may be a bug in modbus tcp plugin.
Environment
The text was updated successfully, but these errors were encountered: