You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expose base response classes to allow doc gen
Not having these base classes in the docs meant that the most important
documentation (i.e. how to retrieve response items from the response) was
undocumented.
If exposing them as public module classes is undesired, some Sphinx directives
could instead be used to cause Sphinx to document them.
Add newlines to docstrings to stop docs breaking
Remove automodule statement which didn\'t do anything
The module name is async_io, not asyncio
Add explanatory header text to pymodbus.client
The subpackages TOC tree is large and messy, and the most useful sections (the
client common mixin and the synchronous client) are buried well below the fold,
with no TOC entries for them.
Copy file name to clipboardExpand all lines: doc/source/library/pymodbus.client.rst
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,9 @@
1
1
pymodbus\.client package
2
2
========================
3
3
4
-
.. automodule:: pymodbus.client
5
-
:members:
6
-
:undoc-members:
7
-
:show-inheritance:
4
+
Pymodbus offers a :mod:`synchronous client <pymodbus.client.sync>`, and async clients based on :mod:`asyncio <pymodbus.client.asynchronous.async_io>`, :mod:`Tornado <pymodbus.client.asynchronous.tornado>`, and :mod:`Twisted <pymodbus.client.asynchronous.Twisted>`.
5
+
6
+
Each client shares a :mod:`common client mixin <pymodbus.client.common>` which offers simple methods for reading and writing.
:param values: The requested values to be returned
68
71
"""
69
72
ModbusResponse.__init__(self, **kwargs)
73
+
74
+
#: A list of booleans representing bit values
70
75
self.bits=valuesor []
71
76
72
77
defencode(self):
@@ -144,9 +149,9 @@ def execute(self, context):
144
149
request is valid against the current datastore.
145
150
146
151
:param context: The datastore to request from
147
-
:returns: The initializes response message, exception message otherwise
152
+
:returns: An initialized :py:class:`~pymodbus.register_read_message.ReadCoilsResponse`, or an :py:class:`~pymodbus.pdu.ExceptionResponse` if an error occurred
@@ -166,8 +171,9 @@ class ReadCoilsResponse(ReadBitsResponseBase):
166
171
remaining bits in the final data byte will be padded with zeros
167
172
(toward the high order end of the byte). The Byte Count field specifies
168
173
the quantity of complete bytes of data.
169
-
"""
170
174
175
+
The requested coils can be found in boolean form in the .bits list.
176
+
"""
171
177
function_code=1
172
178
173
179
def__init__(self, values=None, **kwargs):
@@ -205,9 +211,9 @@ def execute(self, context):
205
211
request is valid against the current datastore.
206
212
207
213
:param context: The datastore to request from
208
-
:returns: The initializes response message, exception message otherwise
214
+
:returns: An initialized :py:class:`~pymodbus.register_read_message.ReadDiscreteInputsResponse`, or an :py:class:`~pymodbus.pdu.ExceptionResponse` if an error occurred
"""Run a read holding request against a datastore.
123
128
124
129
:param context: The datastore to request from
125
-
:returns: An initialized response, exception message otherwise
130
+
:returns: An initialized :py:class:`~pymodbus.register_read_message.ReadHoldingRegistersResponse`, or an :py:class:`~pymodbus.pdu.ExceptionResponse` if an error occurred
@@ -140,8 +145,9 @@ class ReadHoldingRegistersResponse(ReadRegistersResponseBase):
140
145
starting register address and the number of registers. In the PDU
141
146
Registers are addressed starting at zero. Therefore registers numbered
142
147
1-16 are addressed as 0-15.
143
-
"""
144
148
149
+
The requested registers can be found in the .registers list.
150
+
"""
145
151
function_code=3
146
152
147
153
def__init__(self, values=None, **kwargs):
@@ -176,9 +182,9 @@ def execute(self, context):
176
182
"""Run a read input request against a datastore.
177
183
178
184
:param context: The datastore to request from
179
-
:returns: An initialized response, exception message otherwise
185
+
:returns: An initialized :py:class:`~pymodbus.register_read_message.ReadInputRegistersResponse`, or an :py:class:`~pymodbus.pdu.ExceptionResponse` if an error occurred
@@ -194,8 +200,9 @@ class ReadInputRegistersResponse(ReadRegistersResponseBase):
194
200
starting register address and the number of registers. In the PDU
195
201
Registers are addressed starting at zero. Therefore input registers
196
202
numbered 1-16 are addressed as 0-15.
197
-
"""
198
203
204
+
The requested registers can be found in the .registers list.
205
+
"""
199
206
function_code=4
200
207
201
208
def__init__(self, values=None, **kwargs):
@@ -281,9 +288,9 @@ def execute(self, context):
281
288
"""Run a write single register request against a datastore.
282
289
283
290
:param context: The datastore to request from
284
-
:returns: An initialized response, exception message otherwise
291
+
:returns: An initialized :py:class:`~pymodbus.register_read_message.ReadWriteMultipleRegistersResponse`, or an :py:class:`~pymodbus.pdu.ExceptionResponse` if an error occurred
285
292
"""
286
-
ifnot1<=self.read_count<=0x07D:
293
+
ifnot(1<=self.read_count<=0x07d):
287
294
returnself.doException(merror.IllegalValue)
288
295
ifnot1<=self.write_count<=0x079:
289
296
returnself.doException(merror.IllegalValue)
@@ -331,8 +338,9 @@ class ReadWriteMultipleRegistersResponse(ModbusResponse):
331
338
The normal response contains the data from the group of registers that
332
339
were read. The byte count field specifies the quantity of bytes to
333
340
follow in the read data field.
334
-
"""
335
341
342
+
The requested registers can be found in the .registers list.
0 commit comments