@@ -7,6 +7,11 @@ to work with standard Modbus Protocol.
77Modbus Tools are a free, open-source tools with a simple user interface written in C++/Qt.
88It implements TCP, RTU and ASCII versions of Modbus Protocol.
99
10+ ### * New in version 0.4* :
11+
12+ * From now server application allows you to create program logic for the Modbus device simulator
13+ using your favorite Python programming language.*
14+
1015Software implements such Modbus functions as:
1116* ` 1 ` (` 0x01 ` ) - ` READ_COILS `
1217* ` 2 ` (` 0x02 ` ) - ` READ_DISCRETE_INPUTS `
@@ -17,6 +22,7 @@ Software implements such Modbus functions as:
1722* ` 7 ` (` 0x07 ` ) - ` READ_EXCEPTION_STATUS `
1823* ` 15 ` (` 0x0F ` ) - ` WRITE_MULTIPLE_COILS `
1924* ` 16 ` (` 0x10 ` ) - ` WRITE_MULTIPLE_REGISTERS `
25+ * ` 17 ` (` 0x11 ` ) - ` REPORT_SERVER_ID ` (since v0.4)
2026* ` 22 ` (` 0x16 ` ) - ` MASK_WRITE_REGISTER ` (since v0.3)
2127* ` 23 ` (` 0x17 ` ) - ` READ_WRITE_MULTIPLE_REGISTERS ` (since v0.3)
2228
@@ -94,6 +100,47 @@ Device contains settings for a single device (such as Modbus Unit Address, memor
94100The DataViewItem contains a single data unit to be read/write from the device and has many formats to
95101represent the current data. Action provides simulation capabilities (automatic change of device memory values).
96102
103+ ### Scripting using Python (since v0.4)
104+
105+ Since v0.4 version 'server' application allows to extend logic of your Modbus device
106+ simulator using one the most popular programming language - Python.
107+ All you need to use scripting is installed Python interpreter and ` PyQt5 ` library.
108+
109+ ` server ` application gives you access to the device's internal Modbus memory and
110+ provides ` Output ` window where standard output is redirected.
111+ The rest is the power of Python, its standard library, 3rd party libraries,
112+ and your own libraries and scripts.
113+
114+ Objects for access corresponding device memory: ` mem0x ` , ` mem1x ` , ` mem3x ` , ` mem4x ` .
115+
116+ Every object has set of get/set function to work with different data types:
117+ * ` mem0x ` , ` mem1x ` : ` get<datatype>(bitoffset:int)->int ` and ` set<datatype>(bitoffset:int,value:int) `
118+ * ` mem3x ` , ` mem4x ` : ` get<datatype>(regoffset:int)->int ` and ` set<datatype>(regoffset:int,value:int) `
119+
120+ ` <datatype> ` : ` int8 ` , ` uint8 ` , ` int16 ` , ` uint16 ` , ` int32 ` , ` uint32 ` , ` int64 ` , ` uint64 ` , ` float ` , ` double ` .
121+
122+ Examples:
123+ ``` python
124+ v = mem0x.getint8(0 )
125+ mem1x.setint16(1 , - 1 )
126+ mem3x.setuint16(0 , 65535 )
127+ mem4x.setdouble(10 , 2.71828 )
128+ ```
129+
130+ Also index operation is supported.
131+ In case of discrete memory (` mem0x ` , ` mem1x ` ) it work with ` boolean ` values
132+ and for registers memory (` mem3x ` , ` mem4x ` ) it work with ` uint16 ` values:
133+
134+ ``` python
135+ b0 = mem0x[0 ]
136+ mem1x[38 ] = True
137+ mem3x[100 ] = 65535
138+ if mem4x[0 ] > 32768 :
139+ mem4x[0 ] = 0
140+ ```
141+
142+ To view all documentation and possible uses of objects and methods, use the built-in help system.
143+
97144### Server Actions window
98145
99146The server has the ability to simulate/change data (actions, automaticaly change values) with predefined
0 commit comments