File tree Expand file tree Collapse file tree 11 files changed +101
-12
lines changed
Expand file tree Collapse file tree 11 files changed +101
-12
lines changed Original file line number Diff line number Diff line change 2828"""
2929import asyncio
3030import logging
31+ import sys
3132
32- import helper
33+
34+ try :
35+ import helper
36+ except ImportError :
37+ print ("*** ERROR --> THIS EXAMPLE needs the example directory, please see \n \
38+ https://pymodbus.readthedocs.io/en/latest/source/examples.html\n \
39+ for more information." )
40+ sys .exit (- 1 )
3341
3442import pymodbus .client as modbusClient
3543from pymodbus import ModbusException
Original file line number Diff line number Diff line change 3131"""
3232import asyncio
3333import logging
34+ import sys
3435
35- import client_async
3636
37+ try :
38+ import client_async
39+ except ImportError :
40+ print ("*** ERROR --> THIS EXAMPLE needs the example directory, please see \n \
41+ https://pymodbus.readthedocs.io/en/latest/source/examples.html\n \
42+ for more information." )
43+ sys .exit (- 1 )
3744
3845_logger = logging .getLogger (__file__ )
3946_logger .setLevel ("DEBUG" )
Original file line number Diff line number Diff line change 3030 ./server_async.py
3131"""
3232import logging
33+ import sys
34+
35+
36+ try :
37+ import client_sync
38+ except ImportError :
39+ print ("*** ERROR --> THIS EXAMPLE needs the example directory, please see \n \
40+ https://pymodbus.readthedocs.io/en/latest/source/examples.html\n \
41+ for more information." )
42+ sys .exit (- 1 )
3343
34- import client_sync
3544
3645
3746_logger = logging .getLogger (__file__ )
Original file line number Diff line number Diff line change 77Works out of the box together with payload_server.py
88"""
99import asyncio
10+ import sys
1011from collections import OrderedDict
1112
12- import client_async
13+
14+ try :
15+ import client_async
16+ except ImportError :
17+ print ("*** ERROR --> THIS EXAMPLE needs the example directory, please see \n \
18+ https://pymodbus.readthedocs.io/en/latest/source/examples.html\n \
19+ for more information." )
20+ sys .exit (- 1 )
1321
1422from pymodbus .constants import Endian
1523from pymodbus .payload import BinaryPayloadBuilder , BinaryPayloadDecoder
Original file line number Diff line number Diff line change 3131
3232"""
3333import logging
34+ import sys
3435
35- import helper
36+
37+ try :
38+ import helper
39+ except ImportError :
40+ print ("*** ERROR --> THIS EXAMPLE needs the example directory, please see \n \
41+ https://pymodbus.readthedocs.io/en/latest/source/examples.html\n \
42+ for more information." )
43+ sys .exit (- 1 )
3644
3745import pymodbus .client as modbusClient
3846from pymodbus import ModbusException
Original file line number Diff line number Diff line change 1818"""
1919import asyncio
2020import logging
21+ import sys
2122
22- import helper
23+
24+ try :
25+ import helper
26+ except ImportError :
27+ print ("*** ERROR --> THIS EXAMPLE needs the example directory, please see \n \
28+ https://pymodbus.readthedocs.io/en/latest/source/examples.html\n \
29+ for more information." )
30+ sys .exit (- 1 )
2331
2432from pymodbus .client import ModbusTcpClient
2533from pymodbus .datastore import ModbusServerContext
Original file line number Diff line number Diff line change 3434"""
3535import asyncio
3636import logging
37+ import sys
3738
38- import helper
39+
40+ try :
41+ import helper
42+ except ImportError :
43+ print ("*** ERROR --> THIS EXAMPLE needs the example directory, please see \n \
44+ https://pymodbus.readthedocs.io/en/latest/source/examples.html\n \
45+ for more information." )
46+ sys .exit (- 1 )
3947
4048from pymodbus import __version__ as pymodbus_version
4149from pymodbus .datastore import (
Original file line number Diff line number Diff line change 66"""
77import asyncio
88import logging
9+ import sys
910
10- import server_async
11+
12+ try :
13+ import server_async
14+ except ImportError :
15+ print ("*** ERROR --> THIS EXAMPLE needs the example directory, please see \n \
16+ https://pymodbus.readthedocs.io/en/latest/source/examples.html\n \
17+ for more information." )
18+ sys .exit (- 1 )
1119
1220from pymodbus .datastore import (
1321 ModbusSequentialDataBlock ,
Original file line number Diff line number Diff line change 66"""
77import asyncio
88import logging
9+ import sys
10+
11+
12+ try :
13+ import server_async
14+ except ImportError :
15+ print ("*** ERROR --> THIS EXAMPLE needs the example directory, please see \n \
16+ https://pymodbus.readthedocs.io/en/latest/source/examples.html\n \
17+ for more information." )
18+ sys .exit (- 1 )
919
10- import server_async
1120
1221from pymodbus .constants import Endian
1322from pymodbus .datastore import (
Original file line number Diff line number Diff line change 3535a lot slower.
3636"""
3737import logging
38+ import sys
3839
39- import helper
40- import server_async
40+
41+ try :
42+ import helper
43+ import server_async
44+ except ImportError :
45+ print ("*** ERROR --> THIS EXAMPLE needs the example directory, please see \n \
46+ https://pymodbus.readthedocs.io/en/latest/source/examples.html\n \
47+ for more information." )
48+ sys .exit (- 1 )
4149
4250# --------------------------------------------------------------------------- #
4351# import the various client implementations
You can’t perform that action at this time.
0 commit comments