为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

澳大利亚红相表mk6通信规约

2018-08-05 27页 doc 78KB 90阅读

用户头像

is_833902

暂无简介

举报
澳大利亚红相表mk6通信规约澳大利亚红相表mk6通信规约 Command Line Protocol 4-1 Chapter 4 Command Line Protocol Command line is the protocol the meter uses to communicate with the outside world. This chapter is for designers implementing systems that talk to the meter directly. The command line access...
澳大利亚红相表mk6通信规约
澳大利亚红相mk6通信规约 Command Line Protocol 4-1 Chapter 4 Command Line Protocol Command line is the protocol the meter uses to communicate with the outside world. This chapter is for designers implementing systems that talk to the meter directly. The command line access facility is designed to allow transfer of data from EDMI equipment. Commands are sent to the unit using a fixed set of instructions as detailed below. This mode is how communications are made from both local and modem connections. When a valid log-on message is received, access is granted, and in the case of remote access, the unit will hang up and dial back using the phone number that matches the user if one is provided. Once final connection is made, the caller is then able to send commands to the unit. All commands are initiated with the STX character and are terminated with the ETX character, and conform to the following general format. Where is the contents of the command message being sent and is a 16 bit CRC-16 polynomial checksum defined by the CCITT standard, calculated over the entire message including the STX but not the CRC itself or the ETX character. The checksum is omitted if there is no command as is the case with the message. The meter replies to commands with a response message in the following format. Where response may be: (hex 6) - the command was successful. (hex 18) - CRC was correct but the command was unsuccessful. or a response message containing data. C h a p t e r 4 4-2 EDMI Genius Register Manual The contents of , and are sent in binary format. As a result it is possible that special control characters like the may appear in the message data and cause confusion as to the true start and end of the transfer. To avoid these problems a form of character stuffing is used. Special control characters are sent as a two-character control sequence consisting of a DLE (hex 10) character followed by the original character with its bit 6 set. The receiver intercepts and removes all DLE characters and clears bit 6 of characters following the DLEs. The following characters are treated in this way: (hex 02) sent as < B> (hex 10)(hex 42) (hex 03) sent as (hex 10)(hex 43) (hex 11) sent as (hex 10)(hex 51) (hex 13) sent as (hex 10)(hex 53) (hex 10) sent as

(hex 10)(hex 50) The format of each field in the following commands is defined as follows: “test” denotes a null-terminated string. (The “ “ are not literally sent ) {5} denotes an 8 bit integer. [10] denotes a 16 bit integer. (1000) denotes a 32 bit integer. <1.23> denotes a 32 bit floating point number. Note that all multi-byte values (integers and floats) are transferred MSB first (Motorola Format). A “Response Code” means an in the case of success, or a followed by a reason code in the case of failure. The reason codes are: Code Meaning 1 Cannot write (eg serial number already set) 2 Unimplemented operation 3 Register not found 4 Access denied (Security reasons) 5 Wrong length (Number of byte in request was incorrect) 6 Bad type code (Internal error) 7 Data not ready yet (still processing). Try again later. 8 Out of range. Written value was out of defined ranges. 9 Not logged in. , Table 4-1 Command line response codes Command Line Protocol 4-3 Command : Response : This is the initial message used to start the command line access. As there is no command body the CRC is omitted. Receipt of the message causes the unit to enter command line mode. Command : L”id,pw” Response : Used to log-on to the system. “id” is the user ID and “pw” is the password, with a null termination on the end of the password. Note that the ID and password are case sensitive. The string is null terminated. Command : X Response : This command causes a session log-off. In the case of a remote access, the modem will be disconnected. Command : I[reg_num] Response : I[reg_num]/data/ This command returns information about register reg_num. /data/ is a null-terminated string of the form: “ is the type letter of the register (see the table of available types earlier). If this sequence is extended in the future, it will be extended to use lower case letters as well. External types are ones which will be returned by the information command. 4-4 EDMI Genius Register Manual Measurement Unit A Amps D Angle in degrees H Hz M Minutes N No unit P Percent Q Power Factor R Vars S VA T Seconds U Unknown -> undefined V Volts W Watts X Wh Y Varh Z Vah , Table 4-2 Information command units The form of is an up to 16-character null terminated description of the register. If the register cannot be accessed (for any reason, including security reasons) a unit of „N? and a data type of „U? (for unknown) will be returned. The description in this case will be „Register xxxx?. Command : R[reg_num] Response : R[reg_num]/data/ This command returns the data requested in register reg_num. All registers are listed in the section „Register Tables? at the rear of this document. The first 16 bits of the 32 bit register number are assumed to be zero. A capital „D” can be appended to the read command, causing Time of Use registers to be returned as double floats instead of single floats. The format of the command is then: R[reg_num]D On registers that do not support double floating point the „D? will have no effect. Command : W[reg_num]/data/ Response : or Command Line Protocol 4-5 This command sends data to be written to register reg_num. The format of /data/ must match the format of the register. All registers are listed in the section „Register Tables? at the rear of this document. The unit will respond with if the command was successful or if an attempt was made to write to a read only register. The first 16 bits of the 32 bit register number are assumed to be zero. Command : M(reg_num) Response Success: M(reg_num)/data/ Response Failure: Response Code This command returns the data requested in register reg_num. All registers are listed in the section „Register Tables? at the rear of this document. The Time of Use registers are always returned as double floats instead of single floats with this command. Multiple Register Read Using the read register extended command reading from a special register, multiple non consecutive registers can read to increase the overall throughput. Similar to the A command except a non consecutive list of registers can be read. There are two special registers for the two different types of multiple reads : FFF0 – Returns one error code for the whole block of register reads. If one read fails, the whole command will return a CAN. FFF1 – Returns one error code for each register read. The whole reply will always return successful even if all the reads fail. Should a register fail, Result Code n will be non zero and /data n/ will be replaced with the standard Error string. 1) Multiple Read, One error code Command : M<0000FFF0> ... Response Success : M<0000FFF0>/Data 1//Data 2/ ... /Data n/ Response Failure : CAN{Error code} 2) Multiple Read, Multiple Error Codes Command : M<0000FFF1> ... Response Success/Failure : M<0000FFF1>{Result Code 1}/Data 1/{Result Code 2}/Data 2/ ...{Result Code n}/Data n/ 4-6 EDMI Genius Register Manual Command : N(reg_num)/data/ Response : Response Code This command sends data to be written to register reg_num. The format of /data/ must match the format of the register. All registers are listed in the section „Register Tables? at the rear of this document. The unit will respond with if the command was successful or if an attempt was made to write to a read only register. Multiple Register Write Using the read register extended command reading from a special register, multiple non consecutive registers can read to increase the overall throughput. Similar to the A command except a non consecutive list of registers can be read. There are two special registers for the two different types of multiple reads : FFF0 – Returns one error code for the whole block of register writes. If one write fails, the whole command will stop and return a CAN. Any registers before the error will be written correctly but any registers after will not. FFF1 – Returns one error code for each register write. The whole reply will always return successful even if all the writes fail. Should a register fail, Result Code n will be non zero and the standard Error string will follow. 1) Multiple Write, One error code Command : N<0000FFF0>/data 1//data 2/ … /data n/ Response Success : ACK Response Failure : CAN{Error code} 2) Multiple Write, Multiple Error Codes Command : N<0000FFF1>/data 1//data 2/ … /data n/ Response Success/Failure : {Result Code 1}{Result Code 2}...{Result Code n} Even successful writes will return a CAN if a write fails on any/all register(s). Data has to be the correct length. If a response code is non-zero (i.e. an error occurred), the nullterminated error code string will follow it. As far as the whole message is concerned it will always be successful even if all the writes fail. Warning : Care must be taken when writing multiple registers. On a write failure the command will abort, leaving some registers unwritten and some written. Command Line Protocol 4-7 Command : O(reg_num) Response : O(reg_num)/data/ or Response code if invalid command This command returns information about register reg_num. /data/ is a null-terminated string of the form: “” If the register cannot be accessed (for any reason, including security reasons) a unit of „N? and a data type of „U? (for unknown) will be returned. The description in this case will be „Register xxxx?. Command : A(reg_num){num_reg} Response Success: A(reg_num){num_reg}/data/ Response Failure: Response Code This command returns the data requested from num_reg registers starting at reg_num. Note that strings are read variable length. The Time of Use registers are always returned as double floats instead of single floats with this command. Command : B(reg_num){num_reg}/data/ Response : Response Code This command sends data to be written to num_reg registers starting at register reg_num. The format of /data/ must match the format of the register. Note that strings are variable length, and the registers of type „J? cannot be written this way. All registers are listed in the section „Register Tables? at the rear of this document. The unit will respond with if the command was successful or if the register cannot be written. Command : none Response : S(reg_num){data type}/data/ This command is only ever a response. This is the format used by the Eziport to send data. The registers to transmit are already set up in the meter, and the data is simply 4-8 EDMI Genius Register Manual transmitted one register at a time in the above format. If a register read fails, the register is not transmitted at all. The Time of Use registers are always returned as double floats instead of single floats with this command. Structured files are how survey information is transferred. These commands allow the information to download to be specified precisely. Command : FR(reg_num)(start record)[number of records][record offset][record size] Response : FR(reg_num)(Actual start record)[Actual number of records][Actual record offset][Actual record size]/data/ Response fail : Response Code If the start record is too early, it is skipped forward to the first record. If it is too late it is skipped back to just past the last record, with zero records transmitted. If the number of records is too large, it is reduced to the end of the file, or to the block size limit. If the record offset is too large, it is set to the size of the record. If the record size is too large, it is reduced to the actual record size, or the maximum block size. Command : FW(reg_num)(start record)[record offset][record size]/data/ Response : Response Code Any errors in the sizes of the data to be written will cause the write to fail. Command : FI(reg_num) Response : FI(reg_num)(start record)(number of records)[record size]{file type}”File Name” Response Fail: Response code File type: bit 0: time searchable. Command Line Protocol 4-9 Command : FS(reg_num)(start record){date}{month}{year}{hour}{minute}{second}{dir} The date/time is the date/time to search for. Response : FS(reg_num)(start record){date}{month}{year}{hour}{minute}{second}{result} The date/time is the date/time found. Response Fail: Response code Searches for a particular time. Dir = 0: Searches from the start record backwards then stops - gives the first matching entry. If the indicated time is passed without an exact match, the entry following the indicated time is returned. Dir = 1: Searches from the start record forwards - gives the first matching entry. If the indicated time is passed without an exact match, the entry before the indicated time is returned. Result = 0: Found exact match. Result = 1: Hit end of file. Result = 2: Found the closest match. Result = 3: Couldn?t find anything - no time stamps in survey. Result = 4: No data recorded in survey. Command : E(Destination?s #)(Source?s #)[Sequence]/normal command/ Response : E(Source?s #)(Destination?s #)[Sequence]/normal response/ The „E? command is designed to extend the command line protocol to allow for multidrop communications, and to allow re-transmissions and broadcast messages. All other commands can be executed via the „E? command. Destination is the serial number of the meter the message is for. The serial number forms an address. Source is the serial number of the requesting program etc. The serial number gives a unique address of a unit, so software on a PC will need a serial number for this purpose. 4-10 EDMI Genius Register Manual Sequence number is a number from 1 to 32767 that should be different for each request. For the response the source and destination serial numbers are swapped, so the requesting programs serial number is now in the destination position (first number). Broadcast messages: A serial number of FFFFFFFF is a broadcast message. All units accept, but none send a response. A serial number of FFFFFFFE is a broadcast message. All units accept, and all send a response. A serial number of FFFFFFFD is a broadcast message reserved for mapping RS485 sites. All units accept, and all send a response a random period of time later. The maximum time period is specified by the original command. The returned packet will have the broadcast number replaced with the unit?s address. Sequence Numbers: Each transmission is sent with a sequence number that is different at least from the previous sequence number. The response is sent with the same sequence number, allowing verification that the response is from the correct request. Re-transmissions have the same sequence number as the original. In this way if the meter never received the original request it will now be done, otherwise the response it sent last time will be sent, but the command will not be re-executed. The last transmission from the meter is kept in a buffer. If a re-transmission is requested, that is sent again. The MSB of the sequence number is reserved and should normally be zero. The exception to this rule is that sequence number 65536 will never give a re-transmission. This can be used where it is unknown what the last sequence number was. If a normal command occurs after an extended command, re-transmission of the extended command response are not possible, and the command will be executed as if it was a new sequence number. Command Line Protocol 4-11 OUT: ; Start command-line access. IN: ; ACKnowledge from unit OUT: LBASIL,BRUSH<0> ; Log-on as BASIL, with password BRUSH. IN: ; ACKnowledge from unit OUT: W[F007]HAMSTER<0>; Change site name to HAMSTER. IN: ; ACKnowledge from unit OUT: X ; Log-off from master. IN: ; ACKnowledge from unit The CRC is a 16 bit CRC-16 polynomial checksum defined by the CCITT standard, calculated over the entire message including the STX but not the CRC itself or the ETX character. The checksum is omitted if there is no command as is the case with the message. 4-12 EDMI Genius Register Manual Intentionally Blank Command Line Access Tutorial A-1 Apendix ACommand Line Access Tutorial This section gives detailed step by step examples of accessing the meter using command line mode. It also covers IEEE floating point format in detail. The example used here is to read the serial number of the meter. The register number of this can be found from the register listing in the manual to be F002. First start with an STX, hex 02. Hexadecimal: [02] Decimal: 2 Next decide on the command. To read a register the command is „R?, which is 82 in decimal. Hexadecimal: [02]R Decimal: 2,82 The register to be read is appended to the command, most significant byte first: Hexadecimal: [02]R[F0][02] Decimal: 2,82,240,2 Now add the 16 bit CRC checksum of these 4 numbers. This is EE45 in hexadecimal, 60997 in decimal. This is separated into two 8 bit numbers, most significant first. We now have: Hexadecimal: [02]R[F0][02][EE][45] Decimal: 2,82,240,2,238,69 Certain characters are reserved as control characters. It any of them exist in the message they must be substituted. The reserved numbers are 2, 3, 16, 17, 19. If any of these numbers occur, a number 16 is inserted in front of it, and 64 is added to the number. For example, the number 2 occurs in the third position of the example. This must be replaced with a 16, followed by a 66. The first STX (2) is skipped as this is a control character. The result is: A p p e n d i x A A-2 EDMI Genius Register Manual Decimal: 2,82,240,16,66,238,69 Now framing characters are added to the end. The number 3 (STX) is added to the end. We now have: Decimal: 2,82,240,16,66,238,69,3 This is the data that is transmitted to the meter. The meter will then respond in the following manner: Hexadecimal: [02][52][F0][10][42][39][33][30][30][30][30][30][00][1B][10][42][03] Decimal: 2,82,240,16,66,57,51,48,48,48,48,48,0,27,16,66,3 Note that the start and end of the message is marked by the numbers 2 (STX) and 3 (ETX). Now the reserved control characters can be recovered. Anywhere that the number 16 occurs, it is removed and the number following it has 64 subtracted. There are 2 places this occurs in the example: Hexadecimal: [02][52][F0][02][39][33][30][30][30][30][30][00][1B][02][03] Decimal: 2,82,240,2,57,51,48,48,48,48,48,0,27,2,3 The 2nd and 3rd last numbers form the 16 bit CRC checksum of the data (MSB first). The checksum is checked by calculating the 16 bit CRC over all the numbers up to and excluding the CRC numbers (e.g. 2 to 0). If the checksum is wrong, the message is discarded because it is corrupted. The checksum and STX/ETX framing can now be removed. Hexadecimal: [52][F0][02][39][33][30][30][30][30][30][00] Decimal: 82,240,2,57,51,48,48,48,48,48,0 The first number represents the type of response that this is. In this case the first number is 82, which is the ASCII code of the letter „R?, indicating this is the response to a read request. The following two numbers make up the register that was requested, F002. This information can be useful in processing the response. Without the response type, the data is: Hexadecimal: [39][33][30][30][30][30][30][00] Decimal: 57,51,48,48,48,48,48,0 Looking up the tables in the manual indicates that register F002 is of string type. This consists of a sequence of letters, followed by a number 0, indicating the end of the string. If we show the data as ASCII letters, it becomes: Text: 9300000 followed by a zero, indicating the end. This is the serial number read from the meter! Command Line Access Tutorial A-3 To access the meter, we have to get its attention, log onto it, read/write any amount of data, then log off the meter. The following sequence illustrates this: Send an Escape character, followed by a short message with only start and stop codes. Hexadecimal: [1B][02][03] Decimal: 27,2,3 This should return an acknowledge . Hexadecimal: [02][06][06][A4][03] Decimal: 2,6,6,164,3 Which is the response command ACK (the number 6). There is no data associated with this response. Now to log on to the meter use the log on command „L?, using user name „EDMI? and a password of „IMDEIMDE?. Hexadecimal: [02][4C][45][44][4D][49][2C][49][4D][44][45][49][4D][44][45][00][D9][69][03] Text: [02]LEDMI,IMDEIMDE[00][D9][69][03] If this is successful an acknowledge will be sent. Hexadecimal: [02][06][06][A4][03] Decimal: 2,6,6,164,3 If it is not successful, a CAN (the number 24) will be sent Hexadecimal: [02][18][F5][5B][03] Decimal: 2,24,245,91,3 If the log on was successful, registers can now be read and written. E.g. read the serial number. Hexadecimal: [02][52][F0][10][02][EE][45][03] Decimal: 2,82,240,10,66,238,69,3 and the response is: Hexadecimal: [02][52][F0][10][42][39][33][30][30][30][30][30][00][1B][10][42][03] Decimal: 2,82,240,10,66,57,51,48,48,48,48,48,0,27,16,66,3 When access is complete, logging off the meter is done using the „X? command. Hexadecimal: [02][58][BD][9F][03] Decimal: 2,88,189,159,3 This should return an acknowledge . A-4 EDMI Genius Register Manual Hexadecimal: [02][06][06][A4][03] Decimal: 2,6,6,164,3 Notes: The utility program „REGTEST.EXE? available from EDMI can be used to test access to the meter, and with the „-H? option it will display all transmitted and received characters. This is useful if precalculated requests are used. Note though that if a byte is DLE?d (as in the second case above), Regtest with the -H option will display the byte following the DLE without the 6th bit set. For example REGTEST would display [02][52][10][02][69][46][2B][03] which should be transmitted as [02][52][10][42][69][46][2B][03] In order to simplify implementation on simple systems, the requests can be precalculated (including the checksum) and transmitted. On a reliable medium the check of the received CRC could be skipped to avoid doing any CRC calculations at all, although this does risk erroneous data being accepted. A second utility „REGTEST2.EXE? is now available. Contact EDMI for availability. Command Line Access Tutorial A-5 Floating point numbers are sent/received in the IEEE standard formats for single precision floating point numbers, or optionally double precision. The format of single precision floating point numbers is as follows: ----------------- * sign * 1 bit ----------------- * exponent * 8 bits ----------------- * mantissa * 23 bits + 1 implied bit = 24 bits ----------------- Double floating point is as follows: ----------------- * sign * 1 bit ----------------- * exponent * 11 bits ----------------- * mantissa * 52 bits + 1 implied bit = 53 bits ----------------- The implied bit is always 1 except for a zero value where it is zero. A zero value is indicated by a zero exponent. The exponent for a float is stored as excess 127 (i.e. an exponent of 0 is represented by 127) and for a double as excess 102. The mantissa is in positive magnitude form. The most significant byte (i.e. that containing the sign) comes first. So say for example reading register E002 (phase C voltage) returns 43 71 73 88 As a 32 bit binary number this is 0100 0011 0111 0001 0111 0011 1000 1000 We now split this up into its components. Sign bit: 0 Exponent: 10000110 Mantissa without implied bit: 111 0001 0111 0011 1000 1000 We now add the implied bit and show the point: 1.111 0001 0111 0011 1000 1000 The exponent is 134 in decimal. The exponent is thus 134 - 127 = 7. This means we must multiply the mantissa by 27. This can be achieved by shifting the point right by 7 bits. The mantissa we then get is: A-6 EDMI Genius Register Manual 1111 0001 . 0111 0011 1000 1000 To convert this to decimal we use two stages. First of all the whole part: 1111 0001 binary = 241 decimal Now the fractional part: 0111 0011 1000 1000 binary = 29576 decimal then divide by 2 to the power of the number of binary digits: 29576 / 216 decimal = 0.45129 decimal Combining whole and fractional parts: 241.45129 The sign bit was a zero, indicating that the number is positive, giving us a final answer of +241.45129 volts CRC Calculation B-1 Apendix BCRC Calculation There are many ways to calculate the CCITT 16 bit CRC of a data stream. The following implementation (in „C?) is one method. short gencrc_16(short i) { short j; short k; short crc; k = i << 8; crc = 0; for ( j = 0 ; j < 8 ; j++ ) { if ( ( crc ^ k ) & 0x8000 ) crc = ( crc << 1 ) ^ 0x1021; else crc <<= 1; k <<= 1; } return(crc); } unsigned short CalculateCharacterCRC16( unsigned short crc, unsigned char c ) { return( ( crc << 8 ) ^ gencrc_16( (crc >> 8 ) ^ c ) ); } The function gencrc_16 could be replaced by a table. The range of its argument is from 0 to 255 (a single character). CalculateCharacterCRC16 is called for every character, with the current CRC count, and the character to add to the CRC. It returns a new CRC including that character. The initial CRC should be set to zero. A p p e n d i x B B-2 EDMI Genius Register Manual The following is a Pascal routine for calculating the CRC from the table listed later. function CalculateCharacterCRC16(CRC:Word;B:Byte):Word; begin {$R-} CalculateCharacterCRC16:=((CRC shl 8) XOR Ccitt16[Hi(CRC) XOR B]); {$R+} end /* * These are the tables used by the table lookup method of * generating CRC values. */ const unsigned short ccitt_16[ 256 ] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 }; CRC Calculation B-3 This routine generates the above table. void build_table_16( unsigned short table[] ) { short i; short j; short k; short crc; for ( i = 0 ; i < 256 ; i++ ) { k = i << 8; crc = 0; for ( j = 0 ; j < 8 ; j++ ) { if ( ( crc ^ k ) & 0x8000 ) crc = ( crc << 1 ) ^ 0x1021; else crc <<= 1; k <<= 1; } table[ i ] = crc; } }

/
本文档为【澳大利亚红相表mk6通信规约】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索