Home

MODBUS communication protocol

image

Contents

1. kvarh C e System leading reactive energy 0 1 varh 16 MODBUS RTU ASCII TCP Register description COUNTER amp COMMUNICATION DATA Serial number Model F code Hex INTEGER Hex Register Words Data meaning 10 ASCII chars 00 FF 03 6A 3phases 4wires 06 6A 3phases 3wires 08 80A 3phases 4wires 0A 80A 3phases 3wires 0C 80A 1phase 2wires Firmware release Hardware version 01 NO MID 02 MID Convert the read Hex value in Decimal value e g 66 102 rel 1 02 Convert the read Hex value in Decimal value e g 64 100 rev 1 00 Reserved i a aan Primary secondary value Error code CT value only Reserved FSA value Wiring mode MODBUS address 03 not available for MODBUS TCP MODBUS mode not available for MODBUS TCP Communication speed not available for MODBUS TCP MODBUS RTU ASCII TCP 03 0515 ere Pr det aay 02 tariff 2 00 primary 01 secondary 00 none 01 phase sequence error 01 5A 02 80A ee EE 02 3phases 3 wires 03 1 phase 04 3phases 2 wires 01 F7 01 8N1 RTU 01 300 bps 02 600 bps 03 1200 bps 04 2400 bps 05 4800 bps 06 9600 bps 07 19200 bps 08 38400 bps 09 57600 bps 17 Register description COUNTER amp COMMUNICATION DATA Partial counters status COMMUNICATION MODULE DATA Serial number F code Hex 03
2. 1 Function code 1 o of byte of requested data 2 io i PWEOPR ER I Requested data 4 SA MA o di MODBUS RTU ASCII TCP 7 2 3 Floating point as per IEEE Standard The basic format allows a IEEE standard floating point number to be represented in a single 32 bit format as shown below N n 1 28127 1 f where S is the sign bit e is the first part of the exponent and f is the decimal fraction placed next to 1 Internally the exponent is 8 bits in length and the stored fraction is 23 bits long A round to nearest method is applied to the calculated value of floating point The floating point format is shown as follows 31 30 23 22 0 amp bit number where bit length Sign 1 Exponent 8 Fraction 23 1 Total m 32 1 Exponent Min e 0 Max e 255 Bias 127 El more Fractions decimals are always shown while the leading 1 hidden bit is not stored EXAMPLE OF CONVERSION OF VALUE SHOWN WITH FLOATING POINT Value read with floating point 45AACCOO Value converted in binary format 010001011 01010101100110000000000 exponent fraction sign sign 0 exponent 10001011 139 fraction 01010101100110000000000 8388608 2804736 8388608 0 334350585 N n 1 28777 14f 1 2 927 1 332850585 1 4096 1 334350585 9465 5 8 MODBUS RTU ASCII TCP 3 Write commands structure
3. kvarhy ms e System exported lagging reactive energy SM 03 0 Em REE Lo ce Phase me aa nn DE win Mm Ckvarh2 Cee Phase 2 imported leading reactive energy P 03 04 nr 0363 Li i a ee En Fr EG A cc kvarh C e System imported leading reactive energy 03 kvarh1 C Phase 1 exported leading reactive energy 03 1 kvarh2 C Phase 2 exported leading reactive energy 08 04 kvarh3 C Phase 3 exported leading reactive energy 03 1 NINININININININININININ CO CI ES EY 1055 69 i 9 co kvarh C e System exported leading reactive energy 03 PARTIAL COUNTER VALUES NN ETA CORO NEN kWh e System exported active energy 0 1 VAh kVAh L e System exported lagging apparent energy 0 1 VAh kVAh C e System imported leading apparent energy 0 1 VAh ae gt DI ER oa s n wa D 3 Te O i D OL D wo j a ab n Ka ab Fa oO oO oO us WQ lt CES pe e System ee Sa a energy 0 1 VAh MS See I ee A adi J a nn Pili I N n mee Fe MAA 0 1 varh kvarhy L System exported lagging reactive energy kvarh C e System imported leading reactive energy Con ICON 69 69 kvarh C e System exported leading reactive energy kWh System active energy 1 0 1 Wh 1 KVAhY Le e System lagging apparent energy 0 1 VAh 141 kVAh C e System leading apparent energy 0 1 VAh kvarh L e System lagging reactive energy 0 1 varh 1
4. 03 04 INTEGER Register Hex Words Data meaning Convert the read Hex value in Binary e g 0003 000000000000001 1 Each bit corresponds to the status of a partial counter O inactive 1 active 0000000000000011 Start to read bit string following the arrow The first bit corresponds to the status of the first counter in the list 1 kWh PAR 2 kWh PAR 3 kVAh L PAR 4 kVAh L PAR 5 kVAh C PAR 6 kVAh C PAR 7 kvarh L PAR 8 kvarh L PAR 9 kvarh C PAR 10 kvarh C PAR The last six bits of the string are reserved In the example only kWh PAR and kWh PAR counters are active 10 ASCII chars 00 FF Reserved Firmware release Hardware version 18 03 04 03 04 Convert the read Hex value in Decimal value e g 66 102 rel 1 02 Convert the read Hex value in Decimal value e g 64 100 rev 1 00 MODBUS RTU ASCII TCP Register description COILS Alarm events COUNTER NOMINAL VOLTAGE MODBUS RTU ASCII TCP PHASE VOLTAGE available only for 2 4 wire model counters UV n Vnom 20 OV y Vnom 20 UV 230V 20 OV 240V 20 F code Register Hex Hex 01 40 coils UV3 UV2 UV1 UVI ICOM RES UV23 UV31 IRES RES RES RES IUI2 UIT LUIZ JOIN Byte 5 frequency out IRES RES RES RES LEGEND UV undervoltage OV overvoltage Ul undercurrent Ol overcurrent RES reserved
5. 0 ES ELO ES 9 COR SCO tC Om OG ICON ED OG ICON OG GO ICON COR COR icon eo ee A en dr Rik Rin ER kvarh3 C e Phase 3 exported leading reactive energy 03 0 kvarh C e System exported leading reactive energy TARIFF 1 COUNTER VALUES a ee gt FA wm kVAh1 Le Phase imported lagging apparent energy 03 0 KVAN2 Le Phase 2 imported lagging apparent energy 03 0 kVAh3 L e Phase 3 imported lagging apparent energy 03 0 kWh1 e Phase 1 imported active energy 03 04 3 kWh2 Phase 2 imported active eneray gt at 03 04 i 3 i iene La kN rn JE I Li a kWhy System imported active energy o vi 03 04 3 re De a a PER pe JEG n 7 kWh2 Phase 2 exported active energy ur u 03 04 3 nz Phase i ee a ay NR ENGE RTE NESS rr JER va i E KW e System exported active energy i o 03 04 3 ae A OR A 4 kVAh L e System imported lagging apparent energy 03 04 kVAh1 L e Phase 1 exported lagging apparent energy 03 04 C Ss kVAh3 L e Phase 3 exported lagging apparent energy 03 0 KVANJ Le e System exported lagging apparent energy 03 0 gt R GO 5 E ES N EN In kVAh1 C e Phase 1 imported leading apparent energy 03 0 14 MODBUS RTU ASCII TCP Parameter INTEGER IEEE Register Hex Words M U Register Hex Words M U TARIFF 1 COUNTER VALUES kVAh2 C e Phase 2 impor
6. 08 kvarh C PAR 09 kvarh C PAR 0A all partial counters Byte 2 partial counter s operation 01 start 02 stop 03 reset e g start kWh PAR counter 00 kWh PAR 01 start final value to be set 0001 NOTE 0513 0514 0515 writing registers allow to program the communication parameters 20 MODBUS RTU ASCII TCP MODBUS RTU ASCII TCP 21 lancieri 1108 44 HI Erlenstra e 14 e 90441 N rnberg e GERMANY Tel 49 0 911 4 23 47 0 e Fax 49 0 911 4 23 47 39 info weigel messgeraete de e www weigel messgeraete de
7. 0x77 0xB7 0xB6 0x76 0x72 0xB2 0xB3 0x73 0OxB1 0x71 0x70 OxBO 0x50 0x90 Ox91 0x51 0x93 0x53 0x52 0x92 0x96 0x56 0x57 0x97 0x55 0x95 0x94 0x54 Ox9C 0x5C 0x5D 0x9D 0x5F 0x9F 0x9E 0x5E 0x5A 0x9A 0x9B 0x5B 0x99 0x59 0x58 0x98 0x88 0x48 0x49 0x89 0x4B 0x8B OX8A 0x4A 0x4E 0x8E 0x8F 0x4F 0x8D 0x4D 0x4C 0x8C 0x44 0x84 0x85 0x45 0x87 0x47 0x46 0x86 0x82 0x42 0x43 0x83 0x41 0x81 0x80 0x40 unsigned short ModBus CRC16 unsigned char Buffer unsigned short Length unsigned char CRCHi OxFF unsigned char CRCLo OxFF int Index unsigned short ret while Length Index CRCLo Buffer CRCLo CRCHi CRC Table Hi Index CRCHi CRC Table Lo Index ret unsigned short CRCHi lt lt 8 ret unsigned short CRCLo return ret 4 MODBUS RTU ASCII TCP CRC GENERATION FUNCTIONS Without Table unsigned short ModBus CRC16 unsigned char Buffer unsigned short Length ModBus_CRC16 Calculatd CRC16 with polynome 0xA001 and init value OxFFFF Input Buffer pointer on data Input Lenght number byte in buffer Output calculated CRC16 unsigned int cur crc cur _crc 0xFFFF do unsigned int i 8 cur _crc cur cre Buffer do if 0x0001 amp cur crc cur_crc gt gt 1 A cur_cre 0xA001 else cur_crc gt gt 1 while i while Length return cur ero MODBUS
8. Transaction identifier 1 High Low sissi Protocol identifier 4 High Low io i Coo E NSO oie eit Byte count 1 ies ee prigioni S I he i papers 1 Function code 1 Starting register 2 Command successfully sent 2 10 MODBUS RTU ASCII TCP 4 Exception codes When the module receives a not valid query an error message exception code is sent According to the used MODBUS protocol mode possible exception codes are as follows 4 1 MODBUS ASCII RTU Values contained in Response messages are in hex format Response example in case of MODBUS RTU 01830131F0 Example Byte Description No of bytes 01 Slave address 1 83 Function code 80 03 1 01 Exception code 1 31 High da Error check CRC 2 FO Low Exception codes for MODBUS ASCII RTU are following described 01 02 03 04 ILLEGAL FUNCTION the function code received in the query is not an allowable action ILLEGAL DATA ADDRESS the data address received in the query is not an allowable address i e the combination of register and transfer length is invalid ILLEGAL DATA VALUE a value contained in the query data field is not an allowable value ILLEGAL RESPONSE LENGTH the request would generate a response with size bigger than that available for MODBUS protocol 4 2 MODBUS TCP Values contained in Response messages are in hex format Response example in case of MODBUS TCP 010000000003018302 Examp
9. bit to 0 shown below PARAMETER THRESHOLDS LINE VOLTAGE CURRENT not available for 2 wire model counter UV Vnom V3 20 OV Vnom V3 20 yl Start current value Ist Ol Full scale value FS UV 400V 20 OV 415V 20 Data meaning Byte 1 voltage out of range OV3 OV2 Byte 2 line voltage out of range UV12 0V23 Byte 3 4 current out of range RES RES CHRO of range RIESINRES F frequency out of range COM communication in progress ov1 OVY 0V31 OV12 UIN UI3 011 Oly RESINE NOTE the voltage current and frequency threshold values can change according to the counter model Please refer to the table FREQUENCY F low 45Hz F high 65Hz 19 5 2 Writing registers Function code 10 or INTEGER DEL code i ___ Register description Hex Register wee Programmable data Hex COUNTER amp COMMUNICATION DATA MODBUS address 10 01 F7 not available for MODBUS TCP MODBUS mode 10 00 7E2 ASCII not available for MODBUS TCP 01 8N1 RTU Communication speed 10 01 300 bps not available for MODBUS TCP 02 600 bps 03 1200 bps 04 2400 bps 05 4800 bps 06 9600 bps 07 19200 bps 08 38400 bps 09 57600 bps Reserved 10 Partial counters status 10 Byte 1 partial counter selection 00 kWh PAR 01 kWh PAR 02 kVAh L PAR 03 kVAh L PAR 04 kVAh C PAR 05 kVAh C PAR 06 kvarh L PAR 07 kvarh L PAR
10. 0x01 OxCO 0x80 0x41 0X00 OxC1 0x81 0x40 0x00 OxC1 0x81 0x40 0X01 0xC0 0x80 0x41 0x00 OxC1 0x81 0x40 Ox01 0xC0 0x80 0x41 0x01 OXCO 0x80 0x41 0x00 OxC1 0x81 0x40 Ya CRC table for calculate with polynom 0xA001 with init value 0xFFFF Low half word rom unsigned char CRC Table Lol 0x00 0xC0 OxCl 0x01 0xC3 0x03 0x02 0xC2 0xC6 0x06 0x07 0xC7 0x05 0xC5 OxC4 0x04 OxCC 0x0C 0x0D OxCD 0x0F OxCF OXCE 0x0E O0x0A OxCA 0xCB 0x0B 0xC9 0x09 0x08 0xC8 0xD8 0x18 0x19 0xD9 0x1B 0xDB OxDA 0x1A 0x1E OXDE OxDF 0x1F OXDD Ox1D 0x1C OxDC 0x14 0xD4 OxD5 0x15 0xD7 0x17 0x16 0xD6 0xD2 0x12 0x13 0xD3 0x11 0xD1 OxDO 0x10 OxFO 0x30 0x31 OxF1 0x33 0xF3 0xF2 0x32 0x36 OXF6 0xF7 0x37 OXF5 0x35 0x34 0xF4 0x3C OxFC OxFD 0x3D OxFF 0x3F 0x3E OXFE OXFA 0x3A 0x3B OXFB 0x39 0xF9 0xF8 0x38 0x28 0xE8 0xE9 0x29 OXEB 0x2B 0x2A OXEA OXEE 0x2E OX2F OXEF 0x2D OXED OXEC 0x2C OXE4 0x24 0x25 0xE5 0x27 0xE7 OXE6 0x26 0x22 0xE2 0xE3 0x23 OXEL 0x21 0x20 OxEO OxA40 0x60 0x61 OxA1 0x63 OxA3 0xA2 0x62 0x66 OxA6 OXA7 0x67 OXA5 0x65 0x64 OxA4 0x6C OXAC OXAD Ox6D OXAF 0x6F 0x6E OXAE OxAA 0x6A 0x6B OXAB 0x69 OxA9 OxA8 0x68 0x78 0xB8 0xB9 0x79 OXBB 0x7B Ox7A OXBA OXBE 0x7E 0x7F 0xBF 0x7D 0xBD OXBC 0x7C 0xB4 0x74 0x75 OXB5
11. 1MWUPRMD MODBUS communication protocol User manual Limitation of Liability The Manufacturer reserves the right to modify the specifications in this manual without previous warning Any copy of this manual in part or in full whether by photocopy or by other means even of electronic nature without the manufacture giving written authorisation breaches the terms of copyright and is liable to prosecution It is absolutely forbidden to use the device for different uses other than those for which it has been devised for as inferred to in this manual When using the features in this device obey all laws and respect privacy and legitimate rights of others EXCEPT TO THE EXTENT PROHIBITED BY APPLICABLE LAW UNDER NO CIRCUMSTANCES SHALL THE MANUFACTURER BE LIABLE FOR CONSEQUENTIAL DAMAGES SUSTAINED IN CONNECTION WITH SAID PRODUCT AND THE MANUFACTURER NEITHER ASSUMES NOR AUTHORIZES ANY REPRESENTATIVE OR OTHER PERSON TO ASSUME FOR IT ANY OBBLIGATION OR LIABILTY OTHER THAN SUCH AS IS EXPRESSLY SET FORTH HEREIN AU trademarks in this manual are property of their respective owners The information contained in this manual is for information purposes only is subject to changes without previous warning and cannot be considered binding for the Manufacturer The Manufacturer assumes no responsabilty for any errors or incoherence possibly contained in this manual MODBUS communication protocol for WEZ Modbus and WEZ Ethernet modules October edition
12. 2013 De TT een 1 1 1 LRC generation iii 2 1 2 CRC generation iii 3 2 Read commands structure 1 1 11 1s 6 2 1 MODBUS ASCII RTU ceneri 6 2 2 MODBUS TEPPE 7 2 3 Floating point as per IEEE Standard 8 3 Write commands structure 11 1s 9 3 MODBUS ASCII RTU csisisiicaa ein 9 32 MOD BUS TCP nun 10 4 Exception Cod Sisi 11 4 1 MODBUS ASEIURTU anna ee as 11 4 2 MODBUS TOP nun 11 5 Register tables n annnnrnnnnnnnnnnnnnnnnnnennennnnnennnnnnenn 12 5 1 Reading registers Function code 01 03 04 13 5 2 Writing registers Function code 10 20 1 Description MODBUS ASCII RTU is a master slave communication protocol able to support up to 247 slaves connected in a bus or a star network The protocol uses a simplex connection on a single line In this way the communication messages move on a single line in two opposite directions MODBUS TCP is a variant of the MODBUS family Specifically it covers the use of MODBUS messaging in an Intranet or Internet environment using the TCP IP protocol on a fixed port 502 Master slave messages can be e Reading Function code 01 03 04 the communication is between the master and a single slave It allows to read information about the queried counter e Writing Function code 10 the communication is between the master
13. C is 1 Add all bytes in the message excluding the starting colon and ending CR LF Add them into an 8 bit field so that carries will be discarded 2 Subtract the final field value from FF to produce the ones complement 3 Add 1 to produce the twos complement PLACING THE LRC INTO THE MESSAGE When the the 8 bit LRC 2 ASCII characters is transmitted in the message the high order character will be transmitted first followed by the low order character For example if the LRC value is 52 0101 0010 Colon Addr Func Data Data Data ans Data LRC LRC CR LF i Count Hi 5 Lo2 C FUNCTION TO CALCULATE LRC pucFrame pointer on Addr of message usLen length message from Addr to end Data UCHAR prvucMBLRC UCHAR pucFrame USHORT usLen UCHAR ucLRC 0 LRC char initialized while usLen UCLRC pucFrame Add buffer byte without carry Return twos complement ucLRC UCHAR CHAR ucLRC return ucLRC 2 MODBUS RTU ASCII TCP 1 2 CRC generation The Cyclical Redundancy Check CRC field is two bytes containing a 16 bit value The CRC value is calculated by the transmitting device which appends the CRC to the message The receiving device recalculates a CRC during receipt of the message and compares the calculated value to the actual value it received in the CRC field If the two values are
14. RTU ASCII TCP 5 2 Read commands structure The master communication device can send commands to the module to read its status and setup or to read the measured values status and setup relevant to the counter More registers can be read at the same time sending a single command only if the registers are consecutive see chapter 5 According to the used MODBUS protocol mode the read command is structured as follows 2 1 MODBUS ASCII RTU Values contained both in Query or Response messages are in hex format Query example in case of MODBUS RTU 01030002000265CB Example Byte Description No of bytes Slave address 1 Function code 1 Starting register 2 No of words to be read 2 Error check CRC 2 Example Byte Description No of bytes 01 Slave address 1 03 Function code 1 s i LL a cado Requested data 4 Error check CRC 2 6 MODBUS RTU ASCII TCP 2 2 MODBUS TCP Values contained both in Query or Response messages are in hex format Query example in case of MODBUS TCP 010000000006010400020002 Example Byte Description No of bytes 01 Transaction identifier 1 Protocol identifier 4 Byte count Unit identifier Response example in case of MODBUS TCP 01000000000701040400035571 Example Byte Description No of bytes 01 Transaction identifier 1 Protocol identifier 4 ii O iti i Byte count 1 Unit identifier 1 o
15. The master communication device can send commands to the module to program itself or to program the counter More settings can be carried out at the same time sending a single command only if the relevant registers are consecutive see chapter 5 According to the used MODBUS protocol type the write command is structured as follows 3 1 MODBUS ASCII RTU Values contained both in Request or Response messages are in hex format Query example in case of MODBUS RTU 011005150001020008F053 Example Byte Description No of bytes Slave address 1 Function code 1 Starting register 2 No of words to be written 2 Data byte counter Example Byte Description No of bytes 01 Slave address 1 0 05 g i 3 15 Low 00 High i rr SENSE No of written words P 01 Low 10 High ENE rate Error check CRC 2 El Low MODBUS RTU ASCII TCP 9 3 2 MODBUS TCP Values contained both in Request or Response messages are in hex format Query example in case of MODBUS TCP 010000000009011005150001020008 Example Byte Description No of bytes 01 Transaction identifier 1 00 High 00 Low cr GATA Protocol identifier 4 Byte count 1 so E re oc 2 Neen e AN EE Starting register 2 Ge No of words to be written 2 Data byte counter a Data for programming 2 Response example in case of MODBUS TCP 010000000006011005150001 Example Byte Description No of bytes 01
16. and a single slave It allows to change the counter settings e Broadcast not available for MODBUS TCP the communication is between the master and all the connected slaves It is always a write command Function code 10 and required logical number 00 In a multi point type connection MODBUS ASCII RTU slave address called also logical number allows t identify each counter during the communication Each counter is preset with a default slave address 01 and the user can change it Oo In case of MODBUS TCP slave address is replaced by a single byte the Unit identifier COMMUNICATION FRAME STRUCTURE ASCII mode Bit per byte 1 Start 7 Bit Even 1 Stop 7E1 Name Length Function START FRAME 1 char Message start marker Starts with colon 3A ADDRESS FIELD 2 chars Counter logical number FUNCTION CODE 2 chars Function code 01 03 04 10 DATA FIELD n chars Data length will be filled depending on the message type ERROR CHECK 2 chars Error check LRC END FRAME 2 chars Carriage return line feed CRLF pair 0D 0A RTU mode Bit per byte 1 Start 8 Bit None 1 Stop 8N1 Name Length Function START FRAME 4 chars idle At least 4 character time of silence MARK condition ADDRESS FIELD 8 bits Counter logical number FUNCTION CODE 8 bits Function code 01 03 04 10 DATA FIELD nx 8 bits Data length will be filled depen
17. de 127 registers e in TCP mode 256 bytes NOTE Highest number of registers which can be programmed with a single command e in ASCII mode 13 registers e in RTU mode 29 registers e in TCP mode 1 register NOTE The register values are in hex format TABLE HEADER MEANING Parameter Measuring parameter to be read Register description Description of the register to be read written F code Hex Function code in hex format It identifies the command type reading writing Sign If this column is checked the read register value can have positive or negative sign Convert a signed register value as shown in the following instructions The Most Significant Bit MSB indicates the sign as follows O positive 1 negative NEGATIVE VALUE EXAMPLE MSB 8020 1000000000100000 32 HEX BIN DEC gene te ON cae ae o od IEEE Register Hex Words M U Data meaning Programmable data Description of data which can be sent for a writing command 12 MODBUS RTU ASCII TCP 5 1 Reading registers Function code 01 03 04 INTEGER IEEE F code Register Hex Parameter Hex Sign Register Hex Words M U Words M U REAL TIME VALUES V1 e L N voltage phase 1 03 04 gt vo ne IRR RA RR En EN KR Da u en ci EN SE Er A O v s an ee EE V31 e L L voltage line31 03 0 i a ra EN uu SENSI NONE INNATA en Ci a en A3 Phase 3 current N o a Di 03 0 ne no e i ee nee SEI P
18. ding on the message type ERROR CHECK 16 bits Error check CRC END FRAME 4 chars idle At least 4 character time of silence between frames MODBUS RTU ASCII TCP 1 TCP mode Bit per byte 1 Start 7 Bit Even 2 Stop 7E2 Name Length Function TRANSACTION ID 2 bytes For synchronization between messages of server amp client PROTOCOL ID 2 bytes Zero for MODBUS TCP BYTE COUNT 2 bytes Number of remaining bytes in this frame UNIT ID 1 byte Slave address 255 if not used FUNCTION CODE 1 byte Function code 01 04 10 DATA BYTES n bytes Data as response or command 1 1 LRC generation The Longitudinal Redundancy Check LRC field is one byte containing an 8 bit binary value The LRC value is calculated by the transmitting device which appends the LRC to the message The receiving device recalculates an LRC during receipt of the message and compares the calculated value to the actual value it received in the LRC field If the two values are not equal an error results The LRC is calculated by adding together successive 8 bit bytes in the message discarding any carries and then two s complementing the result The LRC is an 8 bit field therefore each new addition of a character that would result in a value higher than 255 decimal simply rolls over the field s value through zero Because there is no ninth bit the carry is discarded automatically A procedure for generating an LR
19. energy E AVAL Lo e System imported lagging apparent energy RK kVAhI L_ Phase 1 exported lagging apparent energy OM KVAh2 L Phase 2 exported lagging apparent energy E kVAh3 L Phase 3 exported lagging apparent energy KVAh Le e System exported lagging apparent energy kVAh1 Ce Phase 1 imported leading apparent energy i kVAh2 C e Phase 2 u us apparent energy kVAh C e System imported leading apparent energy kVAh1 C e Phase 1 exported leading apparent energy kVAh2 C e Phase 2 exported leading apparent energy MODBUS RTU ASCII TCP Phase 3 imported lagging reactive energy 08 0 08 corn 03 0 E dei 03 04 kvarh1 Ce Phase 1 imported leading reactive energy 03 0 03 0 03 0 03 0 BI 03 R BK 0288 08 04 03 0 GO 25 E ES Go ED ca NEN NR N N nn n nn nn N DR NNN N NINININININININININININININININ INN NEN EN 15 INTEGER IEEE F code Parameter Hex Sign Register Register Words M U Words M U Hex Hex TARIFF 2 COUNTER VALUES kVAh3 C e Phase 3 exported leading apparent energy 03 0 kVAh C e System exported leading apparent energy 03 kvarh2 L e Phase 2 imported lagging reactive energy 03 kvarh3 L e Phase 3 imported lagging reactive energy 03 kvarh2 Le Phase 2 exported lagging reactive energy 03 0 0 pe E i 3 oa ae ae ee ST E IU
20. ge buffer CRC table for calculate with polynom 0xA001 with init value OxFFFF High half word rom unsigned char CRC Table Hil 0x00 OxC1 0x81 0x40 Ox01 OxCO 0x80 0x41 Ox01 OXCO 0x80 0x41 0x00 OxCl 0x81 0x40 0x01 OxCO 0x80 0x41 0x00 0xC1 Ox81 0x40 0x00 0xC1 0x81 0x40 Ox01 OXCO 0x80 0x41 0x01 OxCO Ox80 0x41 0x00 0xC1 0x81 0x40 0x00 OxCl 0x81 0x40 0X01 OxCO 0x80 0x41 0x00 0OxC1 0x81 0x40 0x01 OxCO 0x80 0x41 0x01 OxCO 0x80 0x41 0x00 0xC1 0x81 0x40 0x01 0xC0 0x80 0x41 0x00 0xC1 0x81 0x40 0x00 OxCl 0x81 0x40 0x01 OxCO 0x80 0x41 0x00 0xC1 Ox81 0x40 Ox01 0xC0 0X80 0x41 Ox01 OXCO 0x80 0x41 0x00 0xC1 0x81 0x40 0x00 0xC1 0x81 0x40 0x01 OxCO 0x80 0x41 0x01 OxCO 0x80 0x41 0X00 0xC1 0x81 0x40 0x01 OxCO 0x80 0x41 0x00 OxC1 0x81 0X40 0x00 OxC1 0x81 0x40 0x01 0xC0 0x80 0x41 0X01 0xC0 0x80 0x41 0x00 OxC1 0x81 0x40 0x00 OxC1 0x81 0x40 0x01 0xC0 0x80 0x41 0x00 0xC1 0x81 0x40 Ox01 OXCO 0x80 0x41 0x01 0xC0 0x80 0x41 0x00 0xC1 0x81 0x40 0x00 0xC1 0x81 0x40 0x01 OxCO 0x80 0x41 0x01 OxCO 0x80 0x41 0x00 OxC1 0x81 0x40 0x01 OxCO 0x80 Ox41 0x00 OxC1 0x81 0x40 0x00 0xC1 0x81 0x40 0x01 OXCO 0x80 0x41 0x00 OxC1 0x81 0x40 0x01 OxCO 0x80 0x41 0x01 0xC0 0X80 0x41 0x00 0xC1 0X81 0x40 Ox01 OXCO 0x80 0x41 0x00 0xC1 0x81 0x40 0x00 0xC1 0x81 0x40 0x01 0xC0 0x80 0x41
21. le Byte Description No of bytes 1 Transaction identifier 1 High Low 0 0 TR o Protocol identifier di 0 High 0 3 Low O OTTO 0 I om Unit identifier 1 Function code 80 03 1 1 o Exception code Exception codes for MODBUS TCP are following described 01 02 ILLEGAL FUNCTION the function code is unknown by the server ILLEGAL DATA ADDRESS the data address received in the query is not an allowable address for the counter i e the combination of register and transfer length is invalid MODBUS RTU ASCII TCP 11 03 ILLEGAL DATA VALUE a value contained in the query data field is not an allowable value for the counter 04 SERVER FAILURE the server failed during the execution 05 ACKNOWLEDGE the server accepted the server invocation but the service requires a relatively long time to execute The server therefore returns only an aknowledgement of the service Invocation receipt 06 SERVER BUSY the server was unable to accept the MB request PDU The client application has the responsability of deciding if and when re sending the request 0A GATEWAY PATH UNAVAILABLE the communication module is not configured or cannot communicate 0B GATEWAY TARGET DEVICE FAILED TO RESPOND the counter is not available in the network 5 Register tables El nore Highest number of registers or bytes which can be read with a single command e in ASCII mode 63 registers e in RTU mo
22. not equal an error results The CRC is started by first preloading a 16 bit register to all 1 s Then a process begins of applying successive 8 bit bytes of the message to the current contents of the register Only the eight bits of data in each character are used for generating the CRC Start and stop bits and the parity bit do not apply to the CRC During generation of the CRC each 8 bit character is exclusive ORed with the register contents Then the result is shifted in the direction of the least significant bit LSB with a zero filled into the most significant bit MSB position The LSB is extracted and examined If the LSB was a 1 the register is then exclusive ORed with a preset fixed value If the LSB was a 0 no exclusive OR takes place This process is repeated until eight shifts have been performed After the last eighth shift the next 8 bit character is exclusive ORed with the register s current value and the process repeats for eight more shifts as described above The final contents of the register after allthe characters of the message have been applied is the CRC value A calculated procedure for generating a CRC is 1 Load a 16 bit register with FFFF Call this the CRC register 2 Exclusive OR the first 8 bit byte of the message with the low order byte of the 16 bit CRC register putting the result in the CRC register 3 Shift the CRC register one bit to the right toward the LSB zero filling the MSB Extract and e
23. orted lagging apparent energy QW N MODBUS RTU ASCII TCP 13 INTEGER IEEE Parameter Facade Sign i i Hex Register Words M U Register Words M U Hex Hex TOTAL COUNTER VALUES kVAh1 L e Phase 1 exported lagging apparent energy 03 0 kVAh2 L e Phase 2 exported agging apparent energy 03 0 kVAh L e System exported lagging apparent energy 03 04 kVAh1 C e Phase 1 imported leading apparent energy 03 04 d A kVAh Co e System imported leading apparent el energy 03 04 kVAh1 Ce Phase 1 exported leading apparent energy 03 04 KVAh2 C Phase 2 exported leading apparent energy 03 04 kVAh3 C e Phase 3 exported leading apparent energy 03 04 kVAR Ce System exported leading apparent energy 03 04 kvarh1 L e Phase 1 imported lagging reactive energy 03 04 kvarh2 L Phase 2 imported lagging reactive energy OM 03 04 he i I se O ae BER kvarh L De e System imported lagging reactive energy 03 04 pe ce Phase A cee i HER mel JE Fen Phase Fe 08 04 kvarh3 L e Phase 3 exported lagging reactive energy 03 0 kvarh L gt System exported lagging reactive energy 03 0 kvarh1 Co Phase 1 imported leading reactive energy 03 0 kvarh2 Ce Phase 2 imported leading reactive energy 03 0 kvarh3 C e Phase 3 e an reactive energy 03 0 kvarh1 C e Phase 1 exported leading reactive energy kvarh2 C e Phase 2 exported leading reactive energy 03
24. ri ee are E i i ne PF2 Phase 2 power factor 03 0 PF3 Phase 3 power factor 03 0 NEN NS NEN iS x S O ONS EDS SD ES ENS FR FIN ER ES ES NINININININININININININININ O oro OO O O O i ainsi i 5 P1 e Phase 1 active power 03 0 P2 e Phase 2 active power 03 0 SU Se BE a gt Di i iO i Nini QW I O R x P3 e Phase 3 active power m Uni lt G un D 3 w O en d e o d 53 S oo ig G R x N S1 e Phase 1 apparent power 03 04 x 52 Phase 2 apparent power 03 04 X NN Qi o Phase 1 reactive power 03 04 X Q2 Phase 2 reactive power 03 0 Q3 Phase 3 reactive power 03 0 ae e System reactive power 03 0 Fo e Frequency 03 0 Phase sequence 03 04 00 123 CCW 01 321 CW 02 not available in case of 1 phase counter TOTAL COUNTER VALUES O mo E kWh2 Phase 2 imported active energy kWh3 Phase 3 imported active energy s oS kWh e System imported active energy kWh1 e Phase 1 exported active energy ey oO kWh2 Phase 2 exported active energy Sa MiG SHIN no Ss di kWh3 e Phase 3 exported active energy 0 0 o kWhy System exported active energy kVAh1 L e Phase 1 imported lagging apparent energy kVAh2 ine Phase 2 lagging apparent energy oE o ICON 9 ICON CORO COR ICON CORIO NEN EN EN EN EN EN EN EN DEN kVAh L e System imp
25. ted leading apparent energy kVAh3 C e Phase 3 imported leading apparent energy kVAh1 C e Phase 1 exported leading apparent energy KVAh2 Ce Phase 2 exported pe apparent energy kvarh1 L Phase 1 imported lagging reactive energy kvarh2 L Phase 2 imported lagging reactive energy kvarh3 L kvarh DE System imported lagging reacti ve energy kvarh1 L e Phase 1 exported lagging reactive energy kvarh2 L e Phase 2 exported lagging reactive energy kvarh3 i Phase 3 exported lagging reactive energy kvarh Le e System exported lagging reactive energy kvarh2 Co Phase 2 imported leading reactive energy kvarh3 To Phase 3 imported leading reactive energy kvarh Ce e System imported leading reactive energy kvarh1 Ce Phase 1 exported leading reactive energy kvarh2 C Phase 2 exported leading reactive energy kvarh3 Ce Phase 3 exported leading reactive energy kvarh Ce System exported leading reactive energy TARIFF 2 COUNTER VALUES kWh1 e Phase 1 ee active energy kWh3 Phase imported active energy kWh e System imported active energy kWh1 e Phase 1 exported active energy kWh2 Phase 2 exported active energy kWh3 e Phase 3 exported active energy kWhy System exported active energy kVAh1 L e Phase 1 imported lagging apparent energy a 4kVAh2 L re Phase 2 imported lagging apparent energy KE KVAN3 L Le gt Phase 3 imported lagging apparent
26. xamine the LSB 4 If the LSB was 0 Repeat Step 3 another shift If the LSB was 1 Exclusive OR the CRC register with the polynomial value A001 1010 0000 0000 0001 5 Repeat Steps 3 and 4 until 8 shifts have been performed When this is done a complete 8 bit byte will have been processed 6 Repeat Steps 2 through 5 for the next 8 bit byte of the message Continue doing this until all bytes have been processed 7 The final contents of the CRC register is the CRC value 8 When the CRC is placed into the message its upper and lower bytes must be swapped as described below PLACING THE CRC INTO THE MESSAGE When the 16 bit CRC two 8 bit bytes is transmitted in the message the low order byte will be transmitted first followed by the high order byte For example if the CRC value is 35F7 0011 0101 1111 0111 Addr Func Data Data Data dn Data CRC CRC Count lo F7 hi 35 MODBUS RTU ASCII TCP 3 CRC GENERATION FUNCTIONS With Table Allof the possible CRC values are preloaded into two arrays which are simply indexed as the function increments through the message buffer One array contains all of the 256 possible CRC values for the high byte of the 16 bit CRC field and the other array contains all of the values for the low byte Indexing the CRC in this way provides faster execution than would be achieved by calculating a new CRC value with each new character from the messa

Download Pdf Manuals

image

Related Search

Related Contents

New York Independent System Operator Request for  EventBoard Documentation  ONKYO® SERVICE MANUAL  H42-4-1-17-2F - Publications du gouvernement du Canada  イベント(露店等)  Black & Decker TRO4050 Use & Care Manual  

Copyright © All rights reserved.
Failed to retrieve file