128
Elmark Automatyka S.A.
ul. Niemcewicza 76, 05-075 Warszawa, tel. (+48) 22 773 79 37; [email protected]; www.elmark.com.pl
NIP: 5252072585; KRS: 0000803828, Sąd Rejonowy dla M-St. Warszawy, XIV Wydział Gosp. KRS; Kapitał Zakładowy 525.000 zł, w pełni opłacony
low-order position of CRC CHK
Wait to calculate the CRC CHK values
high-order position of CRC CHK
The command code:06H write a word(Word)For example, write 000(BB8H)to slave machine.
Address 05H inverter's F00AH address. The host command information
ADR
05H
CMD
06H
high-order position of data address
F0H
low-order position of data address
0AH
high-order position of information content
0BH
low-order position of information content
B8H
low-order position of CRC CHK
wait to calculate the CRC CHK values
high-order position of CRC CHK
In response to information from the slave machine
ADR
02H
CMD
06H
high-order position of data address
F0H
low-order position of data address
0AH
high-order position of information content
13H
low-order position of information content
88H
low-order position of CRC CHK
Wait to calculate the CRC CHK values
high-order position of CRC CHK
Check way---CRC Check way: CRC(Cyclical Redundancy Check) use RTU frame format. The message includes error detection field
based on the method of CRC .CRC domain test the whole content of a message. CRC domain is two bytes. contains a 16-bit binary
values.it is calculated by the transmission equipment, added to the message. receive messages the device recalculate. And
compared with receives the CRC in the domain of value, if the two CRC value is not equal, then there is an error in transmission.
CRC is saved in 0xFFFF,Then call a process to continuous B-bit bytes of the message and the values in the current register for
processing. Only 8 bit data in each character of CRC is effective. Starting bit and stopping bit and parity bits are invalid.
In the process of CRC, Each of the eight characters are separate and dissimilar or register contents(XOR),The results move to the
least significant bit direction, set the most significant bit to 0. LSB is extracted to test, if set LSB to 1,Register and preset value
dissimilarity or alone. if set LSB to 0, is not to. The whole process will repeat B times. when the last time ( the eighth time) is
completed, next 8-bit bytes and separate and register under the current value of the alien or. The values in the final register, ls all
bytes in the message is executed after the CRC value.
When CRC added to the messages .The low byte to join first and then high byte. CRC Simple function is as follows:
unsigned int crc_cal_value(unsigned char *data_value,unsigned char data_length)
{
int i;
unsigned int crc_value=0xffff; while(data_length-)
{
crc_value^=*dat+; for(i=0;i<8;i++)
{
lf(crc_value&0x0001) crc_value=(crc_value>>1)^0xa001;
else crc_value=crc_value>>1;
}
}
Return(crc_value);
}
Summary of Contents for elmatic ED2000
Page 1: ......