03-24-2013 12:10 PM
Hi,
I am new to LabView ...I want to create vis for automatic control of instrument...I am really need help in crc checksum calculation....i have an example
slave address 0x08
function code 0x06
register adress 0x0001
Register data 0x1388
checksum 0xD5C5
I would like to get checksum above one from the above mentioned data..How to create this vi can any one help please......
03-24-2013 02:29 PM
03-25-2013 05:17 AM
HI GerdW,
Thanks for the reply ....i found a programming code for that..i would like to have vis for that programme accordingly..i tried out in many ways but couldnt...here i have attached the document of code...please look into it ..and i would like to get the above check sum mentioned in the above post..
Thanking you...
03-25-2013 05:26 AM - edited 03-25-2013 05:28 AM
Hi Maheshk,
your rtf as simple text looks like that:
Data meaning :data frame CrC checkupsum, using 2 bytes. Checksum =address +functioncode+data CRC computation program: unsigned int cal_crc16 (unsigned char*data,unsigned int length) { unsigned int i,crc_result = 0xffff; while(length--) { crc_result^=*data++; for(i=0,i<8;i++) { if(crc_result&0x01) crc_result=(crc_result>>1)^0xa001; else crc_result=crc_result>>1; } } crc_result=((crc_result&0xff)<<8)|(crc_result>>8); return(crc_result);
This is just basic bit/boolean operations (AND, OR, XOR, shift). Try to code that in LabVIEW, it's a good exercise...
Post what you got and we will help, when problems arise!
03-25-2013 05:38 AM - edited 03-25-2013 05:39 AM
Or search for crc16!