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

Update index.js Issue #1175 #1364

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Conversation

rvbatista
Copy link
Contributor

Issue #1175
should be something like this, but I was not able to test.

@unocelli
Copy link
Member

@rvbatista Hi, My proposal was to use the settings fragment: if fragment is enabled in the device then I will use writeRegister instead of writeRegisters. what do you think about?

@rvbatista
Copy link
Contributor Author

I'm not sure, you see depends on the variable type also, INT should use WriteRegister, and any double REAL, DINT, etc.. should always use WriteRegisters.

As fuxa was only using WriteRegisters, I think that it's interesting to have a user accessible setting to control this behavior.

Fragment feature is already used by Modbus?

@unocelli
Copy link
Member

unocelli commented Sep 11, 2024

The Problem is that value is not only a bytes array,
var _writeMemory = function (memoryAddress, start, value) {

Int16, Uint16 = 2 bytes
Int32, UInt32 = 4 bytes
Bool = number

If we define that 1-2 with WriteRegister and 4-8 with WriteRegisters will work for every device? is modbus standard?

@rvbatista
Copy link
Contributor Author

For me both should work, but by specification there is the function to write single register (WriteRegister) and Write Multiple Registers (WriteRegisters) both are 16 bits based for each register.

@unocelli unocelli changed the base branch from master to fix/pr1364 September 12, 2024 18:33
@unocelli unocelli merged commit 70d837a into frangoteam:fix/pr1364 Sep 12, 2024
@unocelli
Copy link
Member

Thanks a lot.

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

Successfully merging this pull request may close these issues.

2 participants