@@ -15,7 +15,7 @@ Software implements such Modbus functions as:
1515* ` 15 ` (` 0x0F ` ) - ` WRITE_MULTIPLE_COILS `
1616* ` 16 ` (` 0x10 ` ) - ` WRITE_MULTIPLE_REGISTERS `
1717* ` 22 ` (` 0x16 ` ) - ` MASK_WRITE_REGISTER ` (since v0.3)
18- * ` 23 ` (` 0x17 ` ) - ` WRITE_MULTIPLE_REGISTERS ` (since v0.3)
18+ * ` 23 ` (` 0x17 ` ) - ` READ_WRITE_MULTIPLE_REGISTERS ` (since v0.3)
1919
2020ModbusTools work with Qt Framework version 5 (5.8 or later).
2121It based on ` ModbusLib ` cross platform library project:
@@ -77,200 +77,3 @@ The server has the ability to simulate data (actions, automaticaly change values
7777* ` Copy ` - move data from one memory part to another (with same or different memory types)
7878
7979![ ] ( ./doc/images/server_actions_window.png )
80-
81- ## Building ModbusTools from source on Windows
82-
83- ### Preparation
84-
85- The ModbusTools project requires Qt version 5.8 or later.
86-
87- 1 . Download qt-online-installer, follow the link and choose Windows version for installer:
88-
89- https://www.qt.io/download-qt-installer
90-
91- 2 . Run qt-online-installer and install all necessary components: Qt 5 (Qt5.15.2) framework.
92-
93- Qt 5.8 or higher is needed so in ` Select Components ` window check ` Archive ` checkbox and push ` Filter ` button.
94- Then is better to check latest version of Qt5.15 fr (e.g. 5.15.2)
95-
96- 3 . Download and install git for Windows or use WSL and install git for WSL.
97-
98- 4 . Make dir for binaries, e.g. in ` <user-home-dir>\bin\ModbusTools ` using Windows command console:
99- ``` console
100- >cd `<user-home-dir>`
101- >mkdir bin\ModbusTools
102- >cd bin\ModbusTools
103- ```
104- 5. Clone repository:
105- ```console
106- $ git clone --recursive https://github.com/serhmarch/ModbusTools.git
107- ```
108- ### Build using qmake
109-
110- This example shows how to build `ModbusTools` for MSVC compiler using `qmake`.
111-
112- 1. Open Windows command console and initialize all MSVC compiler vars (e.g. include, lib) using `vcvarsall.bat` script.
113- This script will be configured for x64 arch (use `...\vcvarsall.bat -help` to display all options):
114- ```console
115- >"c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
116- ```
117-
118- 2. Run qmake to produce `Makefile`.
119- This command will make `Release` version, for `Debug` replase with `"CONFIG+=debug"`:
120- ```console
121- >C:\Qt\5.15.2\msvc2019_64\bin\qmake.exe path\to\ModbusTools.pro -spec win32-msvc "CONFIG+=release"
122- ```
123-
124- 3. Produce all make files:
125- ```console
126- >C:\Qt\Tools\QtCreator\bin\jom\jom.exe -f Makefile qmake_all
127- ```
128-
129- 4. Build project from Makefile's:
130- ```console
131- >C:\Qt\Tools\QtCreator\bin\jom\jom.exe
132- ```
133-
134- ### Build using cmake
135-
136- 1. Run cmake to generate project (make) files.
137- `CMAKE_PREFIX_PATH` must be set to installed Qt framewrok files:
138- ```console
139- >cmake -DCMAKE_PREFIX_PATH:PATH=C:/Qt/5.15.2/msvc2019_64 -S path\to\ModbusTools -B .
140- ```
141- 2. Make binaries (+ debug|release config):
142- ```console
143- $ cmake --build .
144- $ cmake --build . --config Debug
145- $ cmake --build . --config Release
146- ```
147-
148- 3. Resulting bin files is located in `Debug` or `Release` directory.
149-
150- #### Build using CMakePresets.json
151-
152- ```console
153- cmake --preset "Win64-MSVC-Debug"
154- cmake --build --preset "Win64-MSVC-Debug"
155-
156- cmake --preset "Win64-MSVC-Release"
157- cmake --build --preset "Win64-MSVC-Release"
158- ```
159-
160- ## Building ModbusTools from source on Linux
161-
162- ### Preparation
163-
164- The ModbusTools project requires Qt version 5.8 or later.
165-
166- 1 . Update package list:
167- ``` console
168- $ sudo apt-get update
169- ```
170-
171- 2. Install main build tools like g++, make etc:
172- ```console
173- $ sudo apt-get install build-essential
174- ```
175-
176- 3. Install Qt tools:
177- ```console
178- $ sudo apt-get install qtbase5-dev qttools5-dev
179- ```
180-
181- 4. Check for correct instalation:
182- ```console
183- $ whereis qmake
184- qmake: /usr/bin/qmake
185- $ whereis libQt5Core*
186- libQt5Core.prl: /usr/lib/x86_64-linux-gnu/libQt5Core.prl
187- libQt5Core.so: /usr/lib/x86_64-linux-gnu/libQt5Core.so
188- libQt5Core.so.5: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
189- libQt5Core.so.5.15: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15
190- libQt5Core.so.5.15.3: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3
191- $ whereis libQt5Help*
192- libQt5Help.prl: /usr/lib/x86_64-linux-gnu/libQt5Help.prl
193- libQt5Help.so: /usr/lib/x86_64-linux-gnu/libQt5Help.so
194- libQt5Help.so.5: /usr/lib/x86_64-linux-gnu/libQt5Help.so.5
195- libQt5Help.so.5.15: /usr/lib/x86_64-linux-gnu/libQt5Help.so.5.15
196- libQt5Help.so.5.15.3: /usr/lib/x86_64-linux-gnu/libQt5Help.so.5.15.3
197- ```
198-
199- 5. Install git:
200- ```console
201- $ sudo apt-get install git
202- ```
203-
204- 6. Create project directory, move to it and clone repository:
205- ```console
206- $ cd ~
207- $ mkdir src
208- $ cd src
209- $ git clone --recursive https://github.com/serhmarch/ModbusTools.git
210- ```
211-
212- 7. Create and/or move to directory for build output, e.g. `~/bin/ModbusTools`:
213- ```console
214- $ cd ~
215- $ mkdir -p bin/ModbusTools
216- $ cd bin/ModbusTools
217- ```
218-
219- ### Build using qmake
220-
221- 1. Run qmake to create Makefile for build:
222- ```console
223- $ qmake ~/src/ModbusTools/src/ModbusTools.pro -spec linux-g++
224- ```
225-
226- 2. To ensure Makefile was created print:
227- ```console
228- $ ls -l
229- total 36
230- -rw-r--r-- 1 march march 35001 May 6 18:41 Makefile
231- ```
232- 3. Finaly to make current set of programs print:
233- ```console
234- $ make
235- ```
236-
237- 4. After build step move to `<build_folder>/bin` to ensure everything is correct:
238- ```console
239- $ cd bin
240- $ pwd
241- ~/bin/ModbusTools/bin
242- $ ls -l
243- total 2672
244- -rwxr-xr-x 1 march march 643128 May 6 18:45 client
245- lrwxrwxrwx 1 march march 16 May 6 18:44 libcore.so -> libcore.so.0.1.4
246- lrwxrwxrwx 1 march march 16 May 6 18:44 libcore.so.0 -> libcore.so.0.1.4
247- lrwxrwxrwx 1 march march 16 May 6 18:44 libcore.so.0.1 -> libcore.so.0.1.4
248- -rwxr-xr-x 1 march march 993376 May 6 18:44 libcore.so.0.1.4
249- -rwxr-xr-x 1 march march 907872 May 6 18:47 server
250- ```
251- ### Build using cmake
252-
253- 1. Run cmake to generate project (make) files.
254- ```console
255- $ cmake -S ~/src/ModbusTools -B .
256- ```
257-
258- 2. Make binaries (+ debug|release config):
259- ```console
260- $ cmake --build .
261- $ cmake --build . --config Debug
262- $ cmake --build . --config Release
263- ```
264-
265- 3. Resulting bin files is located in `./bin` directory.
266-
267- #### Build using CMakePresets.json
268-
269- ```console
270- cmake --preset "Linux-Debug"
271- cmake --build --preset "Linux-Debug"
272-
273- cmake --preset "Linux-Release"
274- cmake --build --preset "Linux-Release"
275-
276-
0 commit comments