




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、modbus-8000b communication protocoljiangyin zhonghe electrical power instrument co., ltdchapter one introductionthis protocol specifies the communication protocol applied to 8000b rotary machine monitoring and protecting device developed by jiangyin zhonghe meters co., ltd. the protocol as referred
2、here can be adopted by the user and a third party in developing communication software for more details about its functions, a user can use 8000b meter data collection and management software and 8000b meters con figuration software, both of which are supplied by our compa ny.chapter two a brief int
3、roduction to the system 8000b meters communicate with upper computers and link layer adopts modbus-rtu communication protocol. the physical layer adopts rs-485 in terface master/slave operation and half duplex serial line asynchronous communication. the data format is composed of 1 start bit, 8 data
4、 bits, 1 even parity check bit and1 stop bit. the upper computer is master station and 8000b meters slave stations the contents of the protocol cover the access and modification to 8000b meters5 con figuration and parameters access to 8000b meters test data and status; transmission speed: 9600bps; t
5、he data is transmitted in the form of frame. the upper computer sends request frames while the lower computers response frames. each module within a component of 8000b meters is assigned a unique meter number (device address), with its value ranging from 1 to 255; meter number 0 represents broadcast
6、 list no. when the broadcast list number is in service, it will be received by all functional modules within 8000b networkchapter three: a brief introduction to modbus-rtu communicationprotocol3.01 basic frame formatthe basic frame format for modbus-rtu communication protocol is shown in the table b
7、elow:functionbyte countdescriptionstartt1> t2、t3、t4un able to receive a signal within the 3.5 bytes' timeslavestationaddress fieldone byterequest frame is access address and response frame is base address.function code fieldone byterefer to 2.0data fieldmultiple bytesrefer to 3.0crc16 verific
8、ationcode fieldtwo bytesrefer to 4.0endt1> t2、t3、t4stop for at least 3.5 bytes5 time3. 02 function code fieldthe function field of the modbus-rtu communication protocol is one byte. it is used for informing the slave station of the required operation. if the communication is correct, the response
9、 frame of the slave station contains the same function code. for the response in time of an error, the function code for the response frame bit7=1.the function codes used in 8000b system are listed in the table below:function codeimplication0x03read one or several 16-bit register0x06write a 16bit re
10、gister0x83read command error response0x86write comma nd error resp onse3.03 data fieldthe structure and length of the data field are determined by functions. for modbus-rtu communication protocol, the data takes the form of hexadecimal. the data is arranged by dig indian model where upper bytes prev
11、ail.3. 04 crc16 verification code fieldmodbus-rtu model is checked by 16bit verification code. the transmitter should calculate the crc 16 of every data in the sent frame and store the result in crc 16 code field the receiver shall calculate crc16, in addition to verification field of each data in t
12、he received frame a comparison shall be made between result field and verification field. only when the verification code crc 16 is the same can the received frame be confirmed. the details of crc verification algorithm are referred in appendix.chapter four: user command frame4.01 read registers dat
13、arequest frameslave device address1 bytefunction code1 byte (03h)start address of the register2 bytes (high-order bytes prevail)the number of the continuously read register2 bytes (high-order bytes prevail)crc162 bytesresponse frame:slave device address1 bytefunction code1 byte (03h)the number of da
14、ta bytes1 byte (not included)the content of the first register2 bytes (high-order bytes prevail)the content of the second register2 bytes (high-order bytes prevail)crc162bytesfor instance, read the device (address 01) (twin channel shaft vibometer)request frame 01 03 08 00 00 0186 6aresponse frame 0
15、1 03 02 00 07 f9 864.02 write register's datarequest frameslave device address1 bytefunction code1 byte (06h)write in register addresswrite in register datacrc16.2 bytes (high-order bytes prevail)2 bytes (high-order bytes prevail)2 bytesresponse frame:slave device address1 bytefunction code1 byt
16、e (06h)2 bytes (high-order bytes prevail)write in register addresswrite in register data2 bytes (high-order bytes prevail)crc162 bytesfor instance, the device address ()1 is changed to ()2,request frame: 0106 04 00 00 02 09 3bresponse frame: 02 06 04 00 00 02 09 084.03 error response frameread out e
17、rror response frameslave device address1 bytefunction code1 byte (83h)error code1 bytecrc162 byteswrite out error response frameslave device address1bytefunction code1byte (03h)error code1 bytecrc162 byteserror codethe error code will be presented in the error response frame to point out the type of
18、 the error. error codes are as follows:01:illegalfunction code02:illegaldata(register)address03:illegaldata04: command execution error05: execution time-out error06: slave device busy07: unexecutable comma nd08: even parity check errorchapter five: 8000b meter register5.01 register's structureth
19、e internal register of 8000b meter takes 16 bit double byte. according to modbus-rtu rules for byte arrangement, high-order bytes prevail.since the modbus requires that the register begi ns with 0, the register's address in a comma nd is calculated by the followi ng formula and shall be con vert
20、ed into a hexadecimal.access address= register address 40000 15.02 meter number (device address) registeraddressattributefunctio ndescription41025write/readmeter number1-255, 0: broadcast address, note 1note 1: write in the meter number of register h41025n with function code 06. it will not disappea
21、raneeafter an unexpected power failure.5.03 status registeraddressattributefun ctio ndescription42049read onlythe type of function codenote 142050read onlyalarm statusnote 2note 10000htwin channel thermometer (pt100) display precision: 0.1 °c0001htwin channel standard signal table (oil level in
22、dicator)0002h single channel eccentric meter0003h twin channel (forward run) axial displacement (expansion differenee) meter0004htwinchannel(forward approach)axial displacement(expansion difference) meter0005htwinchannelhodometer (thermoexpansion)(displayprecision:0.1) 0006htwinchannel shaft pad vib
23、rometer0007htwinchannelshaft vibrometer0008htwinchannelthermometer (k)0009h twin channel thermometer (pt100) display precision: 1 °c000ah twin channel hodometer (display precision: 1)0040h single channel rotary speed meternote 2:8 bits of low-order bytes at alarm status register are used for in
24、dicating corresponding alarm status. 1indicates alarm. highorder bytes are not used.meter typed7d6d5d4d3d2d1dorotary speed moduleoverspee d alarm 2centrifug al stop bolt iioverspeed alarm 1centrifug al stop bolt izero rotary speed alarmzero rotary speed enabli ng/disa blingdisplaceme nt modulechanne
25、l b negative alarmchannel bn egative stoppagechann el bpositiv e alarmchanne ibpositive stoppag echannel a n egative alarmchannel an egative stoppagechannel a positive alarmchannel a positive stoppageother moduleschannel b alarm 1channel b alarm 2channel aalarm 1channela alarm 25.04 data registeradd
26、ressattributefunctiondescription43073read onlymagn ificatio nno怕143074read onlychannel a alarm 1displacement positive alarm43075read onlychannel a alarm 2displacement positive stoppage43076read onlychannel b alarm 1displacement negative alarm; null forsingle channel meter43077read onlychannel b alar
27、m 2displacement negative stoppage; null for single channel meter43078read onlyzero rotary speed alarmfor rotary speed meter only43079read onlycollected current value for channel a43080read onlycollected current value for channel bnull for single channel meternote 1: the data read from registers 4307
28、4-43080 two-byte complement integer (high-order bytes prevail).the actual value is obtained by dividing the read integer by magnification.unsigned char *puchmsg ;unsigned short usdatalen ;appendices: calculation of crc 16 c functioncrc generation functionunsigned short crc16(puchmsg, usdatalen)/* me
29、ssage to calculate crc upon 7 /* quantity of bytes in message */unsigned char uchcrchi = oxff ;/* high byte of crc initialized 7unsigned char uchcrclo = oxff ;/* low byte of crc initialized 7unsigned ulndex ;/* will index into crc lookup table */while (usdatalen)/* pass through message buffer */ulnd
30、ex = uchcrchi a *puchmsg+ ;r calculate the crc */uchcrchi = uchcrclo a auchcrchiulndex;uchcrclo = auchcrcloulndex;return (uchcrchi « 8 | uchcrclo);high-order byte table/* table of crc values for high-order byte */static unsigned char auchcrchi = 0x00, 0xc1, 0x81,0x40, 0x01, oxco, 0x80, 0x41, 0x
31、01, oxco, 0x80, 0x41,0x00, 0xc1, 0x81,0x40, 0x01, oxco, 0x80, 0x41, 0x00, 0xc1,0x81, 0x40, 0x00, 0xc1,0x81,0x40, 0x01, oxco,0x80, 0x41,0x01, oxco, 0x80, 0x41,0x00, 0xc1,0x81, 0x40, 0x00, 0xc1,0x81, 0x40, 0x01,oxco, 0x80, 0x41, 0x00, 0xc1,0x81,0x40, 0x01, oxco, 0x80, 0x41, 0x01, oxco, 0x80, 0x41,0x00
32、, 0xc1, 0x81,0x40, 0x01, oxco, 0x80, 0x41, 0x00, 0xc1,0x81,0x40, 0x00, 0xc1, 0x81,0x40, 0x01,0xc0? 0x80, 0x41, 0x00, 0xc1, 0x81, 0x40, 0x01, oxco, 0x80, 0x41, 0x01, oxco,0x80, 0x41,0x00, 0xc1,0x81,0x40, 0x00, 0xc1,0x81, 0x40, 0x01, oxco, 0x80, 0x41,0x01,oxco, 0x80, 0x41,0x00, 0xc1,0x81,0x40, 0x01, o
33、xco, 0x80? 0x41, 0x00, 0xc1,0x81, 0x40,0x00, oxci, 0x81,0x40, 0x01, 0x00, 0x80, 0x41, 0x01, oxco, 0x80, 0x41,0x00, 0xc1, 0x81,0x40, 0x00, 0xc1,0x81,0x40, 0x01, oxco, 0x80, 0x41, 0x00, 0xc1,0x81,0x40, 0x01, oxco,0x80, 0x41,0x01, oxco, 0x80, 0x41,0x00, 0xc1f 0x81, 0x40, 0x00, 0xc1,0x81, 0x40? 0x01,oxc
34、o, 0x80, 0x41,0x01, oxco, 0x80, 0x41,0x00, 0xc1,0x81,0x40, 0x01, oxco, 0x80, 0x41,0x00, oxch 0x81,0x40, 0x00, 0xc1,0x81, 0x40, 0x01, oxco, 0x80, 0x41,0x00, 0xc1, 0x81,0x40, 0x01, oxco, 0x80? 0x41, 0x01, oxco, 0x80, 0x41, 0x00, 0xc1,0x81,0x40, 0x01, oxco,0x80, 0x41,0x00, 0xc1,0x81, 0x40, 0x00, 0xc1,
35、0x81, 0x40, 0x01, oxco, 0x80, 0x41,0x01,oxco, 0x80, 0x41, 0x00, 0xc1,0x81,0x40, 0x00, 0xc1,0x81,0x40, 0x01, oxco, 0x80, 0x41,0x00, 0xc1, 0x81,0x40, 0x01, oxco, 0x80, 0x41, 0x01, 0xc01 0x80, 0x41,0x00, 0xc1, 0x81,0x40;low-order byte tabler table of crc values for low-order byte */static char auchcrcl
36、o = 0x00, oxco, 0xc1,0x01, 0xc3, 0x03, 0x02, 0xc2, 0xc6, 0x06, 0x07, 0x07, 0x05, 0xc5, 0xc4,0x04, oxcc, oxoc, oxod, oxcd, oxof, oxcf, oxce, oxoe, oxoa, oxca, oxcb, oxob? 0xc9? 0x09,0x08, 0xc8, 0xd8f 0x18, 0x19, 0xd9, 0x1 b, oxdb, oxda, 0x1 a, 0x1 e, oxde, oxdf, 0x1 f, oxdd,0x1 d, 0x1 c, oxdc, 0x14, 0xd4, 0xd5, 0x15, 0xd7, 0x17, 0x1
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 网络协议的详细分类与分析试题及答案
- 嵌入式技术在智能家居中的应用试题及答案
- 公路工程可行性论证重点试题及答案
- 数据库数据导入导出试题及答案
- 计算机系统基础知识试题及答案
- 学习辅助的计算机三级数据库试题及答案
- 提升公路工程考试通过率试题及答案
- 河道整治与生态修复考核试卷
- 数据库设计的可扩展性分析试题及答案
- 网络设备管理及优化试题及答案
- 《大客户管理研究的国内外文献综述1800字》
- 预防航空人为差错
- 伤寒传染病护考题及答案
- 通信行业防洪防汛安全知识
- 平安iq测试题及答案184
- 基坑工程安全技术培训
- HSE管理体系管理手册
- 2023版煤矿安全管理人员考试题库及解析
- 2025年标准育儿嫂合同样本
- 互联网金融(同济大学)知到智慧树章节测试课后答案2024年秋同济大学
- 整体施工劳务服务方案
评论
0/150
提交评论