Skip to content

Latest commit

 

History

History
86 lines (53 loc) · 1.56 KB

readme.md

File metadata and controls

86 lines (53 loc) · 1.56 KB

Modbus C Application

Overview

Project goal

Introduction into Modbus protocol and creation of simple server-client application.

System requirements

  • OS: Ubuntu 20.04
  • C compiler: gcc 9.3.0
  • Third party libraries: libmodbus

libmodbus installation guide

There are some steps required to perfom before You will be able to compile this project:

  1. Clone the libmodbus Github repository.
$ mkdir -p ~/workspace/third_party && cd ~/workspace/third_party/
$ git clone https://github.com/stephane/libmodbus
  1. Install libmodbus library:
$ cd libmodbus/
$ ./autogen.sh
$ ./configure && make install
  1. Create modbus.conf file in /etc/ld.so.conf.d/:
$ sudo touch /etc/ld.so.conf.d/modbus.conf

Use 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.conf

Update your system linker:

$ sudo ldconfig

Now You should be able to compile the application using attached Makefile.

Build process

To build the application, just run single command:

$ make all

The application executables should be placed inside ./build/ directory.

To remove them, run:

$ make clean