mb.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676
  1. /*
  2. *********************************************************************************************************
  3. * uC/Modbus
  4. * The Embedded Modbus Stack
  5. *
  6. * Copyright 2003-2020 Silicon Laboratories Inc. www.silabs.com
  7. *
  8. * SPDX-License-Identifier: APACHE-2.0
  9. *
  10. * This software is subject to an open source license and is distributed by
  11. * Silicon Laboratories Inc. pursuant to the terms of the Apache License,
  12. * Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
  13. *
  14. *********************************************************************************************************
  15. */
  16. /*
  17. *********************************************************************************************************
  18. * uC/MODBUS Header File
  19. *
  20. * Filename : mb.h
  21. * Version : V2.14.00
  22. *********************************************************************************************************
  23. */
  24. /*
  25. *********************************************************************************************************
  26. * MODULE
  27. *
  28. * Note(s) : (1) This main modbus header file is protected from multiple pre-processor
  29. * inclusion through use of the modbus module present pre-processor macro definition.
  30. *
  31. *********************************************************************************************************
  32. */
  33. #ifndef MODBUS_MODULE_PRESENT /* See Note #1. */
  34. #define MODBUS_MODULE_PRESENT
  35. /*
  36. *********************************************************************************************************
  37. * MODBUS VERSION NUMBER
  38. *
  39. * Note(s) : (1) (a) The Modbus software version is denoted as follows :
  40. *
  41. * Vx.yy.zz
  42. *
  43. * where
  44. * V denotes 'Version' label
  45. * x denotes major software version revision number
  46. * yy denotes minor software version revision number
  47. * zz minor revision
  48. *
  49. * (b) The software version label #define is formatted as follows :
  50. *
  51. * ver = x.yy.zz * 10000
  52. *
  53. * where
  54. * ver denotes software version number scaled as an integer value
  55. * x.yy.zz denotes software version number
  56. *********************************************************************************************************
  57. */
  58. #define MODBUS_VERSION 21400u /* See Note #1. */
  59. /*
  60. *********************************************************************************************************
  61. * EXTERNS
  62. *********************************************************************************************************
  63. */
  64. #ifdef MB_MODULE
  65. #define MB_EXT
  66. #else
  67. #define MB_EXT extern
  68. #endif
  69. /*
  70. *********************************************************************************************************
  71. * MODBUS PROTOCOL INCLUDE FILES
  72. *
  73. * Note(s) : (1) The modbus protocol suite files are located in the following directories :
  74. *
  75. * (a) (1) \<Your Product Application>\app_cfg.h
  76. * (2) \mb_cfg.h
  77. * (3) \mb_data.c
  78. *
  79. * (b) \<Modbus Protocol Suite>\Source\mb.h
  80. * \mb.c
  81. * \mb_def.c
  82. * \mb_util.c
  83. * \mbm_core.c
  84. * \mbs_core.c
  85. *
  86. * (c) \<Modbus Protocol Suite>\Ports\<cpu>\mb_bsp.*
  87. *
  88. * (d) \<Modbus Protocol Suite>\OS\<os>\mb_os.*
  89. *
  90. * where
  91. * <Your Product Application> directory path for Your Product's Application
  92. * <Modbus Protocol Suite> directory path for modbus protocol suite
  93. * <cpu> directory name for specific processor (CPU)
  94. * <compiler> directory name for specific compiler
  95. * <os> directory name for specific operating system (OS)
  96. *
  97. * (2) CPU-configuration software files are located in the following directories :
  98. *
  99. * (a) \<CPU-Compiler Directory>\cpu_def.h
  100. *
  101. * (b) \<CPU-Compiler Directory>\<cpu>\<compiler>\cpu*.*
  102. *
  103. * where
  104. * <CPU-Compiler Directory> directory path for common CPU-compiler software
  105. * <cpu> directory name for specific processor (CPU)
  106. * <compiler> directory name for specific compiler
  107. *
  108. * (3) NO compiler-supplied standard library functions are used by the modbus protocol suite.
  109. *
  110. * (a) Standard library functions are implemented in the custom library module(s) :
  111. *
  112. * \<Custom Library Directory>\lib*.*
  113. *
  114. * where
  115. * <Custom Library Directory> directory path for custom library software
  116. *
  117. *
  118. * (4) Compiler MUST be configured to include the '\<Custom Library Directory>\uC-LIB\',
  119. * '\<CPU-Compiler Directory>\' directory, & the specific CPU-compiler directory as
  120. * additional include path directories.
  121. **********************************************************************************************************
  122. */
  123. #include <cpu.h>
  124. #include <lib_def.h>
  125. #include "mb_cfg.h"
  126. #include "mb_def.h"
  127. #include "mb_os.h"
  128. /*
  129. *********************************************************************************************************
  130. * DATA TYPES
  131. *********************************************************************************************************
  132. */
  133. typedef struct modbus_ch {
  134. CPU_INT08U Ch; /* Channel number */
  135. CPU_BOOLEAN WrEn; /* Indicates whether MODBUS writes are enabled for the channel */
  136. CPU_INT32U WrCtr; /* Incremented each time a write command is performed */
  137. CPU_INT08U NodeAddr; /* Modbus node address of the channel */
  138. CPU_INT08U PortNbr; /* UART port number */
  139. CPU_INT32U BaudRate; /* Baud Rate */
  140. CPU_INT08U Parity; /* UART's parity settings (MODBUS_PARITY_NONE, _ODD or _EVEN) */
  141. CPU_INT08U Bits; /* UART's number of bits (7 or 8) */
  142. CPU_INT08U Stops; /* UART's number of stop bits (1 or 2) */
  143. CPU_INT08U Mode; /* Modbus mode: MODBUS_MODE_ASCII or MODBUS_MODE_RTU */
  144. CPU_INT08U MasterSlave; /* Slave when set to MODBUS_SLAVE, Master when set to MODBUS_MASTER */
  145. CPU_INT16U Err; /* Internal code to indicate the source of MBS_ErrRespSet() */
  146. #if (MODBUS_CFG_RTU_EN == DEF_ENABLED)
  147. CPU_INT16U RTU_TimeoutCnts; /* Counts to reload in .RTU_TimeoutCtr when byte received */
  148. CPU_INT16U RTU_TimeoutCtr; /* Counts left before RTU timer times out for the channel */
  149. CPU_BOOLEAN RTU_TimeoutEn; /* Enable (when TRUE) or Disable (when FALSE) RTU timer */
  150. #endif
  151. #if (MODBUS_CFG_FC08_EN == DEF_ENABLED)
  152. CPU_INT16U StatMsgCtr; /* Statistics */
  153. CPU_INT16U StatCRCErrCtr;
  154. CPU_INT16U StatExceptCtr;
  155. CPU_INT16U StatSlaveMsgCtr;
  156. CPU_INT16U StatNoRespCtr;
  157. #endif
  158. CPU_INT32U RxTimeout; /* Amount of time Master is willing to wait for response from slave */
  159. CPU_INT32U RxCtr; /* Incremented every time a character is received */
  160. CPU_INT16U RxBufByteCtr; /* Number of bytes received or to send */
  161. CPU_INT08U *RxBufPtr; /* Pointer to current position in buffer */
  162. CPU_INT08U RxBuf[MODBUS_CFG_BUF_SIZE]; /* Storage of received characters or characters to send */
  163. CPU_INT32U TxCtr; /* Incremented every time a character is transmitted */
  164. CPU_INT16U TxBufByteCtr; /* Number of bytes received or to send */
  165. CPU_INT08U *TxBufPtr; /* Pointer to current position in buffer */
  166. CPU_INT08U TxBuf[MODBUS_CFG_BUF_SIZE]; /* Storage of received characters or characters to send */
  167. CPU_INT08U RxFrameData[MODBUS_CFG_BUF_SIZE]; /* Additional data for function requested. */
  168. CPU_INT16U RxFrameNDataBytes; /* Number of bytes in the data field. */
  169. CPU_INT16U RxFrameCRC; /* Error check value (LRC or CRC-16). */
  170. CPU_INT16U RxFrameCRC_Calc; /* Error check value computed from packet received */
  171. CPU_INT08U TxFrameData[MODBUS_CFG_BUF_SIZE]; /* Additional data for function requested. */
  172. CPU_INT16U TxFrameNDataBytes; /* Number of bytes in the data field. */
  173. CPU_INT16U TxFrameCRC; /* Error check value (LRC or CRC-16). */
  174. } MODBUS_CH;
  175. /*
  176. *********************************************************************************************************
  177. * GLOBAL VARIABLES
  178. *********************************************************************************************************
  179. */
  180. #if (MODBUS_CFG_RTU_EN == DEF_ENABLED)
  181. MB_EXT CPU_INT16U MB_RTU_Freq; /* Frequency at which RTU timer is running */
  182. MB_EXT CPU_INT32U MB_RTU_TmrCtr; /* Incremented every Modbus RTU timer interrupt */
  183. #endif
  184. MB_EXT CPU_INT08U MB_ChCtr; /* Modbus channel counter (0..MODBUS_MAX_CH) */
  185. MB_EXT MODBUS_CH MB_ChTbl[MODBUS_CFG_MAX_CH]; /* Modbus channels */
  186. /*
  187. *********************************************************************************************************
  188. * GLOBAL VARIABLES
  189. *********************************************************************************************************
  190. */
  191. extern CPU_INT32U const MB_TotalRAMSize;
  192. extern CPU_INT16U const MB_ChSize;
  193. /*
  194. *********************************************************************************************************
  195. * MODBUS INTERFACE FUNCTION PROTOTYPES
  196. * (MB.C)
  197. *********************************************************************************************************
  198. */
  199. void MB_Init (CPU_INT32U freq);
  200. void MB_Exit (void);
  201. MODBUS_CH *MB_CfgCh (CPU_INT08U node_addr,
  202. CPU_INT08U master_slave,
  203. CPU_INT32U rx_timeout,
  204. CPU_INT08U modbus_mode,
  205. CPU_INT08U port_nbr,
  206. CPU_INT32U baud,
  207. CPU_INT08U bits,
  208. CPU_INT08U parity,
  209. CPU_INT08U stops,
  210. CPU_INT08U wr_en);
  211. void MB_MasterTimeoutSet (MODBUS_CH *pch,
  212. CPU_INT32U timeout);
  213. void MB_ModeSet (MODBUS_CH *pch,
  214. CPU_INT08U master_slave,
  215. CPU_INT08U mode);
  216. void MB_NodeAddrSet (MODBUS_CH *pch,
  217. CPU_INT08U addr);
  218. void MB_WrEnSet (MODBUS_CH *pch,
  219. CPU_INT08U wr_en);
  220. void MB_ChToPortMap (MODBUS_CH *pch,
  221. CPU_INT08U port_nbr);
  222. #if (MODBUS_CFG_ASCII_EN == DEF_ENABLED)
  223. void MB_ASCII_RxByte (MODBUS_CH *pch,
  224. CPU_INT08U rx_byte);
  225. #endif
  226. #if (MODBUS_CFG_RTU_EN == DEF_ENABLED)
  227. void MB_RTU_RxByte (MODBUS_CH *pch,
  228. CPU_INT08U rx_byte);
  229. void MB_RTU_TmrReset (MODBUS_CH *pch); /* Resets the Frame Sync timer. */
  230. void MB_RTU_TmrResetAll (void); /* Resets all the RTU timers */
  231. void MB_RTU_TmrUpdate (void);
  232. #endif
  233. void MB_RxByte (MODBUS_CH *pch,
  234. CPU_INT08U rx_byte);
  235. void MB_RxTask (MODBUS_CH *pch);
  236. void MB_Tx (MODBUS_CH *pch);
  237. void MB_TxByte (MODBUS_CH *pch);
  238. #if (MODBUS_CFG_ASCII_EN == DEF_ENABLED)
  239. CPU_BOOLEAN MB_ASCII_Rx (MODBUS_CH *pch);
  240. void MB_ASCII_Tx (MODBUS_CH *pch);
  241. #endif
  242. #if (MODBUS_CFG_RTU_EN == DEF_ENABLED)
  243. CPU_BOOLEAN MB_RTU_Rx (MODBUS_CH *pch);
  244. void MB_RTU_Tx (MODBUS_CH *pch);
  245. #endif
  246. /*
  247. *********************************************************************************************************
  248. * RTOS INTERFACE FUNCTION PROTOTYPES
  249. * (defined in mb_os.c)
  250. *********************************************************************************************************
  251. */
  252. void MB_OS_Init (void);
  253. void MB_OS_Exit (void);
  254. void MB_OS_RxSignal (MODBUS_CH *pch);
  255. void MB_OS_RxWait (MODBUS_CH *pch,
  256. CPU_INT16U *perr);
  257. /*
  258. *********************************************************************************************************
  259. * COMMON MODBUS ASCII INTERFACE FUNCTION PROTOTYPES
  260. * (defined in mb_util.c)
  261. *********************************************************************************************************
  262. */
  263. #if (MODBUS_CFG_ASCII_EN == DEF_ENABLED)
  264. CPU_INT08U *MB_ASCII_BinToHex (CPU_INT08U value,
  265. CPU_INT08U *pbuf);
  266. CPU_INT08U MB_ASCII_HexToBin (CPU_INT08U *phex);
  267. CPU_INT08U MB_ASCII_RxCalcLRC (MODBUS_CH *pch);
  268. CPU_INT08U MB_ASCII_TxCalcLRC (MODBUS_CH *pch,
  269. CPU_INT16U tx_bytes);
  270. #endif
  271. /*
  272. *********************************************************************************************************
  273. * COMMON MODBUS RTU INTERFACE FUNCTION PROTOTYPES
  274. * (defined in mb_util.C)
  275. *********************************************************************************************************
  276. */
  277. #if (MODBUS_CFG_RTU_EN == DEF_ENABLED)
  278. CPU_INT16U MB_RTU_CalcCRC (MODBUS_CH *pch);
  279. CPU_INT16U MB_RTU_TxCalcCRC (MODBUS_CH *pch);
  280. CPU_INT16U MB_RTU_RxCalcCRC (MODBUS_CH *pch);
  281. #endif
  282. /*
  283. *********************************************************************************************************
  284. * INTERFACE TO APPLICATION DATA
  285. * (defined in mb_data.C)
  286. *********************************************************************************************************
  287. */
  288. #if (MODBUS_CFG_FC01_EN == DEF_ENABLED)
  289. CPU_BOOLEAN MB_CoilRd (CPU_INT16U coil,
  290. CPU_INT16U *perr);
  291. #endif
  292. #if (MODBUS_CFG_FC05_EN == DEF_ENABLED)
  293. void MB_CoilWr (CPU_INT16U coil,
  294. CPU_BOOLEAN coil_val,
  295. CPU_INT16U *perr);
  296. #endif
  297. #if (MODBUS_CFG_FC02_EN == DEF_ENABLED)
  298. CPU_BOOLEAN MB_DIRd (CPU_INT16U di,
  299. CPU_INT16U *perr);
  300. #endif
  301. #if (MODBUS_CFG_FC04_EN == DEF_ENABLED)
  302. CPU_INT16U MB_InRegRd (CPU_INT16U reg,
  303. CPU_INT16U *perr);
  304. CPU_FP32 MB_InRegRdFP (CPU_INT16U reg,
  305. CPU_INT16U *perr);
  306. #endif
  307. #if (MODBUS_CFG_FC03_EN == DEF_ENABLED)
  308. CPU_INT16U MB_HoldingRegRd (CPU_INT16U reg,
  309. CPU_INT16U *perr);
  310. CPU_FP32 MB_HoldingRegRdFP (CPU_INT16U reg,
  311. CPU_INT16U *perr);
  312. #endif
  313. #if (MODBUS_CFG_FC06_EN == DEF_ENABLED) || \
  314. (MODBUS_CFG_FC16_EN == DEF_ENABLED)
  315. void MB_HoldingRegWr (CPU_INT16U reg,
  316. CPU_INT16U reg_val_16,
  317. CPU_INT16U *perr);
  318. void MB_HoldingRegWrFP (CPU_INT16U reg,
  319. CPU_FP32 reg_val_fp,
  320. CPU_INT16U *perr);
  321. #endif
  322. #if (MODBUS_CFG_FC20_EN == DEF_ENABLED)
  323. CPU_INT16U MB_FileRd (CPU_INT16U file_nbr,
  324. CPU_INT16U record_nbr,
  325. CPU_INT16U ix,
  326. CPU_INT08U record_len,
  327. CPU_INT16U *perr);
  328. #endif
  329. #if (MODBUS_CFG_FC21_EN == DEF_ENABLED)
  330. void MB_FileWr (CPU_INT16U file_nbr,
  331. CPU_INT16U record_nbr,
  332. CPU_INT16U ix,
  333. CPU_INT08U record_len,
  334. CPU_INT16U value,
  335. CPU_INT16U *perr);
  336. #endif
  337. /*
  338. *********************************************************************************************************
  339. * BSP FUNCTION PROTOTYPES
  340. *********************************************************************************************************
  341. */
  342. void MB_CommExit (void); /* Exit Modbus Communications */
  343. void MB_CommPortCfg (MODBUS_CH *pch,
  344. CPU_INT08U port_nbr,
  345. CPU_INT32U baud,
  346. CPU_INT08U bits,
  347. CPU_INT08U parity,
  348. CPU_INT08U stops);
  349. #if (MODBUS_CFG_RTU_EN == DEF_ENABLED)
  350. void MB_RTU_TmrInit (void); /* Initialize the timer used for RTU framing */
  351. void MB_RTU_TmrExit (void);
  352. void MB_RTU_TmrISR_Handler (void);
  353. #endif
  354. /*
  355. *********************************************************************************************************
  356. * MODBUS SLAVE
  357. * GLOBAL FUNCTION PROTOTYPES
  358. *********************************************************************************************************
  359. */
  360. #if (MODBUS_CFG_SLAVE_EN == DEF_ENABLED)
  361. CPU_BOOLEAN MBS_FCxx_Handler (MODBUS_CH *pch);
  362. void MBS_RxTask (MODBUS_CH *pch);
  363. #if (MODBUS_CFG_FC08_EN == DEF_ENABLED)
  364. void MBS_StatInit (MODBUS_CH *pch);
  365. #endif
  366. #endif
  367. /*
  368. *********************************************************************************************************
  369. * MODBUS MASTER
  370. * GLOBAL FUNCTION PROTOTYPES
  371. *********************************************************************************************************
  372. */
  373. #if (MODBUS_CFG_MASTER_EN == DEF_ENABLED)
  374. #if (MODBUS_CFG_FC01_EN == DEF_ENABLED)
  375. CPU_INT16U MBM_FC01_CoilRd (MODBUS_CH *pch,
  376. CPU_INT08U slave_addr,
  377. CPU_INT16U start_addr,
  378. CPU_INT08U *p_coil_tbl,
  379. CPU_INT16U nbr_coils);
  380. #endif
  381. #if (MODBUS_CFG_FC02_EN == DEF_ENABLED)
  382. CPU_INT16U MBM_FC02_DIRd (MODBUS_CH *pch,
  383. CPU_INT08U slave_node,
  384. CPU_INT16U slave_addr,
  385. CPU_INT08U *p_di_tbl,
  386. CPU_INT16U nbr_di);
  387. #endif
  388. #if (MODBUS_CFG_FC03_EN == DEF_ENABLED)
  389. CPU_INT16U MBM_FC03_HoldingRegRd (MODBUS_CH *pch,
  390. CPU_INT08U slave_node,
  391. CPU_INT16U slave_addr,
  392. CPU_INT16U *p_reg_tbl,
  393. CPU_INT16U nbr_regs);
  394. #endif
  395. #if (MODBUS_CFG_FC03_EN == DEF_ENABLED) && \
  396. (MODBUS_CFG_FP_EN == DEF_ENABLED)
  397. CPU_INT16U MBM_FC03_HoldingRegRdFP (MODBUS_CH *pch,
  398. CPU_INT08U slave_node,
  399. CPU_INT16U slave_addr,
  400. CPU_FP32 *p_reg_tbl,
  401. CPU_INT16U nbr_regs);
  402. #endif
  403. #if (MODBUS_CFG_FC04_EN == DEF_ENABLED)
  404. CPU_INT16U MBM_FC04_InRegRd (MODBUS_CH *pch,
  405. CPU_INT08U slave_node,
  406. CPU_INT16U slave_addr,
  407. CPU_INT16U *p_reg_tbl,
  408. CPU_INT16U nbr_regs);
  409. #endif
  410. #if (MODBUS_CFG_FC05_EN == DEF_ENABLED)
  411. CPU_INT16U MBM_FC05_CoilWr (MODBUS_CH *pch,
  412. CPU_INT08U slave_node,
  413. CPU_INT16U slave_addr,
  414. CPU_BOOLEAN coil_val);
  415. #endif
  416. #if (MODBUS_CFG_FC06_EN == DEF_ENABLED)
  417. CPU_INT16U MBM_FC06_HoldingRegWr (MODBUS_CH *pch,
  418. CPU_INT08U slave_node,
  419. CPU_INT16U slave_addr,
  420. CPU_INT16U reg_val);
  421. #endif
  422. #if (MODBUS_CFG_FC06_EN == DEF_ENABLED) && \
  423. (MODBUS_CFG_FP_EN == DEF_ENABLED)
  424. CPU_INT16U MBM_FC06_HoldingRegWrFP (MODBUS_CH *pch,
  425. CPU_INT08U slave_node,
  426. CPU_INT16U slave_addr,
  427. CPU_FP32 reg_val_fp);
  428. #endif
  429. #if (MODBUS_CFG_FC08_EN == DEF_ENABLED)
  430. CPU_INT16U MBM_FC08_Diag (MODBUS_CH *pch,
  431. CPU_INT08U slave_node,
  432. CPU_INT16U fnct,
  433. CPU_INT16U fnct_data,
  434. CPU_INT16U *pval);
  435. #endif
  436. #if (MODBUS_CFG_FC15_EN == DEF_ENABLED)
  437. CPU_INT16U MBM_FC15_CoilWr (MODBUS_CH *pch,
  438. CPU_INT08U slave_node,
  439. CPU_INT16U slave_addr,
  440. CPU_INT08U *p_coil_tbl,
  441. CPU_INT16U nbr_coils);
  442. #endif
  443. #if (MODBUS_CFG_FC16_EN == DEF_ENABLED)
  444. CPU_INT16U MBM_FC16_HoldingRegWrN (MODBUS_CH *pch,
  445. CPU_INT08U slave_node,
  446. CPU_INT16U slave_addr,
  447. CPU_INT16U *p_reg_tbl,
  448. CPU_INT16U nbr_regs);
  449. #endif
  450. #if (MODBUS_CFG_FC16_EN == DEF_ENABLED) && \
  451. (MODBUS_CFG_FP_EN == DEF_ENABLED)
  452. CPU_INT16U MBM_FC16_HoldingRegWrNFP (MODBUS_CH *pch,
  453. CPU_INT08U slave_node,
  454. CPU_INT16U slave_addr,
  455. CPU_FP32 *p_reg_tbl,
  456. CPU_INT16U nbr_regs);
  457. #endif
  458. #endif
  459. /*
  460. *********************************************************************************************************
  461. * SYMBOL ERRORS
  462. *********************************************************************************************************
  463. */
  464. #ifndef MODBUS_CFG_MASTER_EN
  465. #error "MODBUS_CFG_MASTER_EN not #defined "
  466. #error "... Defines wheteher your product will support Modbus Master "
  467. #endif
  468. #ifndef MODBUS_CFG_SLAVE_EN
  469. #error "MODBUS_CFG_SLAVE_EN not #defined "
  470. #error "... Defines wheteher your product will support Modbus Slave "
  471. #endif
  472. #ifndef MODBUS_CFG_MAX_CH
  473. #error "MODBUS_CFG_MAX_CH not #defined "
  474. #error "... Defines the number of Modbus ports supported. Should be 1 to N. "
  475. #endif
  476. #ifndef MODBUS_CFG_MAX_CH
  477. #error "MODBUS_CFG_MAX_CH not #defined "
  478. #error "... Defines the number of Modbus ports supported. Should be 1 to N. "
  479. #endif
  480. #ifndef MODBUS_CFG_MAX_CH
  481. #error "MODBUS_CFG_MAX_CH not #defined "
  482. #error "... Defines the number of Modbus ports supported. Should be 1 to N. "
  483. #endif
  484. #ifndef MODBUS_CFG_ASCII_EN
  485. #error "MODBUS_CFG_ASCII_EN not #defined "
  486. #error "... Defines whether your product will support Modbus ASCII. "
  487. #endif
  488. #ifndef MODBUS_CFG_RTU_EN
  489. #error "MODBUS_CFG_RTU_EN not #defined "
  490. #error "... Defines whether your product will support Modbus RTU. "
  491. #endif
  492. #ifndef MODBUS_CFG_FP_EN
  493. #error "MODBUS_CFG_FP_EN not #defined "
  494. #error "... Defines whether your product will support Daniels Flow Meter Floating-Point extensions. "
  495. #endif
  496. #ifndef MODBUS_CFG_FP_START_IX
  497. #error "MODBUS_CFG_FP_START_IX not #defined "
  498. #error "... Defines the starting register number for floating-point registers. "
  499. #endif
  500. #ifndef MODBUS_CFG_FC01_EN
  501. #error "MODBUS_CFG_FC01_EN not #defined "
  502. #endif
  503. #ifndef MODBUS_CFG_FC02_EN
  504. #error "MODBUS_CFG_FC02_EN not #defined "
  505. #endif
  506. #ifndef MODBUS_CFG_FC03_EN
  507. #error "MODBUS_CFG_FC03_EN not #defined "
  508. #endif
  509. #ifndef MODBUS_CFG_FC04_EN
  510. #error "MODBUS_CFG_FC04_EN not #defined "
  511. #endif
  512. #ifndef MODBUS_CFG_FC05_EN
  513. #error "MODBUS_CFG_FC05_EN not #defined "
  514. #endif
  515. #ifndef MODBUS_CFG_FC06_EN
  516. #error "MODBUS_CFG_FC06_EN not #defined "
  517. #endif
  518. #ifndef MODBUS_CFG_FC08_EN
  519. #error "MODBUS_CFG_FC08_EN not #defined "
  520. #endif
  521. #ifndef MODBUS_CFG_FC15_EN
  522. #error "MODBUS_CFG_FC15_EN not #defined "
  523. #endif
  524. #ifndef MODBUS_CFG_FC16_EN
  525. #error "MODBUS_CFG_FC16_EN not #defined "
  526. #endif
  527. #ifndef MODBUS_CFG_FC20_EN
  528. #error "MODBUS_CFG_FC20_EN not #defined "
  529. #endif
  530. #ifndef MODBUS_CFG_FC21_EN
  531. #error "MODBUS_CFG_FC21_EN not #defined "
  532. #endif
  533. /*
  534. *********************************************************************************************************
  535. * MODULE END
  536. *********************************************************************************************************
  537. */
  538. #endif /* End of modbus module include. */