Modbus通讯RTU协议的源代码程序实例,帮助工程技术人员进行Modbus设计
47
/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. * Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* File: $Id: mbrtu.c,v 1.18 2007/09/12 10:15:56 wolti Exp $
*/
/* ----------------------- System includes
----------------------------------*/
#include "stdlib.h"
#include "string.h"
/* ----------------------- Platform includes
--------------------------------*/
#include "port.h"
/* ----------------------- Modbus includes
----------------------------------*/
#include "mb.h"
#include "mbrtu.h"
#include "mbframe.h"
#include "mbcrc.h"
#include "mbport.h"
/* ----------------------- Defines
------------------------------------------*/
#define MB_SER_PDU_SIZE_MIN 4 /*!< Minimum size of a Modbus RTUframe. */
#define MB_SER_PDU_SIZE_MAX 256 /*!< Maximum size of a Modbus RTUframe. */
#define MB_SER_PDU_SIZE_CRC 2 /*!< Size of CRC field in PDU. */
第 1 页
VB编写的Modbus RTU协议通讯源程序_计算机软件及应用_IT/计算机_专业资料 暂无评价0人阅读0次下载举报文档 VB编写的Modbus RTU协议通讯源程序_计算机软件及应用...
VB编写的Modbus RTU协议通讯源程序_冶金/矿山/地质_工程科技_专业资料。可以帮助熟悉程序的编写方法VB编写的Modbus RTU协议通讯源程序 sunwu 建议删除该贴!! ...
modbus 协议 及 modbus RTU 的 C51 单片机 程序_信息与通信_工程科技_专业...下面是它的 VC 代码: WORD GetCheckCode(const char * pSendBuf, int nEnd)...
modbus协议及modbus_RTU的C51程序_信息与通信_工程科技_专业资料。modbus协议及...下面是它的 VC 代码: WORD GetCheckCode(const char * pSendBuf, int nEnd)...
Modbus 通讯协议编程(VB源代码)_信息与通信_工程科技_专业资料。Modbus 通讯...这只是一个测试版,但 Modbus 的 ASCII 协议和 RTU 协议都已经实现。 现在将...
MODBUS程序示例_信息与通信_工程科技_专业资料。S7... Modbus RTU 协议.Modbus RTU 协议是一个主从协议...注意:在执行中当加上额外代码时不支持广播地址。...
MODBUS通讯协议-RTU_信息与通信_工程科技_专业资料...或寄存器) , 允许下截、记录、确认从机内的程序...表 1 – 1 常用功能码 代码 01 02 名称 读取...
ModBus RTU单片机通信程序编写方法_演讲/主持_工作范文_实用文档。单片机的Modbus...通过利用MODBUS RTU协议功能代码,实现 了主机和现场检测仪表间的包括实时数据查询...
MODBUS协议 51端源程序_信息与通信_工程科技_专业资料。用C语言写的MODBUS协议... 基于单片机的 modbus例程... 12页 7下载券 modbus协议及modbus RTU... 28...
(2)功能代码 功能代码为通信传送的第二个字节。 Modbus 通信规约定义可能的代码...力控中的设置 1 IO设备选择莫迪康 PLC ModbusRTU 协议,设备地址 01 与程序里...
热门文档