资源简介
FreeMODBUS一个奥地利人写的Modbus协议。它是一个针对嵌入式应用的一个免费(自由)的通用MODBUS协议的移植。Modbus是一个工业制造环境中应用的一个通用协议。Modbus通信协议栈包括两层:Modbus应用层协议,该层定义了数据模式和功能;另外一层是网络层。
代码片段和文件信息
/*
* FreeModbus Libary: ARM7 Demo Application
* Copyright (C) 2006 Christian Walter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not write to the Free Software
* Foundation Inc. 51 Franklin St Fifth Floor Boston MA 02110-1301 USA
*
* File: $Id$
*/
/* ----------------------- System includes ----------------------------------*/
#include “assert.h“
/* ----------------------- Platform includes --------------------------------*/
#include “support/AT91SAM7X256.h“
#include “support/lib_AT91SAM7X256.h“
#include “FreeRTOS.h“
#include “task.h“
#include “queue.h“
/* ----------------------- Modbus includes ----------------------------------*/
#include “mb.h“
/* ----------------------- Defines ------------------------------------------*/
#define REG_HOLDING_START 0x1000
#define REG_HOLDING_NREGS 130
#define REG_INPUT_START 0x1000
#define REG_INPUT_NREGS 4
/* ----------------------- Static variables ---------------------------------*/
static USHORT usRegHoldingStart = REG_HOLDING_START;
static USHORT usRegHoldingBuf[REG_HOLDING_NREGS];
static USHORT usRegInputStart = REG_INPUT_START;
static USHORT usRegInputBuf[REG_INPUT_NREGS];
/* ----------------------- Static functions ---------------------------------*/
STATIC void vModbusTask( void *pvParameters );
STATIC void vSetupHardware( void );
/* ----------------------- Start implementation -----------------------------*/
int
main( void )
{
vSetupHardware( );
( void )xTaskCreate( vModbusTask NULL configMINIMAL_STACK_SIZE NULL
tskIDLE_PRIORITY NULL );
vTaskStartScheduler( );
return 0;
}
static void
vModbusTask( void *pvParameters )
{
int i;
/* Select either ASCII or RTU Mode. */
( void )eMBInit( MB_RTU 0x0A 0 38400 MB_PAR_EVEN );
/* Initialize the holding register values before starting the
* Modbus stack
*/
for( i = 0; i < REG_HOLDING_NREGS; i++ )
{
usRegHoldingBuf[i] = ( unsigned short )i;
}
/* Initialize the input register values before starting the
* Modbus stack
*/
for( i = 0; i < REG_INPUT_NREGS; i++ )
{
usRegInputBuf[i] = ( unsigned short )i;
}
/* Enable the Modbus Protocol Stack. */
( void )eMBEnable( );
for( ;; )
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1436 2018-09-14 04:03 freemodbus-v1.6\bsd.txt
文件 14628 2018-09-14 04:03 freemodbus-v1.6\Changelog.txt
文件 5634 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\demo.c
文件 8756 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\demo.hzp
文件 12695 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\demo.hzs
文件 13219 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\croutine.c
文件 26826 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\include\croutine.h
文件 4984 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\include\FreeRTOS.h
文件 11470 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\include\list.h
文件 2988 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\include\portable.h
文件 2979 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\include\portable.h.bak
文件 2209 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\include\projdefs.h
文件 16551 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\include\queue.h
文件 10062 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\include\semphr.h
文件 31687 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\include\task.h
文件 7614 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\list.c
文件 7975 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\portable\GCC\ARM7_AT91SAM7S\port.c
文件 8771 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\portable\GCC\ARM7_AT91SAM7S\portISR.c
文件 13238 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\portable\GCC\ARM7_AT91SAM7S\portmacro.h
文件 4589 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\portable\MemMang\heap_1.c
文件 9068 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\portable\MemMang\heap_2.c
文件 2547 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\portable\MemMang\heap_3.c
文件 32288 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\queue.c
文件 63012 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOS\tasks.c
文件 1585 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\FreeRTOSConfig.h
文件 2324 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\port\port.h
文件 3577 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\port\portevent.c
文件 3422 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\port\portother.c
文件 7732 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\port\portserial.c
文件 2738 2018-09-14 04:03 freemodbus-v1.6\demo\AT91SAM7X_ROWLEY\port\porttimer.c
............此处省略1304个文件信息
- 上一篇:简易电子琴设计
- 下一篇:基于STM32F4控制步进电机代码
相关资源
- NModbus开源库129838
- 51单片机和modbus中文资料软件源代码全
- 基于STM32F407ZGT6库函数写的Modbus协议
- FreeRTOS和FreeMODBUS移植到STM32F407傻瓜教
- 51单片机Modbus_RTU
- modbus-主机-stm32移植源码与调试工具
- 基于modbus的dht11温湿度采集
- Modbus Poll、Modbus Slave和Virtual Serial Po
- Intouch modbus驱动DASMBTCP1.1
- EN2T的ModbusTCP例程+说明文档
- stm32 modbus主机程序125364
- stm32F1++w5500+modbus TCP串口发送数据DMA
- Modbus协议的工业自动化网络规范
- STM32单片机实现Modbus协议主机2个源码
- 常用_Modbus-RTU测试工具_主从机都有
- modbus调试助手主站
- S7-1200ModbusTCP通讯程序
- zw_STM32-modbusmaster.zip
- modbus tcp 客户端和服务端
- 10S7-1200ModbusRTU通信(3)-编写主站程序
- STM32作从机实现简单的Modbus RTU协议
- modbus 主从机软件
- 欧姆龙CP1H与modbus通信视频
- AB modbus通讯模块手册
- STM32F4 485 modbus
- STM32F103用串口空闲中断+DMA实现modbus通
- 基于STM32单片机的MODBUS通讯器毕业论文
- 基于STM32的Modbus通信协议
- stm32的modbus主机电表读数
- FreeModbus V1.6
评论
共有 条评论