...
The figure below shows the relationship between a product designed using µC/Modbus and other Modbus masters and slaves products. The ‘Serial Channels’ are typically RS-232C or RS-485 asynchronous serial interfaces typically using a UART (Universal Asynchronous Receiver Transmitter).
Panel | ||||
---|---|---|---|---|
| ||||
Masters (also known as Clients) initiate all data transfers to one or more Slaves (also known as Servers) in a system. In other words, only a Master (Client) can read or write values from/to a Slave (Server).
...
The figure below shows the relationship between multiple products (slaves) and a Modbus master (assuming RS-485).
Panel | ||||
---|---|---|---|---|
| ||||
The figure below shows the relationship between multiple products (slaves) and multiple Modbus masters (assuming RS-485 in the example) with one of those products being µC/Modbus-M. You will note that only one master can be present on each RS-485 network.
Panel | ||||
---|---|---|---|---|
| ||||
The figure below shows the relationship between multiple products (slaves) and multiple Modbus masters (assuming RS-232C in the example). As you can see, with RS-232C, each master needs to have a direct connection to each slave. µC/Modbus supports this topology since each product can have multiple communication channels. Although RS?232C requires more point-to-point connections, it offers the benefit of higher throughput since communications can occur concurrently instead of sequentially.
Panel | ||||
---|---|---|---|---|
| ||||
Modbus allows you to read or write integer, floating-point (assuming the Daniels Extensions) and discrete values from/to your target system. µC/Modbus can read or write from/to:
...
MB stands for ModBus, MBS stands for ModBus Slave and MBM stands for ModBus Master. A file that starts with mb_
indicates that the code in the file is independent of Modbus Slave or Master. A file that starts with mbs_
contains Modbus Slave specific code and, of course, a file that will start with mbm_
will contain MODBUS Master specific code.
Panel | ||||
---|---|---|---|---|
| ||||
Panel | ||
---|---|---|
| ||
(1) Your product needs to configure µC/Modbus (at compile time) to establish the maximum number of channels your product will support, whether some channels will support Modbus ASCII and/or RTU, whether the ‘Daniels Extensions’ will be supported to provide floating-point, which Modbus function codes will be supported, whether a product will be a Master, a Slave or both, etc. Configuration is done by changing a C header file ( (2) A Modbus master, connected to your product (that is running µC/Modbus-S) can read or change just about ANY data in your application. Access to your data (read or write) is done via a C file that you provide ( (3) This is the application independent slave code and it knows how to process Modbus ASCII and/or Modbus RTU packets. You should NOT have to modify this code. (4) The interface to the UARTs in your product is placed in the Board Support Package (BSP) file called
directory. This is the adaptation layer for the CPU or board you are using. (5) µC/Modbus-S can be used with or witouth a RTOS (Real Time Operating System) eviroment. µC/Modbus-M assumes the presence of an RTOS. However, you can use just about any RTOS and the RTOS specifics are actually isolated in a file called (6) µC/Modbus is independent of the CPU and the compiler you use. However, you need to provide information about the data types specific to your CPU and compiler. For example, you need to define the following data types: CPU_BOOLEAN Boolean (True or False, Yes or No, etc.)
CPU_INT08U 8 bit unsigned integer
CPU_INT16U 32 bit unsigned integer
CPU_INT32U 8 bit unsigned integer
CPU_FP32 32 bit IEEE754 floating-point
Etc. These data types are needed because µC/Modbus never uses the standard C data types (i.e. These data types need to be placed in a file called |