⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mb_user_data.h

📁 ZLG MINIARM-N20源代码
💻 H
字号:
/****************************************Copyright (c)****************************************************
**                            Guangzhou ZHIYUAN electronics Co.,LTD.
**                                      
**                                 http://www.embedtools.com
**
**--------------File Info---------------------------------------------------------------------------------
** File name:               MB_USER_Data.h
** Latest modified Date:    2007-11-19
** Latest Version:          1.0
** Descriptions:            用户需要添加的modbus底层驱动头文件
**
**--------------------------------------------------------------------------------------------------------
** Created by:              Liu Weifeng
** Created date:            2007-12-07
** Version:                 1.0
** Descriptions:            The original version
**
**--------------------------------------------------------------------------------------------------------
** Modified by:            
** Modified date:          
** Version:                
** Descriptions:            
**
*********************************************************************************************************/
#ifndef _MB_USER_Data_H
#define _MB_USER_Data_H
#ifdef __cplusplus
extern "C" {
#endif

/*********************************************************************************************************
** Function name:			MB_GetDiscrete
**
** Descriptions:			获取离散值函数,该函数由用户编写
**
** input parameters:		ch,Modbus管道号
**							DisInputsV,保存离散输入量值指针
**							Address,线圈地址
** Returned value:			正常返回MB_NO_ERR,出错返回ILLEGAL_DATA_ADDR,或SLAVE_DEVICE_FAILURE。
**         
** Created by:				ZhouLishan
** Created Date:			2006/06/06
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern uint8 MB_GetDiscrete (uint8 ch,uint8 *DisInputsV,uint16 Address);

/*********************************************************************************************************
** Function name:			MB_GetCoils
**
** Descriptions:			获取线圈值函数,该函数由用户编写
**
** input parameters:		ch,Modbus管道号
**							CoilVPtr,保存线圈值指针
**							Address,线圈地址
** Returned value:			正常返回MB_NO_ERR,出错返回ILLEGAL_DATA_ADDR,或SLAVE_DEVICE_FAILURE。
**         
** Created by:				ZhouLishan
** Created Date:			2006/06/06
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern uint8 MB_GetCoils (uint8 ch,uint8 *DisInputsV,uint16 Address);

/*********************************************************************************************************
** Function name:			MB_SetCoil
**
** Descriptions:			设置线圈值函数,该函数由用户编写
**
** input parameters:		ch,Modbus管道号
**							Address,线圈地址
**							CoilValue,线圈值(0\1)
** Returned value:			正常返回MB_NO_ERR,出错返回ILLEGAL_DATA_ADDR,或SLAVE_DEVICE_FAILURE。
**         
** Created by:				ZhouLishan
** Created Date:			2006/06/06
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern uint8 MB_SetCoil(uint8 ch,uint16 Address,uint8 CoilValue);

/*********************************************************************************************************
** Function name:			MB_GetInputRegValue
**
** Descriptions:			读输入寄存器值函数,该函数由用户编写
**
** input parameters:		ch,Modbus管道号
**							*ValuePtr,保存输入寄存器值的指针
**							Address,寄存器地址
** Returned value:			正常返回MB_NO_ERR,出错返回ILLEGAL_DATA_ADDR,或SLAVE_DEVICE_FAILURE。
**         
** Created by:				ZhouLishan
** Created Date:			2006/06/06
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern uint8 MB_GetInputRegValue(uint8 ch,uint16 *ValuePtr,uint16 Address);

/*********************************************************************************************************
** Function name:			MB_GetRegValue
**
** Descriptions:			读保持寄存器值函数,该函数由用户编写
**
** input parameters:		ch,Modbus管道号
**							*ValuePtr,保存获取寄存器的值的指针
**							Address,寄存器地址
** Returned value:			正常返回MB_NO_ERR,出错返回ILLEGAL_DATA_ADDR,或SLAVE_DEVICE_FAILURE。
**         
** Created by:				ZhouLishan
** Created Date:			2006/06/06
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern uint8 MB_GetRegValue(uint8 ch,uint16 *ValuePtr,uint16 Address);

/*********************************************************************************************************
** Function name:			MB_SetRegValue
**
** Descriptions:			写保持寄存器值函数,该函数由用户编写
**
** input parameters:		ch,Modbus管道号
**							Address,寄存器地址
**							Value,写入的值
** Returned value:			正常返回MB_NO_ERR,出错返回ILLEGAL_DATA_ADDR,或SLAVE_DEVICE_FAILURE。
**         
** Created by:				ZhouLishan
** Created Date:			2006/06/06
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern uint8 MB_SetRegValue(uint8 ch,uint16 Address,uint16 Value);

#ifdef __cplusplus
        }
#endif
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -