3 Star 6 Fork 6

jiangfeng.zhang/modbus_tcp_serial

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ModbusTcp.h 1.81 KB
一键复制 编辑 原始数据 按行查看 历史
jiangfeng.zhang 提交于 2018-12-18 21:13 . --linux编译ok--
/******************************************************************************
* Copyright (c) 2013, NULL, All rights reserved.
*
* File Name : main.c
* Description:
* Author : jiangfeng.zhang(retries@126.com)
* Date : 2018/12/18
* Version : 1.0
*
* Change Logs:
* 2018/12/18 jiangfeng.zhang : Create file.
******************************************************************************/
#ifndef _USMART_DRIVER_MODBUS_TCP_H
#define _USMART_DRIVER_MODBUS_TCP_H
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
//0x01
int ModbusTcpReadBits(int iFd,unsigned short * pusTranID,
unsigned char ucDevAddr,
int iAddr,
int iLen,
unsigned char *dest);
//0x02
int ModbusTcpReadInputBits(int iFd,unsigned short*pusTranID,
unsigned char ucDevAddr,
int iAddr,
int iLen,
unsigned char *dest);
//0x03
int ModbusTcpReadRegisters(int iFd,unsigned short * pusTranID,
unsigned char ucDevAddr,
int iAddr,
int iLen,
unsigned short *usDest);
//0x04
int ModbusTcpReadInputRegisters(int iFd,unsigned short * pusTranID,
unsigned char ucDevAddr,
int iAddr,
int iLen,
unsigned short *usDest);
//0x05
int ModbusTcpWriteBit(int iFd,unsigned short * pusTranID,
unsigned char ucDevAddr,
int iCoilAddr,
int status);
//0x06
int ModbusTcpWriteRegister(int iFd,unsigned short * pusTranID,
unsigned char ucDevAddr,
int reg_addr,
int value);
//0x0f
int ModbusTcpWriteBits(int iFd,unsigned short * pusTranID,
unsigned char ucDevAddr,
int iAddr,
int iLen,
const unsigned char *pucSrc);
//0x10
int ModbusWriteRegisters(int iFd,unsigned short * pusTranID,
unsigned char ucDevAddr,
int iAddr,
int iLen,
const unsigned short *pusSrc);
#endif
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/hostid/modbus_tcp_serial.git
git@gitee.com:hostid/modbus_tcp_serial.git
hostid
modbus_tcp_serial
modbus_tcp_serial
master

搜索帮助