Introduction into Modbus protocol and creation of simple server-client application.
- OS: Ubuntu 20.04
- C compiler: gcc 9.3.0
- Third party libraries: libmodbus
There are some steps required to perfom before You will be able to compile this project:
- Clone the libmodbus Github repository.
$ mkdir -p ~/workspace/third_party && cd ~/workspace/third_party/
$ git clone https://github.com/stephane/libmodbus- Install
libmodbuslibrary:
$ cd libmodbus/
$ ./autogen.sh
$ ./configure && make install- Create
modbus.conffile in/etc/ld.so.conf.d/:
$ sudo touch /etc/ld.so.conf.d/modbus.confUse your favourite text editor (e.g. Vim) and populate it with
/usr/local/lib/ (or other path, where libmodbus.so is placed):
$ sudo vi /etc/ld.so.conf.d/modbus.confUpdate your system linker:
$ sudo ldconfigNow You should be able to compile the application using attached Makefile.
To build the application, just run single command:
$ make allThe application executables should be placed inside ./build/ directory.
To remove them, run:
$ make clean