Micrim Copyright 2008-2012, Micrim All Rights reserved C/Modbus V2.13.00 (C/Modbus-S and C/Modbus-M) Users Manual www.Micrium.com C/Modbus Table of Contents Revision History ................................................................................. 5 1.00 Introduction ......................................................................................... 6 1.01 Topologies .......................................................................................... 8 1.02 C/Modbus Architecture ............................................................... 10 2.00 Directories and Files ........................................................................ 13 2.01 Directories and Files, Target Independent Source Code ................. 13 2.02 Directories and Files, RTOS Interface .............................................. 14 2.03 Directories and Files, Product Specific Files .................................... 15 2.04 Directories and Files, CPU and Compiler Specific Files ................... 15 3.00 Using C/Modbus .......................................................................... 17 3.01 Using C/Modbus, MB CfgCh() .................................................... 20 3.02 Using C/Modbus, MB ChToPortMap() ........................................ 22 3.03 Using C/Modbus, MB Exit() ........................................................ 23 3.04 Using C/Modbus-M, MBM FC01 CoilRd() ................................. 24 3.05 Using C/Modbus-M, MBM FC02 DIRd() .................................... 26 3.06 Using C/Modbus-M, MBM FC03 HoldingRegRd() ..................... 28 3.07 Using C/Modbus-M, MBM FC03 HoldingRegRdFP() ................ 30 3.08 Using C/Modbus-M, MBM FC04 InRegRd() .............................. 32 3.09 Using C/Modbus-M, MBM FC05 CoilWr() ................................. 34 3.10 Using C/Modbus-M, MBM FC06 HoldingRegWr() ..................... 36 3.11 Using C/Modbus-M, MBM FC06 HoldingRegWrFP() ................ 38 3.12 Using C/Modbus-M, MBM FC08 Diag() ..................................... 40 3.13 Using C/Modbus-M, MBM FC15 CoilWr() ................................. 42 3.14 Using C/Modbus-M, MBM FC16 HoldingRegWrN () ................. 44 3.15 Using C/Modbus-M, MBM FC16 HoldingRegWrNFP() ............. 46 3.16 Using C/Modbus, MB Init() ......................................................... 48 3.17 Using C/Modbus, MB ModeSet() ................................................ 49 3.18 Using C/Modbus-S, MB NodeAddrSet() ..................................... 50 3.19 Using C/Modbus-S, MB WrEnSet() ............................................ 51 4.00 Configuring C/Modbus ................................................................. 52 4.01 Configuring C/Modbus, MODBUS CFG SLAVE EN ................. 52 4.02 Configuring C/Modbus, MODBUS CFG MASTER EN .............. 52 4.03 Configuring C/Modbus, MODBUS CFG ASCII EN ................... 52 2