'\" t
.\" Title: modbus_write_registers
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets vsnapshot
.\" Date: 10/15/2022
.\" Manual: libmodbus Manual
.\" Source: libmodbus v3.1.6
.\" Language: English
.\"
.TH "MODBUS_WRITE_REGISTE" "3" "10/15/2022" "libmodbus v3\&.1\&.6" "libmodbus Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
modbus_write_registers \- write many registers
.SH "SYNOPSIS"
.sp
\fBint modbus_write_registers(modbus_t *\fR\fB\fIctx\fR\fR\fB, int \fR\fB\fIaddr\fR\fR\fB, int \fR\fB\fInb\fR\fR\fB, const uint16_t *\fR\fB\fIsrc\fR\fR\fB);\fR
.SH "DESCRIPTION"
.sp
The \fBmodbus_write_registers()\fR function shall write the content of the \fInb\fR holding registers from the array \fIsrc\fR at address \fIaddr\fR of the remote device\&.
.sp
The function uses the Modbus function code 0x10 (preset multiple registers)\&.
.SH "RETURN VALUE"
.sp
The function shall return the number of written registers if successful\&. Otherwise it shall return \-1 and set errno\&.
.SH "SEE ALSO"
.sp
\fBmodbus_write_register\fR(3) \fBmodbus_read_registers\fR(3)
.SH "AUTHORS"
.sp
The libmodbus documentation was written by Stéphane Raimbault