If register should be written or read.This value is passed to the calback functions which support either reading or writing register values. Writing means that the application registers should be updated and reading means that the modbus protocol stack needs to know the current register values.See also: eMBRegHoldingCB(), eMBRegCoilsCB(), eMBRegDiscreteCB() and eMBReglnputCB().Enumeration values: MB_REG_READ Read register values and pass to protocol stack.MB_REG_WRITE Update register values.Note: Note all ports implement this function.A port which wants to get an callback must define the macro MB_PORT_HAS_CLOSE to 1.Returns: If the resources where released it return eMBErrorCode:: MB_ENOERR. If the protocol stack is not in the disabled state it returns eMBErrorCode:: MB_EILLSTATE.Examples: LINUX/demo.c, MCF5235TCP/demo.c, STR71XTCP/demo.c, WIN32/demo. cpp, and WIN32TCP/demo. cpp.his function disables processing of Modbus frames.Returns: If the protocol stack has been disabled
PIC XC8 V1.41 PRO版,編譯器破解文件,將附件文件覆蓋編譯器bin目錄下原文件即可。你懂的。。。。。。。編譯前把編譯選項(xiàng)的Free改成PRO和諧文件在MPLAB X IDE v5.00版本測試成功清除已成功 (總時(shí)間: 10ms)make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-confmake -f nbproject/Makefile-default.mk dist/default/production/KEY_V1.X.production.hexMicrochip MPLAB XC8 C Compiler (PRO Mode) V1.41Build date: Jan 24 2017Part Support Version: 1.41Copyright (C) 2017 Microchip Technology Inc.Memory Summary: Program space used 2A9h ( 681) of 1000h words ( 16.6%) Data space used 4Dh ( 77) of 100h bytes ( 30.1%) EEPROM space used 0h ( 0) of 100h bytes ( 0.0%) Data stack space used 0h ( 0) of AEh bytes ( 0.0%) Configuration bits used 2h ( 2) of 2h words (100.0%) ID Location space used 0h ( 0) of 4h bytes ( 0.0%)編譯已成功 (總時(shí)間: 2s)正在加載代碼...加載完成
摘要:介紹了以FreeModbus協(xié)議找在嵌入式搶占實(shí)時(shí)操作系統(tǒng)μC/OS-l的STM32平臺(tái)上,成功實(shí)現(xiàn)了Modbus協(xié)議的移植。通過詳細(xì)分析FreeModbus協(xié)議花并編寫STM32F103VET6微處理器的底層驅(qū)動(dòng),成功實(shí)現(xiàn)了工業(yè)Modbus協(xié)議RTU和ASCll兩種模式的通信功能。測試結(jié)果表明,在實(shí)際工業(yè)生產(chǎn)控制和儀表開發(fā)中,應(yīng)用Freemodbus協(xié)議,完全符合工業(yè)數(shù)據(jù)采集、實(shí)時(shí)控制和數(shù)據(jù)處理等廠級(jí)重復(fù)性和精確度要求,在一定程度上降低了工業(yè)儀表開發(fā)的周期及成本。關(guān)鍵詞:實(shí)時(shí)操作系統(tǒng),uC/OS-ll,F(xiàn)reeModbus,Modbus協(xié)議,STM32Abstract:This paper introduces FreeModbus stack transplanted to the STM32 platform which has been embedded in the preemptive real-time operating system uC/OS-ll,in order that the transplantation of the Modbus protocol is successfuly im-plemented.The FreeModbus stack is analyzed in detail and STM32F103VET6 microprocessor underlying driver is writed,so that the two Modbus industrial communication function RTU and ASCll are successfully realized.Keywords:time operating system,uC/OS-ll,.FreeModbus,Modbus協(xié)議,STM32