Skip to content

Commit c5772b3

Browse files
committed
Merge branch 'dev'
2 parents 731b080 + d2d1974 commit c5772b3

37 files changed

+133
-90
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ jobs:
158158
mkdir --parents $(dirname $PYPY_EXTERNALS_PATH)
159159
hg clone https://foss.heptapod.net/pypy/externals/ $PYPY_EXTERNALS_PATH
160160
dir $PYPY_EXTERNALS_PATH
161-
cd $PYPY_EXTERNALS_PATH && hg update win32_14x
161+
cd $PYPY_EXTERNALS_PATH && hg update win$(python -c 'import struct; print(struct.calcsize("P") * 8)')_14x
162162
echo "INCLUDE=$PYPY_EXTERNALS_PATH/include;$INCLUDE" >> $GITHUB_ENV
163163
echo "LIB=$PYPY_EXTERNALS_PATH/lib;$LIB" >> $GITHUB_ENV
164164
# echo "CL=${{ matrix.PYTHON.CL_FLAGS }}" >> $GITHUB_ENV

CHANGELOG.rst

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
version 2.5.3
2+
----------------------------------------------------------
3+
* Fix retries on tcp client failing randomly.
4+
* Fix Asyncio client timeout arg not being used.
5+
* Treat exception codes as valid responses
6+
* Fix examples (modbus_payload)
7+
* Add missing identity argument to async ModbusSerialServer
8+
19
version 2.5.2
210
----------------------------------------------------------
311
* Add kwarg `reset_socket` to control closing of the socket on read failures (set to `True` by default).

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ For those of you that just want to get started fast, here you go::
8989
client.close()
9090

9191
For more advanced examples, check out the `Examples <https://pymodbus.readthedocs.io/en/dev/source/example/modules.html>`_ included in the
92-
respository. If you have created any utilities that meet a specific
92+
repository. If you have created any utilities that meet a specific
9393
need, feel free to submit them so others can benefit.
9494

9595
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -113,7 +113,7 @@ get lost in the noise: http://groups.google.com/group/pymodbus or
113113
at gitter: https://gitter.im/pymodbus_dev/Lobby
114114

115115
.. important::
116-
**Note For async clients, it is recomended to use `asyncio` as the async facilitator (Python 3.6 and above).**
116+
**Note For async clients, it is recommended to use `asyncio` as the async facilitator (Python 3.6 and above).**
117117
**If using tornado make sure the tornado version is `4.5.3`.Other versions of tornado can break the implementation**
118118

119119

examples/common/async_asyncio_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
--------------------------------------------------------------------------
55
66
The following is an example of how to use the asynchronous modbus
7-
client implementation from pymodbus with ayncio.
7+
client implementation from pymodbus with asyncio.
88
99
The example is only valid on Python3.4 and above
1010
"""

examples/common/async_asyncio_serial_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
--------------------------------------------------------------------------
55
66
The following is an example of how to use the asynchronous serial modbus
7-
client implementation from pymodbus with ayncio.
7+
client implementation from pymodbus with asyncio.
88
99
The example is only valid on Python3.4 and above
1010
"""

examples/common/asynchronous_processor.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
free to use it as a skeleton guide in implementing your own.
88
"""
99
# --------------------------------------------------------------------------- #
10-
# import the neccessary modules
10+
# import the necessary modules
1111
# --------------------------------------------------------------------------- #
1212
from twisted.internet import serialport, reactor
1313
from twisted.internet.protocol import ClientFactory
@@ -46,7 +46,7 @@
4646
# --------------------------------------------------------------------------- #
4747
# an example custom protocol
4848
# --------------------------------------------------------------------------- #
49-
# Here you can perform your main procesing loop utilizing defereds and timed
49+
# Here you can perform your main processing loop utilizing defereds and timed
5050
# callbacks.
5151
# --------------------------------------------------------------------------- #
5252
class ExampleProtocol(ModbusClientProtocol):

examples/common/modbus_payload.py

+34-15
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,31 @@ def run_binary_payload_ex():
3535
# ----------------------------------------------------------------------- #
3636
client = ModbusClient('127.0.0.1', port=5020)
3737
client.connect()
38-
38+
3939
# ----------------------------------------------------------------------- #
4040
# If you need to build a complex message to send, you can use the payload
4141
# builder to simplify the packing logic.
4242
#
4343
# Here we demonstrate packing a random payload layout, unpacked it looks
4444
# like the following:
4545
#
46-
# - a 8 byte string 'abcdefgh'
47-
# - a 32 bit float 22.34
48-
# - a 16 bit unsigned int 0x1234
49-
# - another 16 bit unsigned int 0x5678
50-
# - an 8 bit int 0x12
46+
# - an 8 byte string "abcdefgh"
5147
# - an 8 bit bitstring [0,1,0,1,1,0,1,0]
52-
# - an 32 bit uint 0x12345678
53-
# - an 32 bit signed int -0x1234
54-
# - an 64 bit signed int 0x12345678
48+
# - an 8 bit int -0x12
49+
# - an 8 bit unsigned int 0x12
50+
# - a 16 bit int -0x5678
51+
# - a 16 bit unsigned int 0x1234
52+
# - a 32 bit int -0x1234
53+
# - a 32 bit unsigned int 0x12345678
54+
# - a 16 bit float 12.34
55+
# - a 16 bit float -12.34
56+
# - a 32 bit float 22.34
57+
# - a 32 bit float -22.34
58+
# - a 64 bit int -0xDEADBEEF
59+
# - a 64 bit unsigned int 0x12345678DEADBEEF
60+
# - another 64 bit unsigned int 0x12345678DEADBEEF
61+
# - a 64 bit float 123.45
62+
# - a 64 bit float -123.45
5563

5664
# The packing can also be applied to the word (wordorder) and bytes in each
5765
# word (byteorder)
@@ -123,12 +131,23 @@ def run_binary_payload_ex():
123131
# Here we demonstrate decoding a random register layout, unpacked it looks
124132
# like the following:
125133
#
126-
# - a 8 byte string 'abcdefgh'
127-
# - a 32 bit float 22.34
128-
# - a 16 bit unsigned int 0x1234
129-
# - another 16 bit unsigned int which we will ignore
130-
# - an 8 bit int 0x12
134+
# - an 8 byte string "abcdefgh"
131135
# - an 8 bit bitstring [0,1,0,1,1,0,1,0]
136+
# - an 8 bit int -0x12
137+
# - an 8 bit unsigned int 0x12
138+
# - a 16 bit int -0x5678
139+
# - a 16 bit unsigned int 0x1234
140+
# - a 32 bit int -0x1234
141+
# - a 32 bit unsigned int 0x12345678
142+
# - a 16 bit float 12.34
143+
# - a 16 bit float -12.34
144+
# - a 32 bit float 22.34
145+
# - a 32 bit float -22.34
146+
# - a 64 bit int -0xDEADBEEF
147+
# - a 64 bit unsigned int 0x12345678DEADBEEF
148+
# - another 64 bit unsigned int which we will ignore
149+
# - a 64 bit float 123.45
150+
# - a 64 bit float -123.45
132151
# ----------------------------------------------------------------------- #
133152
address = 0x0
134153
count = len(payload)
@@ -174,7 +193,7 @@ def run_binary_payload_ex():
174193
print("-" * 60)
175194
for name, value in iteritems(decoded):
176195
print("%s\t" % name, hex(value) if isinstance(value, int) else value)
177-
196+
178197
# ----------------------------------------------------------------------- #
179198
# close the client
180199
# ----------------------------------------------------------------------- #

examples/contrib/asynchronous_asyncio_modbus_tls_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
the TLS feature and asyncio.
99
"""
1010
# -------------------------------------------------------------------------- #
11-
# import neccessary libraries
11+
# import necessary libraries
1212
# -------------------------------------------------------------------------- #
1313
import ssl
1414
from pymodbus.client.asynchronous.tls import AsyncModbusTLSClient

examples/contrib/bcd_payload.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def add_string(self, value):
142142
class BcdPayloadDecoder(object):
143143
"""
144144
A utility that helps decode binary coded decimal payload
145-
messages from a modbus reponse message. What follows is
145+
messages from a modbus response message. What follows is
146146
a simple example::
147147
148148
decoder = BcdPayloadDecoder(payload)

examples/contrib/concurrent_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from futures import Future
2727

2828
# -------------------------------------------------------------------------- #
29-
# import neccessary modbus libraries
29+
# import necessary modbus libraries
3030
# -------------------------------------------------------------------------- #
3131
from pymodbus.client.common import ModbusClientMixin
3232

examples/contrib/message_parser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __init__(self, framer, encode=False):
5353
def decode(self, message):
5454
""" Attempt to decode the supplied message
5555
56-
:param message: The messge to decode
56+
:param message: The message to decode
5757
"""
5858
if IS_PYTHON3:
5959
value = message if self.encode else c.encode(message, 'hex_codec')

examples/contrib/modbus_saver.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
class ModbusDatastoreSaver(object):
3434
""" An abstract base class that can be used to implement
3535
a persistance format for the modbus server context. In
36-
order to use it, just complete the neccessary callbacks
36+
order to use it, just complete the necessary callbacks
3737
(SAX style) that your persistance format needs.
3838
"""
3939

examples/contrib/modbus_simulator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def parse(self):
8585
""" Parses the config file and creates a server context
8686
"""
8787
handle = pickle.load(self.file)
88-
try: # test for existance, or bomb
88+
try: # test for existence, or bomb
8989
dsd = handle['di']
9090
csd = handle['ci']
9191
hsd = handle['hr']

examples/contrib/modbus_tls_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
feature.
99
"""
1010
# -------------------------------------------------------------------------- #
11-
# import neccessary libraries
11+
# import necessary libraries
1212
# -------------------------------------------------------------------------- #
1313
import ssl
1414
from pymodbus.client.sync import ModbusTlsClient

examples/contrib/modicon_payload.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def add_string(self, value):
147147
class ModiconPayloadDecoder(object):
148148
"""
149149
A utility that helps decode modicon encoded payload
150-
messages from a modbus reponse message. What follows is
150+
messages from a modbus response message. What follows is
151151
a simple example::
152152
153153
decoder = ModiconPayloadDecoder(payload)

examples/contrib/remote_server_context.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def __iter__(self):
174174
def __contains__(self, slave):
175175
""" Check if the given slave is in this list
176176
177-
:param slave: slave The slave to check for existance
177+
:param slave: slave The slave to check for existence
178178
:returns: True if the slave exists, False otherwise
179179
"""
180180
# we don't want to check the cache here as the

examples/gui/bottle/frontend.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def build_application(server):
223223
""" Helper method to create and initiailze a bottle application
224224
225225
:param server: The modbus server to pull instance data from
226-
:returns: An initialied bottle application
226+
:returns: An initialized bottle application
227227
"""
228228
log.info("building web application")
229229
api = ModbusApiWebApp(server)

examples/gui/bottle/media/js/backbone.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@
11611161
tagName: 'div',
11621162

11631163
// jQuery delegate for element lookup, scoped to DOM elements within the
1164-
// current view. This should be prefered to global lookups where possible.
1164+
// current view. This should be preferred to global lookups where possible.
11651165
$: function(selector) {
11661166
return this.$el.find(selector);
11671167
},

examples/tools/build_datastore.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __str__(self):
3333
# Datablock Builders
3434
#--------------------------------------------------------------------------#
3535
def build_translation(option, opt, value, parser):
36-
""" Converts a register dump list to a pickeld datastore
36+
""" Converts a register dump list to a pickled datastore
3737
3838
:param option: The option instance
3939
:param opt: The option string specified

0 commit comments

Comments
 (0)