|
11 | 11 | class Defaults(Singleton): # pylint: disable=too-few-public-methods |
12 | 12 | """A collection of modbus default values. |
13 | 13 |
|
14 | | - .. attribute:: Port |
| 14 | + .. attribute:: Port |
15 | 15 |
|
16 | | - The default modbus tcp server port (502) |
| 16 | + The default modbus tcp server port (502) |
17 | 17 |
|
18 | | - .. attribute:: TLSPort |
| 18 | + .. attribute:: TLSPort |
19 | 19 |
|
20 | | - The default modbus tcp over tls server port (802) |
| 20 | + The default modbus tcp over tls server port (802) |
21 | 21 |
|
22 | 22 |
|
23 | | - .. attribute:: Backoff |
| 23 | + .. attribute:: Backoff |
24 | 24 |
|
25 | | - The default exponential backoff delay (0.3 seconds) for a request |
| 25 | + The default exponential backoff delay (0.3 seconds) for a request |
26 | 26 |
|
27 | | - .. attribute:: Retries |
| 27 | + .. attribute:: Retries |
28 | 28 |
|
29 | | - The default number of times a client should retry the given |
30 | | - request before failing (3) |
| 29 | + The default number of times a client should retry the given |
| 30 | + request before failing (3) |
31 | 31 |
|
32 | | - .. attribute:: RetryOnEmpty |
| 32 | + .. attribute:: RetryOnEmpty |
33 | 33 |
|
34 | | - A flag indicating if a transaction should be retried in the |
35 | | - case that an empty response is received. This is useful for |
36 | | - slow clients that may need more time to process a request. |
| 34 | + A flag indicating if a transaction should be retried in the |
| 35 | + case that an empty response is received. This is useful for |
| 36 | + slow clients that may need more time to process a request. |
37 | 37 |
|
38 | | - .. attribute:: RetryOnInvalid |
| 38 | + .. attribute:: RetryOnInvalid |
39 | 39 |
|
40 | | - A flag indicating if a transaction should be retried in the |
41 | | - case that an invalid response is received. |
| 40 | + A flag indicating if a transaction should be retried in the |
| 41 | + case that an invalid response is received. |
42 | 42 |
|
43 | | - .. attribute:: Timeout |
| 43 | + .. attribute:: Timeout |
44 | 44 |
|
45 | | - The default amount of time a client should wait for a request |
46 | | - to be processed (3 seconds) |
| 45 | + The default amount of time a client should wait for a request |
| 46 | + to be processed (3 seconds) |
47 | 47 |
|
48 | | - .. attribute:: Reconnects |
| 48 | + .. attribute:: Reconnects |
49 | 49 |
|
50 | | - The default number of times a client should attempt to reconnect |
51 | | - before deciding the server is down (0) |
| 50 | + The default number of times a client should attempt to reconnect |
| 51 | + before deciding the server is down (0) |
52 | 52 |
|
53 | | - .. attribute:: TransactionId |
| 53 | + .. attribute:: TransactionId |
54 | 54 |
|
55 | | - The starting transaction identifier number (0) |
| 55 | + The starting transaction identifier number (0) |
56 | 56 |
|
57 | | - .. attribute:: ProtocolId |
| 57 | + .. attribute:: ProtocolId |
58 | 58 |
|
59 | | - The modbus protocol id. Currently, this is set to 0 in all |
60 | | - but proprietary implementations. |
| 59 | + The modbus protocol id. Currently, this is set to 0 in all |
| 60 | + but proprietary implementations. |
61 | 61 |
|
62 | | - .. attribute:: Slave |
| 62 | + .. attribute:: Slave |
63 | 63 |
|
64 | | - The modbus slave address. Currently, this is set to 0x00 which |
65 | | - means this request should be broadcast to all the slave devices |
66 | | - (really means that all the devices should respond). |
| 64 | + The modbus slave address. Currently, this is set to 0x00 which |
| 65 | + means this request should be broadcast to all the slave devices |
| 66 | + (really means that all the devices should respond). |
67 | 67 |
|
68 | | - .. attribute:: Baudrate |
| 68 | + .. attribute:: Baudrate |
69 | 69 |
|
70 | | - The speed at which the data is transmitted over the serial line. |
71 | | - This defaults to 19200. |
| 70 | + The speed at which the data is transmitted over the serial line. |
| 71 | + This defaults to 19200. |
72 | 72 |
|
73 | | - .. attribute:: Parity |
| 73 | + .. attribute:: Parity |
74 | 74 |
|
75 | | - The type of checksum to use to verify data integrity. This can be |
76 | | - on of the following:: |
| 75 | + The type of checksum to use to verify data integrity. This can be |
| 76 | + on of the following:: |
77 | 77 |
|
78 | | - - (E)ven - 1 0 1 0 | P(0) |
79 | | - - (O)dd - 1 0 1 0 | P(1) |
80 | | - - (N)one - 1 0 1 0 | no parity |
| 78 | + - (E)ven - 1 0 1 0 | P(0) |
| 79 | + - (O)dd - 1 0 1 0 | P(1) |
| 80 | + - (N)one - 1 0 1 0 | no parity |
81 | 81 |
|
82 | | - This defaults to (N)one. |
| 82 | + This defaults to (N)one. |
83 | 83 |
|
84 | | - .. attribute:: Bytesize |
| 84 | + .. attribute:: Bytesize |
85 | 85 |
|
86 | | - The number of bits in a byte of serial data. This can be one of |
87 | | - 5, 6, 7, or 8. This defaults to 8. |
| 86 | + The number of bits in a byte of serial data. This can be one of |
| 87 | + 5, 6, 7, or 8. This defaults to 8. |
88 | 88 |
|
89 | | - .. attribute:: Stopbits |
| 89 | + .. attribute:: Stopbits |
90 | 90 |
|
91 | | - The number of bits sent after each character in a message to |
92 | | - indicate the end of the byte. This defaults to 1. |
| 91 | + The number of bits sent after each character in a message to |
| 92 | + indicate the end of the byte. This defaults to 1. |
93 | 93 |
|
94 | | - .. attribute:: ZeroMode |
| 94 | + .. attribute:: ZeroMode |
95 | 95 |
|
96 | | - Indicates if the slave datastore should use indexing at 0 or 1. |
97 | | - More about this can be read in section 4.4 of the modbus specification. |
| 96 | + Indicates if the slave datastore should use indexing at 0 or 1. |
| 97 | + More about this can be read in section 4.4 of the modbus specification. |
98 | 98 |
|
99 | | - .. attribute:: IgnoreMissingSlaves |
| 99 | + .. attribute:: IgnoreMissingSlaves |
100 | 100 |
|
101 | | - In case a request is made to a missing slave, this defines if an error |
102 | | - should be returned or simply ignored. This is useful for the case of a |
103 | | - serial server emulater where a request to a non-existent slave on a bus |
104 | | - will never respond. The client in this case will simply timeout. |
| 101 | + In case a request is made to a missing slave, this defines if an error |
| 102 | + should be returned or simply ignored. This is useful for the case of a |
| 103 | + serial server emulater where a request to a non-existent slave on a bus |
| 104 | + will never respond. The client in this case will simply timeout. |
105 | 105 |
|
106 | | - .. attribute:: broadcastEnable |
| 106 | + .. attribute:: broadcastEnable |
107 | 107 |
|
108 | | - When False unit_id 0 will be treated as any other unit_id. When True and |
109 | | - the unit_id is 0 the server will execute all requests on all server |
110 | | - contexts and not respond and the client will skip trying to receive a |
111 | | - response. Default value False does not conform to Modbus spec but maintains |
112 | | - legacy behavior for existing pymodbus users. |
113 | | - |
114 | | - .. attribute: reconnectDelayMin |
| 108 | + When False unit_id 0 will be treated as any other unit_id. When True and |
| 109 | + the unit_id is 0 the server will execute all requests on all server |
| 110 | + contexts and not respond and the client will skip trying to receive a |
| 111 | + response. Default value False does not conform to Modbus spec but maintains |
| 112 | + legacy behavior for existing pymodbus users. |
115 | 113 |
|
116 | | - When a connection has been dropped, the client will initially wait |
117 | | - reconnectDelayMin milliseconds before attempting a reconnect. If the |
118 | | - attempt fails, it will double the delay before attempting again, up to a |
119 | | - a maximum of ReconnectDelayMax. (binary exponential backoff). |
120 | | - |
121 | | - .. attribute: reconnectDelayMax |
| 114 | + .. attribute: reconnectDelayMin |
122 | 115 |
|
123 | | - When a connection has been dropped, the client will initially wait |
124 | | - reconnectDelayMin milliseconds before attempting a reconnect. If the |
125 | | - attempt fails, it will double the delay before attempting again, up to a |
126 | | - a maximum of ReconnectDelayMax. (binary exponential backoff) |
| 116 | + When a connection has been dropped, the client will initially wait |
| 117 | + reconnectDelayMin milliseconds before attempting a reconnect. If the |
| 118 | + attempt fails, it will double the delay before attempting again, up to a |
| 119 | + a maximum of ReconnectDelayMax. (binary exponential backoff). |
| 120 | +
|
| 121 | + .. attribute: reconnectDelayMax |
| 122 | +
|
| 123 | + When a connection has been dropped, the client will initially wait |
| 124 | + reconnectDelayMin milliseconds before attempting a reconnect. If the |
| 125 | + attempt fails, it will double the delay before attempting again, up to a |
| 126 | + a maximum of ReconnectDelayMax. (binary exponential backoff) |
127 | 127 |
|
128 | 128 |
|
129 | 129 | """ |
|
0 commit comments