We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
pymodbus.constants interferes with application's logging configuration
### Versions

* Python: 3.10
* OS: Ubuntu Linux
* Pymodbus: 3.0.0dev5
* Modbus Hardware (if used): 

### Description

pymodbus.constants calls logging.basicConfig() on import, overriding any logging that the application attempts to configure later on. This is unexpected and a documented anti-pattern for Python logging.

There is more discussion in PR #1106, which I will close so that someone else can suggest a solution that the maintainers can agree with.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pymodbus/__init__.py`
Content:
```
1 """Pymodbus: Modbus Protocol Implementation.
2 
3 Released under the the BSD license
4 """
5 
6 import logging as __logging
7 from logging import NullHandler as __null
8 
9 import pymodbus.version as __version
10 
11 
12 __version__ = __version.version.short()
13 __author__ = "Galen Collins"
14 __maintainer__ = "dhoomakethu"
15 
16 # ---------------------------------------------------------------------------#
17 #  Block unhandled logging
18 # ---------------------------------------------------------------------------#
19 __logging.getLogger(__name__).addHandler(__null())
20
```

Path: `pymodbus/constants.py`
Content:
```
1 """Constants For Modbus Server/Client.
2 
3 This is the single location for storing default
4 values for the servers and clients.
5 """
6 import logging
7 
8 from pymodbus.interfaces import Singleton
9 
10 
11 # set logging format and default level for library.
12 logging.basicConfig(
13     format="%(asctime)s %(levelname)-5s %(module)s:%(lineno)s %(message)s",
14     datefmt="%H:%M:%S",
15     level=logging.WARNING,
16 )
17 
18 
19 class Defaults(Singleton):  # pylint: disable=too-few-public-methods
20     """A collection of modbus default values.
21 
22     .. attribute:: Port
23 
24        The default modbus tcp server port (502)
25 
26     .. attribute:: TLSPort
27 
28        The default modbus tcp over tls server port (802)
29 
30 
31     .. attribute:: Backoff
32 
33        The default exponential backoff delay (0.3 seconds)
34 
35     .. attribute:: Retries
36 
37        The default number of times a client should retry the given
38        request before failing (3)
39 
40     .. attribute:: RetryOnEmpty
41 
42        A flag indicating if a transaction should be retried in the
43        case that an empty response is received. This is useful for
44        slow clients that may need more time to process a request.
45 
46     .. attribute:: RetryOnInvalid
47 
48        A flag indicating if a transaction should be retried in the
49        case that an invalid response is received.
50 
51     .. attribute:: Timeout
52 
53        The default amount of time a client should wait for a request
54        to be processed (3 seconds)
55 
56     .. attribute:: Reconnects
57 
58        The default number of times a client should attempt to reconnect
59        before deciding the server is down (0)
60 
61     .. attribute:: TransactionId
62 
63        The starting transaction identifier number (0)
64 
65     .. attribute:: ProtocolId
66 
67        The modbus protocol id.  Currently this is set to 0 in all
68        but proprietary implementations.
69 
70     .. attribute:: Slave
71 
72        The modbus slave address.  Currently this is set to 0x00 which
73        means this request should be broadcast to all the slave devices
74        (really means that all the devices should respond).
75 
76     .. attribute:: Baudrate
77 
78        The speed at which the data is transmitted over the serial line.
79        This defaults to 19200.
80 
81     .. attribute:: Parity
82 
83        The type of checksum to use to verify data integrity. This can be
84        on of the following::
85 
86          - (E)ven - 1 0 1 0 | P(0)
87          - (O)dd  - 1 0 1 0 | P(1)
88          - (N)one - 1 0 1 0 | no parity
89 
90        This defaults to (N)one.
91 
92     .. attribute:: Bytesize
93 
94        The number of bits in a byte of serial data.  This can be one of
95        5, 6, 7, or 8. This defaults to 8.
96 
97     .. attribute:: Stopbits
98 
99        The number of bits sent after each character in a message to
100        indicate the end of the byte.  This defaults to 1.
101 
102     .. attribute:: ZeroMode
103 
104        Indicates if the slave datastore should use indexing at 0 or 1.
105        More about this can be read in section 4.4 of the modbus specification.
106 
107     .. attribute:: IgnoreMissingSlaves
108 
109        In case a request is made to a missing slave, this defines if an error
110        should be returned or simply ignored. This is useful for the case of a
111        serial server emulater where a request to a non-existent slave on a bus
112        will never respond. The client in this case will simply timeout.
113 
114     .. attribute:: broadcast_enable
115 
116       When False unit_id 0 will be treated as any other unit_id. When True and
117       the unit_id is 0 the server will execute all requests on all server
118       contexts and not respond and the client will skip trying to receive a
119       response. Default value False does not conform to Modbus spec but maintains
120       legacy behavior for existing pymodbus users.
121 
122     """
123 
124     TcpPort = 502
125     TlsPort = 802
126     UdpPort = 502
127     Backoff = 0.3
128     CloseCommOnError = False
129     HandleLocalEcho = False
130     Retries = 3
131     RetryOnEmpty = False
132     RetryOnInvalid = False
133     Timeout = 3
134     Reconnects = 0
135     TransactionId = 0
136     Strict = True
137     ProtocolId = 0
138     Slave = 0x00
139     Baudrate = 19200
140     Parity = "N"
141     Bytesize = 8
142     Stopbits = 1
143     ZeroMode = False
144     IgnoreMissingSlaves = False
145     ReadSize = 1024
146     BroadcastEnable = False
147     ReconnectDelay = 1000 * 60 * 5
148     Count = 1
149 
150 
151 class ModbusStatus(Singleton):  # pylint: disable=too-few-public-methods
152     """These represent various status codes in the modbus protocol.
153 
154     .. attribute:: Waiting
155 
156        This indicates that a modbus device is currently
157        waiting for a given request to finish some running task.
158 
159     .. attribute:: Ready
160 
161        This indicates that a modbus device is currently
162        free to perform the next request task.
163 
164     .. attribute:: On
165 
166        This indicates that the given modbus entity is on
167 
168     .. attribute:: Off
169 
170        This indicates that the given modbus entity is off
171 
172     .. attribute:: SlaveOn
173 
174        This indicates that the given modbus slave is running
175 
176     .. attribute:: SlaveOff
177 
178        This indicates that the given modbus slave is not running
179     """
180 
181     Waiting = 0xFFFF
182     Ready = 0x0000
183     On = 0xFF00  # pylint: disable=invalid-name
184     Off = 0x0000
185     SlaveOn = 0xFF
186     SlaveOff = 0x00
187 
188 
189 class Endian(Singleton):  # pylint: disable=too-few-public-methods
190     """An enumeration representing the various byte endianness.
191 
192     .. attribute:: Auto
193 
194        This indicates that the byte order is chosen by the
195        current native environment.
196 
197     .. attribute:: Big
198 
199        This indicates that the bytes are in little endian format
200 
201     .. attribute:: Little
202 
203        This indicates that the bytes are in big endian format
204 
205     .. note:: I am simply borrowing the format strings from the
206        python struct module for my convenience.
207     """
208 
209     Auto = "@"
210     Big = ">"
211     Little = "<"
212 
213 
214 class ModbusPlusOperation(Singleton):  # pylint: disable=too-few-public-methods
215     """Represents the type of modbus plus request.
216 
217     .. attribute:: GetStatistics
218 
219        Operation requesting that the current modbus plus statistics
220        be returned in the response.
221 
222     .. attribute:: ClearStatistics
223 
224        Operation requesting that the current modbus plus statistics
225        be cleared and not returned in the response.
226     """
227 
228     GetStatistics = 0x0003
229     ClearStatistics = 0x0004
230 
231 
232 class DeviceInformation(Singleton):  # pylint: disable=too-few-public-methods
233     """Represents what type of device information to read.
234 
235     .. attribute:: Basic
236 
237        This is the basic (required) device information to be returned.
238        This includes VendorName, ProductCode, and MajorMinorRevision
239        code.
240 
241     .. attribute:: Regular
242 
243        In addition to basic data objects, the device provides additional
244        and optional identification and description data objects. All of
245        the objects of this category are defined in the standard but their
246        implementation is optional.
247 
248     .. attribute:: Extended
249 
250        In addition to regular data objects, the device provides additional
251        and optional identification and description private data about the
252        physical device itself. All of these data are device dependent.
253 
254     .. attribute:: Specific
255 
256        Request to return a single data object.
257     """
258 
259     Basic = 0x01
260     Regular = 0x02
261     Extended = 0x03
262     Specific = 0x04
263 
264 
265 class MoreData(Singleton):  # pylint: disable=too-few-public-methods
266     """Represents the more follows condition.
267 
268     .. attribute:: Nothing
269 
270        This indicates that no more objects are going to be returned.
271 
272     .. attribute:: KeepReading
273 
274        This indicates that there are more objects to be returned.
275     """
276 
277     Nothing = 0x00
278     KeepReading = 0xFF
279 
280 
281 # ---------------------------------------------------------------------------#
282 #  Exported Identifiers
283 # ---------------------------------------------------------------------------#
284 __all__ = [
285     "Defaults",
286     "ModbusStatus",
287     "Endian",
288     "ModbusPlusOperation",
289     "DeviceInformation",
290     "MoreData",
291 ]
292
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pymodbus/__init__.py b/pymodbus/__init__.py
--- a/pymodbus/__init__.py
+++ b/pymodbus/__init__.py
@@ -17,3 +17,15 @@
 #  Block unhandled logging
 # ---------------------------------------------------------------------------#
 __logging.getLogger(__name__).addHandler(__null())
+
+
+def pymodbus_apply_logging_config():
+    """Apply basic logging configuration used by default by Pymodbus maintainers.
+
+    Please call this function to format logging appropriately when opening issues.
+    """
+    __logging.basicConfig(
+        format="%(asctime)s %(levelname)-5s %(module)s:%(lineno)s %(message)s",
+        datefmt="%H:%M:%S",
+        level=__logging.WARNING,
+    )
diff --git a/pymodbus/constants.py b/pymodbus/constants.py
--- a/pymodbus/constants.py
+++ b/pymodbus/constants.py
@@ -3,17 +3,9 @@
 This is the single location for storing default
 values for the servers and clients.
 """
-import logging
-
-from pymodbus.interfaces import Singleton
 
 
-# set logging format and default level for library.
-logging.basicConfig(
-    format="%(asctime)s %(levelname)-5s %(module)s:%(lineno)s %(message)s",
-    datefmt="%H:%M:%S",
-    level=logging.WARNING,
-)
+from pymodbus.interfaces import Singleton
 
 
 class Defaults(Singleton):  # pylint: disable=too-few-public-methods

{"golden_diff": "diff --git a/pymodbus/__init__.py b/pymodbus/__init__.py\n--- a/pymodbus/__init__.py\n+++ b/pymodbus/__init__.py\n@@ -17,3 +17,15 @@\n #  Block unhandled logging\n # ---------------------------------------------------------------------------#\n __logging.getLogger(__name__).addHandler(__null())\n+\n+\n+def pymodbus_apply_logging_config():\n+    \"\"\"Apply basic logging configuration used by default by Pymodbus maintainers.\n+\n+    Please call this function to format logging appropriately when opening issues.\n+    \"\"\"\n+    __logging.basicConfig(\n+        format=\"%(asctime)s %(levelname)-5s %(module)s:%(lineno)s %(message)s\",\n+        datefmt=\"%H:%M:%S\",\n+        level=__logging.WARNING,\n+    )\ndiff --git a/pymodbus/constants.py b/pymodbus/constants.py\n--- a/pymodbus/constants.py\n+++ b/pymodbus/constants.py\n@@ -3,17 +3,9 @@\n This is the single location for storing default\n values for the servers and clients.\n \"\"\"\n-import logging\n-\n-from pymodbus.interfaces import Singleton\n \n \n-# set logging format and default level for library.\n-logging.basicConfig(\n-    format=\"%(asctime)s %(levelname)-5s %(module)s:%(lineno)s %(message)s\",\n-    datefmt=\"%H:%M:%S\",\n-    level=logging.WARNING,\n-)\n+from pymodbus.interfaces import Singleton\n \n \n class Defaults(Singleton):  # pylint: disable=too-few-public-methods\n", "issue": "pymodbus.constants interferes with application's logging configuration\n### Versions\r\n\r\n* Python: 3.10\r\n* OS: Ubuntu Linux\r\n* Pymodbus: 3.0.0dev5\r\n* Modbus Hardware (if used): \r\n\r\n### Description\r\n\r\npymodbus.constants calls logging.basicConfig() on import, overriding any logging that the application attempts to configure later on. This is unexpected and a documented anti-pattern for Python logging.\r\n\r\nThere is more discussion in PR #1106, which I will close so that someone else can suggest a solution that the maintainers can agree with.\r\n\n", "before_files": [{"content": "\"\"\"Pymodbus: Modbus Protocol Implementation.\n\nReleased under the the BSD license\n\"\"\"\n\nimport logging as __logging\nfrom logging import NullHandler as __null\n\nimport pymodbus.version as __version\n\n\n__version__ = __version.version.short()\n__author__ = \"Galen Collins\"\n__maintainer__ = \"dhoomakethu\"\n\n# ---------------------------------------------------------------------------#\n#  Block unhandled logging\n# ---------------------------------------------------------------------------#\n__logging.getLogger(__name__).addHandler(__null())\n", "path": "pymodbus/__init__.py"}, {"content": "\"\"\"Constants For Modbus Server/Client.\n\nThis is the single location for storing default\nvalues for the servers and clients.\n\"\"\"\nimport logging\n\nfrom pymodbus.interfaces import Singleton\n\n\n# set logging format and default level for library.\nlogging.basicConfig(\n    format=\"%(asctime)s %(levelname)-5s %(module)s:%(lineno)s %(message)s\",\n    datefmt=\"%H:%M:%S\",\n    level=logging.WARNING,\n)\n\n\nclass Defaults(Singleton):  # pylint: disable=too-few-public-methods\n    \"\"\"A collection of modbus default values.\n\n    .. attribute:: Port\n\n       The default modbus tcp server port (502)\n\n    .. attribute:: TLSPort\n\n       The default modbus tcp over tls server port (802)\n\n\n    .. attribute:: Backoff\n\n       The default exponential backoff delay (0.3 seconds)\n\n    .. attribute:: Retries\n\n       The default number of times a client should retry the given\n       request before failing (3)\n\n    .. attribute:: RetryOnEmpty\n\n       A flag indicating if a transaction should be retried in the\n       case that an empty response is received. This is useful for\n       slow clients that may need more time to process a request.\n\n    .. attribute:: RetryOnInvalid\n\n       A flag indicating if a transaction should be retried in the\n       case that an invalid response is received.\n\n    .. attribute:: Timeout\n\n       The default amount of time a client should wait for a request\n       to be processed (3 seconds)\n\n    .. attribute:: Reconnects\n\n       The default number of times a client should attempt to reconnect\n       before deciding the server is down (0)\n\n    .. attribute:: TransactionId\n\n       The starting transaction identifier number (0)\n\n    .. attribute:: ProtocolId\n\n       The modbus protocol id.  Currently this is set to 0 in all\n       but proprietary implementations.\n\n    .. attribute:: Slave\n\n       The modbus slave address.  Currently this is set to 0x00 which\n       means this request should be broadcast to all the slave devices\n       (really means that all the devices should respond).\n\n    .. attribute:: Baudrate\n\n       The speed at which the data is transmitted over the serial line.\n       This defaults to 19200.\n\n    .. attribute:: Parity\n\n       The type of checksum to use to verify data integrity. This can be\n       on of the following::\n\n         - (E)ven - 1 0 1 0 | P(0)\n         - (O)dd  - 1 0 1 0 | P(1)\n         - (N)one - 1 0 1 0 | no parity\n\n       This defaults to (N)one.\n\n    .. attribute:: Bytesize\n\n       The number of bits in a byte of serial data.  This can be one of\n       5, 6, 7, or 8. This defaults to 8.\n\n    .. attribute:: Stopbits\n\n       The number of bits sent after each character in a message to\n       indicate the end of the byte.  This defaults to 1.\n\n    .. attribute:: ZeroMode\n\n       Indicates if the slave datastore should use indexing at 0 or 1.\n       More about this can be read in section 4.4 of the modbus specification.\n\n    .. attribute:: IgnoreMissingSlaves\n\n       In case a request is made to a missing slave, this defines if an error\n       should be returned or simply ignored. This is useful for the case of a\n       serial server emulater where a request to a non-existent slave on a bus\n       will never respond. The client in this case will simply timeout.\n\n    .. attribute:: broadcast_enable\n\n      When False unit_id 0 will be treated as any other unit_id. When True and\n      the unit_id is 0 the server will execute all requests on all server\n      contexts and not respond and the client will skip trying to receive a\n      response. Default value False does not conform to Modbus spec but maintains\n      legacy behavior for existing pymodbus users.\n\n    \"\"\"\n\n    TcpPort = 502\n    TlsPort = 802\n    UdpPort = 502\n    Backoff = 0.3\n    CloseCommOnError = False\n    HandleLocalEcho = False\n    Retries = 3\n    RetryOnEmpty = False\n    RetryOnInvalid = False\n    Timeout = 3\n    Reconnects = 0\n    TransactionId = 0\n    Strict = True\n    ProtocolId = 0\n    Slave = 0x00\n    Baudrate = 19200\n    Parity = \"N\"\n    Bytesize = 8\n    Stopbits = 1\n    ZeroMode = False\n    IgnoreMissingSlaves = False\n    ReadSize = 1024\n    BroadcastEnable = False\n    ReconnectDelay = 1000 * 60 * 5\n    Count = 1\n\n\nclass ModbusStatus(Singleton):  # pylint: disable=too-few-public-methods\n    \"\"\"These represent various status codes in the modbus protocol.\n\n    .. attribute:: Waiting\n\n       This indicates that a modbus device is currently\n       waiting for a given request to finish some running task.\n\n    .. attribute:: Ready\n\n       This indicates that a modbus device is currently\n       free to perform the next request task.\n\n    .. attribute:: On\n\n       This indicates that the given modbus entity is on\n\n    .. attribute:: Off\n\n       This indicates that the given modbus entity is off\n\n    .. attribute:: SlaveOn\n\n       This indicates that the given modbus slave is running\n\n    .. attribute:: SlaveOff\n\n       This indicates that the given modbus slave is not running\n    \"\"\"\n\n    Waiting = 0xFFFF\n    Ready = 0x0000\n    On = 0xFF00  # pylint: disable=invalid-name\n    Off = 0x0000\n    SlaveOn = 0xFF\n    SlaveOff = 0x00\n\n\nclass Endian(Singleton):  # pylint: disable=too-few-public-methods\n    \"\"\"An enumeration representing the various byte endianness.\n\n    .. attribute:: Auto\n\n       This indicates that the byte order is chosen by the\n       current native environment.\n\n    .. attribute:: Big\n\n       This indicates that the bytes are in little endian format\n\n    .. attribute:: Little\n\n       This indicates that the bytes are in big endian format\n\n    .. note:: I am simply borrowing the format strings from the\n       python struct module for my convenience.\n    \"\"\"\n\n    Auto = \"@\"\n    Big = \">\"\n    Little = \"<\"\n\n\nclass ModbusPlusOperation(Singleton):  # pylint: disable=too-few-public-methods\n    \"\"\"Represents the type of modbus plus request.\n\n    .. attribute:: GetStatistics\n\n       Operation requesting that the current modbus plus statistics\n       be returned in the response.\n\n    .. attribute:: ClearStatistics\n\n       Operation requesting that the current modbus plus statistics\n       be cleared and not returned in the response.\n    \"\"\"\n\n    GetStatistics = 0x0003\n    ClearStatistics = 0x0004\n\n\nclass DeviceInformation(Singleton):  # pylint: disable=too-few-public-methods\n    \"\"\"Represents what type of device information to read.\n\n    .. attribute:: Basic\n\n       This is the basic (required) device information to be returned.\n       This includes VendorName, ProductCode, and MajorMinorRevision\n       code.\n\n    .. attribute:: Regular\n\n       In addition to basic data objects, the device provides additional\n       and optional identification and description data objects. All of\n       the objects of this category are defined in the standard but their\n       implementation is optional.\n\n    .. attribute:: Extended\n\n       In addition to regular data objects, the device provides additional\n       and optional identification and description private data about the\n       physical device itself. All of these data are device dependent.\n\n    .. attribute:: Specific\n\n       Request to return a single data object.\n    \"\"\"\n\n    Basic = 0x01\n    Regular = 0x02\n    Extended = 0x03\n    Specific = 0x04\n\n\nclass MoreData(Singleton):  # pylint: disable=too-few-public-methods\n    \"\"\"Represents the more follows condition.\n\n    .. attribute:: Nothing\n\n       This indicates that no more objects are going to be returned.\n\n    .. attribute:: KeepReading\n\n       This indicates that there are more objects to be returned.\n    \"\"\"\n\n    Nothing = 0x00\n    KeepReading = 0xFF\n\n\n# ---------------------------------------------------------------------------#\n#  Exported Identifiers\n# ---------------------------------------------------------------------------#\n__all__ = [\n    \"Defaults\",\n    \"ModbusStatus\",\n    \"Endian\",\n    \"ModbusPlusOperation\",\n    \"DeviceInformation\",\n    \"MoreData\",\n]\n", "path": "pymodbus/constants.py"}], "after_files": [{"content": "\"\"\"Pymodbus: Modbus Protocol Implementation.\n\nReleased under the the BSD license\n\"\"\"\n\nimport logging as __logging\nfrom logging import NullHandler as __null\n\nimport pymodbus.version as __version\n\n\n__version__ = __version.version.short()\n__author__ = \"Galen Collins\"\n__maintainer__ = \"dhoomakethu\"\n\n# ---------------------------------------------------------------------------#\n#  Block unhandled logging\n# ---------------------------------------------------------------------------#\n__logging.getLogger(__name__).addHandler(__null())\n\n\ndef pymodbus_apply_logging_config():\n    \"\"\"Apply basic logging configuration used by default by Pymodbus maintainers.\n\n    Please call this function to format logging appropriately when opening issues.\n    \"\"\"\n    __logging.basicConfig(\n        format=\"%(asctime)s %(levelname)-5s %(module)s:%(lineno)s %(message)s\",\n        datefmt=\"%H:%M:%S\",\n        level=__logging.WARNING,\n    )\n", "path": "pymodbus/__init__.py"}, {"content": "\"\"\"Constants For Modbus Server/Client.\n\nThis is the single location for storing default\nvalues for the servers and clients.\n\"\"\"\n\n\nfrom pymodbus.interfaces import Singleton\n\n\nclass Defaults(Singleton):  # pylint: disable=too-few-public-methods\n    \"\"\"A collection of modbus default values.\n\n    .. attribute:: Port\n\n       The default modbus tcp server port (502)\n\n    .. attribute:: TLSPort\n\n       The default modbus tcp over tls server port (802)\n\n\n    .. attribute:: Backoff\n\n       The default exponential backoff delay (0.3 seconds)\n\n    .. attribute:: Retries\n\n       The default number of times a client should retry the given\n       request before failing (3)\n\n    .. attribute:: RetryOnEmpty\n\n       A flag indicating if a transaction should be retried in the\n       case that an empty response is received. This is useful for\n       slow clients that may need more time to process a request.\n\n    .. attribute:: RetryOnInvalid\n\n       A flag indicating if a transaction should be retried in the\n       case that an invalid response is received.\n\n    .. attribute:: Timeout\n\n       The default amount of time a client should wait for a request\n       to be processed (3 seconds)\n\n    .. attribute:: Reconnects\n\n       The default number of times a client should attempt to reconnect\n       before deciding the server is down (0)\n\n    .. attribute:: TransactionId\n\n       The starting transaction identifier number (0)\n\n    .. attribute:: ProtocolId\n\n       The modbus protocol id.  Currently this is set to 0 in all\n       but proprietary implementations.\n\n    .. attribute:: Slave\n\n       The modbus slave address.  Currently this is set to 0x00 which\n       means this request should be broadcast to all the slave devices\n       (really means that all the devices should respond).\n\n    .. attribute:: Baudrate\n\n       The speed at which the data is transmitted over the serial line.\n       This defaults to 19200.\n\n    .. attribute:: Parity\n\n       The type of checksum to use to verify data integrity. This can be\n       on of the following::\n\n         - (E)ven - 1 0 1 0 | P(0)\n         - (O)dd  - 1 0 1 0 | P(1)\n         - (N)one - 1 0 1 0 | no parity\n\n       This defaults to (N)one.\n\n    .. attribute:: Bytesize\n\n       The number of bits in a byte of serial data.  This can be one of\n       5, 6, 7, or 8. This defaults to 8.\n\n    .. attribute:: Stopbits\n\n       The number of bits sent after each character in a message to\n       indicate the end of the byte.  This defaults to 1.\n\n    .. attribute:: ZeroMode\n\n       Indicates if the slave datastore should use indexing at 0 or 1.\n       More about this can be read in section 4.4 of the modbus specification.\n\n    .. attribute:: IgnoreMissingSlaves\n\n       In case a request is made to a missing slave, this defines if an error\n       should be returned or simply ignored. This is useful for the case of a\n       serial server emulater where a request to a non-existent slave on a bus\n       will never respond. The client in this case will simply timeout.\n\n    .. attribute:: broadcast_enable\n\n      When False unit_id 0 will be treated as any other unit_id. When True and\n      the unit_id is 0 the server will execute all requests on all server\n      contexts and not respond and the client will skip trying to receive a\n      response. Default value False does not conform to Modbus spec but maintains\n      legacy behavior for existing pymodbus users.\n\n    \"\"\"\n\n    TcpPort = 502\n    TlsPort = 802\n    UdpPort = 502\n    Backoff = 0.3\n    CloseCommOnError = False\n    HandleLocalEcho = False\n    Retries = 3\n    RetryOnEmpty = False\n    RetryOnInvalid = False\n    Timeout = 3\n    Reconnects = 0\n    TransactionId = 0\n    Strict = True\n    ProtocolId = 0\n    Slave = 0x00\n    Baudrate = 19200\n    Parity = \"N\"\n    Bytesize = 8\n    Stopbits = 1\n    ZeroMode = False\n    IgnoreMissingSlaves = False\n    ReadSize = 1024\n    BroadcastEnable = False\n    ReconnectDelay = 1000 * 60 * 5\n    Count = 1\n\n\nclass ModbusStatus(Singleton):  # pylint: disable=too-few-public-methods\n    \"\"\"These represent various status codes in the modbus protocol.\n\n    .. attribute:: Waiting\n\n       This indicates that a modbus device is currently\n       waiting for a given request to finish some running task.\n\n    .. attribute:: Ready\n\n       This indicates that a modbus device is currently\n       free to perform the next request task.\n\n    .. attribute:: On\n\n       This indicates that the given modbus entity is on\n\n    .. attribute:: Off\n\n       This indicates that the given modbus entity is off\n\n    .. attribute:: SlaveOn\n\n       This indicates that the given modbus slave is running\n\n    .. attribute:: SlaveOff\n\n       This indicates that the given modbus slave is not running\n    \"\"\"\n\n    Waiting = 0xFFFF\n    Ready = 0x0000\n    On = 0xFF00  # pylint: disable=invalid-name\n    Off = 0x0000\n    SlaveOn = 0xFF\n    SlaveOff = 0x00\n\n\nclass Endian(Singleton):  # pylint: disable=too-few-public-methods\n    \"\"\"An enumeration representing the various byte endianness.\n\n    .. attribute:: Auto\n\n       This indicates that the byte order is chosen by the\n       current native environment.\n\n    .. attribute:: Big\n\n       This indicates that the bytes are in little endian format\n\n    .. attribute:: Little\n\n       This indicates that the bytes are in big endian format\n\n    .. note:: I am simply borrowing the format strings from the\n       python struct module for my convenience.\n    \"\"\"\n\n    Auto = \"@\"\n    Big = \">\"\n    Little = \"<\"\n\n\nclass ModbusPlusOperation(Singleton):  # pylint: disable=too-few-public-methods\n    \"\"\"Represents the type of modbus plus request.\n\n    .. attribute:: GetStatistics\n\n       Operation requesting that the current modbus plus statistics\n       be returned in the response.\n\n    .. attribute:: ClearStatistics\n\n       Operation requesting that the current modbus plus statistics\n       be cleared and not returned in the response.\n    \"\"\"\n\n    GetStatistics = 0x0003\n    ClearStatistics = 0x0004\n\n\nclass DeviceInformation(Singleton):  # pylint: disable=too-few-public-methods\n    \"\"\"Represents what type of device information to read.\n\n    .. attribute:: Basic\n\n       This is the basic (required) device information to be returned.\n       This includes VendorName, ProductCode, and MajorMinorRevision\n       code.\n\n    .. attribute:: Regular\n\n       In addition to basic data objects, the device provides additional\n       and optional identification and description data objects. All of\n       the objects of this category are defined in the standard but their\n       implementation is optional.\n\n    .. attribute:: Extended\n\n       In addition to regular data objects, the device provides additional\n       and optional identification and description private data about the\n       physical device itself. All of these data are device dependent.\n\n    .. attribute:: Specific\n\n       Request to return a single data object.\n    \"\"\"\n\n    Basic = 0x01\n    Regular = 0x02\n    Extended = 0x03\n    Specific = 0x04\n\n\nclass MoreData(Singleton):  # pylint: disable=too-few-public-methods\n    \"\"\"Represents the more follows condition.\n\n    .. attribute:: Nothing\n\n       This indicates that no more objects are going to be returned.\n\n    .. attribute:: KeepReading\n\n       This indicates that there are more objects to be returned.\n    \"\"\"\n\n    Nothing = 0x00\n    KeepReading = 0xFF\n\n\n# ---------------------------------------------------------------------------#\n#  Exported Identifiers\n# ---------------------------------------------------------------------------#\n__all__ = [\n    \"Defaults\",\n    \"ModbusStatus\",\n    \"Endian\",\n    \"ModbusPlusOperation\",\n    \"DeviceInformation\",\n    \"MoreData\",\n]\n", "path": "pymodbus/constants.py"}]}