8000bcommunicationprotocolmodbus-8000b通信協(xié)議英文版_第1頁
8000bcommunicationprotocolmodbus-8000b通信協(xié)議英文版_第2頁
8000bcommunicationprotocolmodbus-8000b通信協(xié)議英文版_第3頁
8000bcommunicationprotocolmodbus-8000b通信協(xié)議英文版_第4頁
8000bcommunicationprotocolmodbus-8000b通信協(xié)議英文版_第5頁
已閱讀5頁,還剩6頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論