2
.\" Title: modbus_read_input_bits
3
.\" Author: [see the "AUTHORS" section]
4
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
6
.\" Manual: Libmodbus Manual
7
.\" Source: libmodbus 3.0.3
10
.TH "MODBUS_READ_INPUT_BI" "3" "05/26/2012" "libmodbus 3\&.0\&.3" "Libmodbus Manual"
11
.\" -----------------------------------------------------------------
12
.\" * Define some portability stuff
13
.\" -----------------------------------------------------------------
14
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
.\" http://bugs.debian.org/507673
16
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20
.\" -----------------------------------------------------------------
21
.\" * set default formatting
22
.\" -----------------------------------------------------------------
23
.\" disable hyphenation
25
.\" disable justification (adjust text to left margin only)
27
.\" -----------------------------------------------------------------
28
.\" * MAIN CONTENT STARTS HERE *
29
.\" -----------------------------------------------------------------
31
modbus_read_input_bits \- read many input bits
34
\fBint modbus_read_input_bits(modbus_t *\fR\fB\fIctx\fR\fR\fB, int \fR\fB\fIaddr\fR\fR\fB, int \fR\fB\fInb\fR\fR\fB, uint8_t *\fR\fB\fIdest\fR\fR\fB);\fR
37
The \fImodbus_read_input_bits()\fR function shall read the content of the \fInb\fR input bits to the address \fIaddr\fR of the remote device\&. The result of reading is stored in \fIdest\fR array as unsigned bytes (8 bits) set to \fITRUE\fR or \fIFALSE\fR\&.
39
You must take care to allocate enough memory to store the results in \fIdest\fR (at least \fInb\fR * sizeof(uint8_t))\&.
41
The function uses the Modbus function code 0x02 (read input status)\&.
44
The \fImodbus_read_input_status()\fR function shall return the number of read input status if successful\&. Otherwise it shall return \-1 and set errno\&.
49
Too many discrete inputs requested
53
\fBmodbus_read_input_registers\fR(3)
56
The libmodbus documentation was written by St\('ephane Raimbault <\m[blue]\fBstephane\&.raimbault@gmail\&.com\fR\m[]\&\s-2\u[1]\d\s+2>
59
stephane.raimbault@gmail.com
61
\%mailto:stephane.raimbault@gmail.com