Commit 13340e4
committed
Test dev (#240)
* PYM-2:
- The issue listed was due to wrong messages being passed by the user.
Upon passing the right messages codes, the parser works as expected
on all counts.
- There is also changes that make the parser compatible with python2
and python3
- Verifier that the tool works on both python3 and python2 for all
MODBUS message codes on TCP, RTU, and BIN
* PYM-2: Checking the incoming framer. If te Framer is a Binary Framer,
we take the unit address as the second incoming bite as opposed
to the first bite.
This is was done while fixing the message parsers for binary messages
* PYM-2: Changed the modbus binary header size from 2 to 1.
According to the docs:
Modbus Binary Frame Controller::
[ Start ][Address ][ Function ][ Data ][ CRC ][ End ]
1b 1b 1b Nb 2b 1b
* PYM-3: Script is now compatible with both python2 and python3
* WIP
* PYM-2: Added a new switch: -t --transaction
This switch is meant to be used when we wish to parse messages directly
from the logs of Modbus.
The format of a message as shown in the logs is like bellow:
0x7b 0x1 0x5 0x0 0x0 0xff 0x0 0x8c 0x3a 0x7d
We can pass this as the message to the parser along with the -t witch
to convert it into a compatible message to be parsed.
EG:
(modbus3) [~/pymodbus/examples/contrib]$ ./message-parser.py -b -t -p binary -m "0x7b 0x1 0x5 0x0 0x0 0xff 0x0 0x8c 0x3a 0x7d"
================================================================================
Decoding Message b'7b01050000ff008c3a7d'
================================================================================
ServerDecoder
--------------------------------------------------------------------------------
name = WriteSingleCoilRequest
transaction_id = 0x0
protocol_id = 0x0
unit_id =
. [1]
skip_encode = 0x0
check = 0x0
address = 0x0
value = 0x1
documentation =
This function code is used to write a single output to either ON or OFF
in a remote device.
The requested ON/OFF state is specified by a constant in the request
data field. A value of FF 00 hex requests the output to be ON. A value
of 00 00 requests it to be OFF. All other values are illegal and will
not affect the output.
The Request PDU specifies the address of the coil to be forced. Coils
are addressed starting at zero. Therefore coil numbered 1 is addressed
as 0. The requested ON/OFF state is specified by a constant in the Coil
Value field. A value of 0XFF00 requests the coil to be ON. A value of
0X0000 requests the coil to be off. All other values are illegal and
will not affect the coil.
ClientDecoder
--------------------------------------------------------------------------------
name = WriteSingleCoilResponse
transaction_id = 0x0
protocol_id = 0x0
unit_id =
. [1]
skip_encode = 0x0
check = 0x0
address = 0x0
value = 0x1
documentation =
The normal response is an echo of the request, returned after the coil
state has been written.
* PYM-2: Removing additional dependancy and making use of existing porting tools
* PYM-3: Removing additional dependancy and making use of existing porting tools
* Initial Bitbucket Pipelines configuration
* bitbucket-pipelines.yml edited online with Bitbucket
* bitbucket-pipelines.yml edited online with Bitbucket
* PYM-2: Updated the transaction tests for BinaryFramerTransaction.
The header for Binary trasaction is of size 1. This was recrtified
earlier commits of this branch.
The test ensure these changes
* PYM-6: Minor Cleanup task
Removing the argument handler in TCP Syncronous server.
This argument is not used any where.
* PYM-6:
ModbusUdpServer and ModbusTcpServer will now accept any legal
Modbus request handler. The request handler being passed will have
to be of instance ModbusBaseRequestHandler.
The default request handler is ModbusDisconnectedRequestHandler.
I.e., is no handler is passed, or if the handler is not of type
ModbusBaseRequestHandler, ModbusDisconnectedRequestHandler will
be made use of.
* PYM-6: Removing uneccessary check if handler is of type ModbusBaseRequestHandler
* PYM-8: Example that read from a database as a datastore
* PYM-8: Added two new datastores that can be used.
- SQLite3
- Reddis
* Small fixes
* Small fixes
* Small fixes
* Cleanup
* PYM-8: Updated the example to first write a random value at a random afddress to a database and then read from that address
* PYM-8: Added neccessary checks and methods to allow hassle free writes to database. The process first checks if the address and value are already present in the database before performing a write. This ensures that database transaction errors will now occur in cases where repetetive data is being written.
* Cleanup: Removing pdb placed during testing and other comments
* bitbucket-pipelines.yml deleted online with Bitbucket
* #240 Fix PR failures
* #240 fix Travis build failures
* #190 fix import error in dbstore-update-server example
* Small changes and typo fixed in pymodbus utilities and redis datastore helpers
* Added tests for redis datastore helpers
* Minor fixes to SQL datastore
* Unit tests for SQL datastore - 100% coverage
* Tests now compatible with python3 and python21 parent 48b40ab commit 13340e4
File tree
12 files changed
+494
-112
lines changed- examples
- common
- contrib
- pymodbus
- datastore/database
- server
- test
12 files changed
+494
-112
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | | - | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | | - | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
64 | | - | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
100 | | - | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| |||
149 | 151 | | |
150 | 152 | | |
151 | 153 | | |
152 | | - | |
| 154 | + | |
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
156 | | - | |
| 158 | + | |
157 | 159 | | |
158 | | - | |
| 160 | + | |
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
| |||
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
171 | | - | |
172 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
173 | 178 | | |
174 | 179 | | |
175 | | - | |
| 180 | + | |
176 | 181 | | |
177 | | - | |
| 182 | + | |
178 | 183 | | |
179 | 184 | | |
180 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
36 | | - | |
| 40 | + | |
37 | 41 | | |
38 | | - | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
| |||
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
67 | | - | |
| 74 | + | |
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
| |||
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
89 | | - | |
| 96 | + | |
90 | 97 | | |
91 | 98 | | |
92 | 99 | | |
| |||
102 | 109 | | |
103 | 110 | | |
104 | 111 | | |
105 | | - | |
| 112 | + | |
106 | 113 | | |
107 | | - | |
| 114 | + | |
108 | 115 | | |
109 | 116 | | |
110 | 117 | | |
| |||
136 | 143 | | |
137 | 144 | | |
138 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
139 | 150 | | |
140 | 151 | | |
141 | 152 | | |
| |||
150 | 161 | | |
151 | 162 | | |
152 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
153 | 172 | | |
154 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
155 | 177 | | |
156 | 178 | | |
157 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments