随笔分类 -  ModBus

FreeModbus
FreeModbus for stm32(Keil工程)——精简Modbus slave协议【worlsing笔记】
摘要:FreeModbus For stm32:点击下载源码 1、测试环境Keil MDK 4.7a stm32f103c8, PB12为输出线圈, 可以通过Modbus Poll来控制线圈的输出状态。 2、通过ModbusProt.h配置硬件、数据缓冲区大小和功能码配置 #define UART_USE ... 阅读全文

posted @ 2013-11-25 16:11 Worldsing 阅读(6835) 评论(3) 推荐(0)

FreeModbus Slave For AVR源代码 精简版2 【worldsing 笔记】
摘要:FreeModbus 源码:点击下载 线圈BUG解决(后来发现不一定是BUG) 1、eMBException eMBFuncWriteCoil( UCHAR * pucFrame, USHORT * usLen )中的 usRegAddress++;行注释掉,否则输出线圈0永远无法输出,其它的线圈错位。 2、eMBException eMBFuncWrit... 阅读全文

posted @ 2013-08-17 13:29 Worldsing 阅读(1646) 评论(0) 推荐(0)

FreeModbus Slave 改进的eMbPoll()【worldsing 笔记】
摘要:eMbPoll()的作用是FreeMod协议通信过程中不断查询事件对列有无完速数据桢,并进行地址和CRD验证,最后运行和回复主机。为了减小代码尺寸对eMbPoll进行改进:原版: 1: 2: eMBErrorCode 3: eMBPoll( void ) 4: { 5: static UCHAR *ucMBFrame; 6: static UCHAR ucRcvAddress; 7: static UCHAR ucFunctionCode; 8: static USHORT usLength; 9: ... 阅读全文

posted @ 2013-08-14 10:37 Worldsing 阅读(4411) 评论(0) 推荐(0)

FreeModbus Slave RTU 精简版源代码【worldsing 笔记】
摘要:RTU精简版本测试环境:IAR for avr 5.40 + M128 目前只优化了ModBusPort.c和ModBusRTU.c ModBusPort.c 566 bytes of CODE memory (+ 19 bytes shared) 4 bytes of DATA memory (+ 13 bytes shared) ModBusRTU.c 1 677 bytes of CODE memory (+ 14 bytes shared) 821 bytes of DATA memory (+ 1 byte shared) ModbusFun.c... 阅读全文

posted @ 2013-08-09 13:50 Worldsing 阅读(1340) 评论(0) 推荐(0)