README
changeset 0 ae252e0fd9b8
equal deleted inserted replaced
-1:000000000000 0:ae252e0fd9b8
       
     1 /*
       
     2  * Copyright (c) 2001-2003,2016 Mario de Sousa (msousa@fe.up.pt)
       
     3  *
       
     4  * This file is part of the Modbus library for Beremiz and matiec.
       
     5  *
       
     6  * This Modbus library is free software: you can redistribute it and/or modify
       
     7  * it under the terms of the GNU Lesser General Public License as published by
       
     8  * the Free Software Foundation, either version 3 of the License, or
       
     9  * (at your option) any later version.
       
    10  *
       
    11  * This program is distributed in the hope that it will be useful, but
       
    12  * WITHOUT ANY WARRANTY; without even the implied warranty of
       
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
       
    14  * General Public License for more details.
       
    15  *
       
    16  * You should have received a copy of the GNU Lesser General Public License
       
    17  * along with this Modbus library.  If not, see <http://www.gnu.org/licenses/>.
       
    18  *
       
    19  * This code is made available on the understanding that it will not be
       
    20  * used in safety-critical situations without a full and competent review.
       
    21  */
       
    22 
       
    23 
       
    24 
       
    25   Modbus Protocol Libraries
       
    26   =========================
       
    27 
       
    28   This directory contains the libararies that implement the modbus protocol
       
    29   stack.
       
    30 
       
    31   This protocol has been implemented as a two layer stack. Layer two includes
       
    32   the mb_master and the mb_slave protocols. Layer one is composed of
       
    33   the mb_rtu, mb_ascii and mb_tcp protocols.
       
    34 
       
    35   Layer1 protocols all implement the same interface, defined in mb_layer1.h
       
    36   Layer2 protocols implement different interfaces, defined in mb_master.h
       
    37   and mb_slave.h
       
    38 
       
    39   Which layer1 protocol that will be used by the program will depend on which 
       
    40   layer1 protocol implementation is linked to the final binary/executable.
       
    41   It is not possible to define during run-time which layer1 protocol is to
       
    42   be used. Each compiled program can only support a single layer1 protocol.
       
    43 
       
    44   Users of these libraries should only use functions defined in the layer2
       
    45   protocol header files (i.e. mb_master.h and mb_slave.h)
       
    46 
       
    47   If writing a program that will simultaneously be a master and a slave,
       
    48   then only use the mb_slave_and_master.h header file!
       
    49   In this case, do not forget to link the final binary to both the
       
    50   master and slave protocol implementations (as well as the chosen
       
    51   layer1 protocol implementation).
       
    52 
       
    53 
       
    54 
       
    55             ------------------------------------------
       
    56             |                    |                   |
       
    57   layer 2   |    mb_master.h     |    mb_slave.h     |
       
    58             |    mb_master.c     |    mb_slave.c     |
       
    59             |                    |                   |
       
    60             |----------------------------------------|
       
    61             |              mb_layer1.h               |
       
    62   Layer 1   |            |              |            |
       
    63             |  mb_rtu.c  |  mb_ascii.c  |  mb_tcp.c  |
       
    64             |            |              |            |
       
    65             ------------------------------------------