MODBUS_WRITE_REGISTE(3)

πŸ“¦
version 3.1.6 Β· 3 versions
, in debian bookworm

πŸ’– MODBUS_WRITE_REGISTERS β€” the libmodbus manual, but make it cute πŸ’–

okay bestie, welcome to the libmodbus Manual, section 3 (that's the library-functions girlies, iykyk). this one's about MODBUS_WRITE_REGISTERS, and yes the header up top truncates it to MODBUS_WRITE_REGISTE(3) because man page headers are always doing the most with limited space. we move. πŸŽ€


✨ NAME ✨

modbus_write_registers β€” write many registers 🫢

like, not one register. many. plural. the girlies are eating.


🌸 SYNOPSIS 🌸

int modbus_write_registers(modbus_t *ctx, int addr, int nb, const
uint16_t *src);

πŸ’… DESCRIPTION πŸ’…

so here's the vibe: the modbus_write_registers() function shall write the content of the nb holding registers from the array src at address addr of the remote device. no cap. that's literally the whole job and she does it flawlessly. πŸ’–

and the way she does it?? the function uses the Modbus function code 0x10 (preset multiple registers). iconic behavior honestly.

not me sending nb registers in one single flex. main character energy fr fr. ✨

πŸ¦‹ RETURN VALUE πŸ¦‹

  • if it ate: the function shall return the number of written registers β€” that's your success signal, bestie, count them and celebrate πŸŽ‰
  • if it did NOT eat: it shall return -1 and set errno. so go check your errno, she's trying to tell you something 😭

🌈 SEE ALSO 🌈


πŸ‘‘ AUTHORS πŸ‘‘

the libmodbus documentation was written by StΓ©phane Raimbault <stephane.raimbault@gmail.com> β€” absolute legend, we stan, thank you for your service πŸ«‘πŸ’œ


and that's the whole page!! this was libmodbus v3.1.6, dated 11/17/2025, and it slayed every second of it. mwah. πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from