Skip to content

writing a single byte data in modbus #1303

Answered by janiversen
sunilkumar105 asked this question in Q&A
Discussion options

You must be logged in to vote

Write_register automatically converts the value you send to big endian (depending on your CPU) for each register. However you need to check if a register swap (words) is needed.

In other words, the byte swapping is done automatically because it is within 1 register, but word swapping is responsibility of the app.

No it is not possible to write bytes, a register is defined as 2 bytes. so each address is 16bit wide, not 8bit.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by janiversen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants