forked from foxclever/Modbus
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmbconfig.h
More file actions
81 lines (59 loc) · 2.5 KB
/
mbconfig.h
File metadata and controls
81 lines (59 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/******************************************************************************/
/** 模块名称:Modbus通讯 **/
/** 文件名称:mbconfig.h **/
/** 版 本:V1.0.0 **/
/** 简 介:用于配置Modbus协议栈使用的相关定义 **/
/**--------------------------------------------------------------------------**/
/** 修改记录: **/
/** 版本 日期 作者 说明 **/
/** V1.0.0 2015-07-18 尹家军 创建文件 **/
/** V1.0.1 2018-09-21 尹家军 添加Modbus ASCII代码 **/
/** V1.1.0 2019-04-17 尹家军 修改主站代码结构,封装主站从站对象**/
/** **/
/******************************************************************************/
#ifndef _MB_CONFIG_H
#define _MB_CONFIG_H
/*定义是否使能RTU主站功能,0为禁用,1为使能*/
#define MB_RTU_MASTER_ENABLED (1)
/*定义是否使能RTU从站功能,0为禁用,1为使能*/
#define MB_RTU_SLAVE_ENABLED (1)
/*定义是否使能ASCII主站功能,0为禁用,1为使能*/
#define MB_ACSII_MASTER_ENABLED (0)
/*定义是否使能ASCII从站功能,0为禁用,1为使能*/
#define MB_ASCII_SLAVE_ENABLED (0)
/*定义是否使能TCP服务器功能,0为禁用,1为使能*/
#define MB_TCP_SERVER_ENABLED (0)
/*定义是否使能TCP客户端功能,0为禁用,1为使能*/
#define MB_TCP_CLIENT_ENABLED (0)
#if MB_RTU_MASTER_ENABLED > (0)
#include "mbrtumaster.h"
#endif
#if MB_RTU_SLAVE_ENABLED > (0)
#include "mbrtuslave.h"
#endif
#if MB_TCP_CLIENT_ENABLED > (0)
#include "mbtcpclient.h"
#endif
#if MB_TCP_SERVER_ENABLED > (0)
#include "mbtcpserver.h"
#endif
#if MB_ACSII_MASTER_ENABLED > (0)
#include "mbasciimaster.h"
#endif
#if MB_ASCII_SLAVE_ENABLED > (0)
#include "mbasciislave.h"
#endif
#include "mbcommon.h"
/* 作为从站时,允许操作的变量范围 */
#if ((MB_RTU_SLAVE_ENABLED > (0))||(MB_TCP_SERVER_ENABLED > (0))||(MB_ASCII_SLAVE_ENABLED > (0)))
#define CoilStartAddress 0
#define CoilEndAddress 0
#define StatusStartAddress 0
#define StatusEndAddress 0
#define HoldingResterStartAddress 0
#define HoldingResterEndAddress 0
#define InputResterStartAddress 0
#define InputResterEndAddress 0
#endif
#endif
/*********** (C) COPYRIGHT 1999-2019 Moonan Technology *********END OF FILE****/